(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > Triggers & Scripts

Triggers & Scripts Discussions regarding GUI triggers & JASS/AI scripts may be found here. Please review the » JASS Tutorials » Trigger Tutorials

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-20-2004, 09:41 AM   #1 (permalink)

User
 
Join Date: Jun 2004
Posts: 240

Tommi has little to show at this moment (1)


Introduction to AI Scripting

There are two ways of making AIs:
  • AI scripting (including AIs made in the AI editor)
  • triggers
Both of them have advantages and disadvantages.


AI Scripting
Description: Looping scripts that can call functions in common.ai and common.j.

Pros:
+ Building/training, rebuilding, expanding are rather straightforward (no control over exact building locations though)
+ Attacking is pretty simple

Cons:
- Supports only 1 attack group and 1 defense group
- Little control over the attack & defense group (no direct functions to check which units are there etc.)
- Can't remove units from the attack group (only when they die, they are removed)
- Many functions don't work, such as ForGroup and string returning functions. Some workarounds exist. See the list here.


Triggers
Description: Event-based procedures that can call functions in Blizzard.j and common.j.

Pros:
+ A great deal of control over units and their orders
+ Some high level actions, such as building, expanding, rebuilding, etc. not so easy to implement as in AI scripts. (Totally possible, though)

Cons:
- May be slower & CPU intensive than AI scripts, depending on their implementation
- May require a lot of work


Overall

AIs are best used for high level actions, such as building, expansion, etc., which would require a lot of trigger work. AIs can't respond immediately to events, since they are not event based.

Triggers are best used for detailed actions and events, such as ordering a single unit to move to a location when a specific event happens. Also, triggers are the way to go, if you want more than one attack group per player.


Combining AI scripts and Triggers

You can combine AI scripts and triggers by using the AI - Send AI command trigger action, which is used to communicate between the AI and triggers. You can also communicate through functions that set and get non-string values in common.j (e.g. unit custom values and player properties). The AI script may check these values and adjust its behavior based on them. You can use the values sent through AI commands in the conditions of the AI editor. An AI script can also set some values (e.g. unit custom values or player properties) to communicate to triggers.

Cheers!
__________________
Tommi is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[JASS] SimCityWars Scripting xtrapas Triggers & Scripts 0 10-21-2005 04:30 PM
scripting errors? Kiviknon Map Development 1 09-07-2005 01:42 AM
What need to be when scripting ClawMaster Modeling & Animation 0 03-17-2005 03:04 PM
Custom Scripting Eusira Triggers & Scripts 1 09-26-2004 08:50 AM
Custom Scripting Chaotica Warcraft Discussion 0 01-01-1970 01:46 AM

All times are GMT. The time now is 10:21 PM.






Your link here 
Debt Consolidation | Send Text Message | Credit Cards | Credit Cards | MPAA
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle