grover1311
12-30-2006, 3:17 AM
Since so many people have been asking questions about triggers I thought it was time to explain it to them. I know that there is the modding/mapping resource FAQ but I am going to explain every trigger and the ai scripts.
Most triggers will need locations. To place a location u click on the drop down menu were it says terrain layer and u select location, now place your location any where and double click on it and name it anything you want.
Ok lets go through the conditions.
Accumulate:
Most of you would know that accumulate means to gather, so obviously this action means certain player collects minerals/gas it will start the actions.
Always:
This condition will automatically skip to the actions.
Bring:
The action will activate when a set player brings any units to a location.
Command:
If a certain player commands units the action will start.
Command the least:
The player with the least units will activate the action.
Command the leas at:
The player with the least units will activate the action at a location.
Command the most:
The player with the most units will activate the action.
Command the most at:
The player with the most units will activate the action at a location.
Countdown timer:
It sets a timer to count down a certain amount of time for a set player and
then starts the actions.
Deaths:
Soon as an amount of unit’s die the actions will be activated.
Elapsed time:
Soon as a certain time in game the actions will be activated to a set player.
NOTE: not the same as countdown timer, that condition will start a timer. This one will start a action soon as that time in the game comes.
Highest score:
A player with the highest amount of points will activate the actions.
Kill:
If a certain player kills amount of units the actions will be activated.
Least kills:
If a player has least kills of a units or all units the actions will be started.
Least resources:
The set player with the least resources will activate the actions.
Lowest score:
The set player with the lowest score will activate the actions.
Most kills:
A set player has the most kills will activate the actions.
Most resources:
The set player with the most resources will activate the actions.
Never:
This will do the opposite of always it will not activate the actions.
Opponents:
a set player has a certain amount of opponents left in the game will activate the actions.
Score:
If a set player has a certain score it will activate the actions.
Switch:
This allows you to test against a switch value. Switches are on/off values that can be set with an action. Switches can be used to keep track of which triggers have been activated, to disable or enable certain triggers or to link multiple triggers together. You may also rename switches from this dialog box.
Now lets go through the Actions.
Center view:
This will automatically move you to a certain location
Comment:
This will add a comment to the trigger box so you can keep track of them.
Create units:
This will create units for a certain player at a location.
Create units with properties:
This will create units with properties (cloaked, burrowed etc.)For a certain
player at a location.
Defeat:
Player gets defeat.
Display text message:
This will display text on the screen while you are playing the map.
Draw:
This will end the map in a draw for selected players
Give units to player:
This will give units that are owned by another player to the selected player at a location.
Kill unit:
This will kill units for a selected player.
Kill units at location:
That will kill units for a selected player at a location.
--! Leader board control will be added in later !—
Mini map ping:
This will set of a ping on the mini map (the little lines that form a square when a upgrade is complete)
Modify unit energy:
This will change the amount of energy a unit has for a selected player at a location.
Modify units hangar count:
This will modify how many things are in the hangar (scarabs, interceptors, spider mines) at a location.
Modify unit hit points:
This will modify the amount of health a unit has at location.
Modify unit resource amount:
This will modify how many resources there is in units (refinery could be changed from 2782 vespene to 4 vespene).
Modify unit shield points:
This will change the amount of shield points a units has for a selected player at a location.
Move location:
This will center a location on a unit owned by a certain player in a location
Move units:
This will move units form 1 location to the other (so u can make teleporters etc.)
Mute unit speech:
This action will mute all non-trigger units for a selected player.
Order:
This will tell a units owned by a certain player to ether move, attack or patrol from a location to another one (move: just walk no attack, patrol: will keep moving between location and attacking any enemy, attack: will attack any enemy it sees on its way to location.)
Pause game:
This will pause the game (nothing will move).
Pause timer:
This will pause a timer that is going.
Play WAV:
This will play a sound (has to be wav)
Preserve trigger:
Reuses the trigger through the whole map, if there isn’t a preserve trigger the trigger will only happen once.
Remove unit:
This will remove all units from the map for a certain player
Remove units at location:
This will remove a certain amount of units of the map at a location owned by a certain player.
Set alliance status:
This will change certain players to enemy, ally or to allied victory .
Set countdown time:
This will start a timer that you can see in the game.
Set deaths:
This will change a certain amount of deaths for a certain unit for a certain player.
Set Doodad State:
This will enable or disable the Doodad State for certain units at a location
(this will open doors, activate enemy traps, on instillation maps and other stuff like that)
Set invincibility:
Sets certain units invincible (cant be killed) or not invincible (cant be killed) for certain players at a location.
Set mission objectives:
This will change the objectives of the map
NOTE: it will not display it on screen so if you want you can use display text message and type in new objective or something
Set next scenario:
This will load the next map you have chosen after the conditions have been filled (used for campaigns)
Set resources:
This will set resources (add, subtract, set) to a chosen number for a certain player.
Set score:
Modifies the score for a selected player to a chosen amount. (add, subtract, set).
Set switches:
The set switch action can be used to:
Set a switch to its set position.
Clear a switch to its cleared position.
Toggle a switch: if a switch is cleared, it becomes set; if it is set, it becomes cleared.
Randomly choose between the set or cleared position.
You may also modify the switch names from this dialog box.
Talking portrait:
This will display a talking portrait of a chosen unit for a chosen amount of time.
Unmute unit speech:
This will unmute all non-trigger units.
Unpause game:
This will unpause the game
Unpause timer:
This will unpause a timer
Victory:
Certain player wins after conditions are fulfilled
Wait:
It will wait a certain amount of time before next trigger
These scripts can be activated by using the ‘run ai script" and "run ai script at location" actions
I am going to explain what ai script does what.
Ai scripts:
Send all units on a strategic suicide mission:
All computer units will mass and attack one target at a time until all enemy
structures and units are dead.
Send all units on a random suicide mission:
All computer units will choose random targets and attack anything that they see.
Switch Computer Player to Rescuable:
The computer town will become a rescuable area, and the player(s) in the campaign can gain control of all available units and/or structures.
Ai scripts at locations:
Terran custom level to expansion protoss campaign area town:
These are the difficulty setting the computer will run at, select one of these and the computers will mine resources, build buildings and men.
Set Player to Enemy:
Sets a chosen player to enemy
Set Player to Ally:
Sets a chosen player to ally
Value this Area Higher:
The computer will see the area more important and will send units to defend it.
Enter Closest Bunker:
This will make any unit at a location entered the closet bunker with a free
space.
Enter Transport :
This will make all units at a location enter some sort of transport.
exit transport:
This will make all units exit a transport at a location.
hyper triggers (from starcraft.org):
Hyper triggers can only be used on player who does not have any wait commands. It's pretty easy, simply make a trigger for a single player that does not have any other wait commands this trigger: Wait 0 milliseconds and copy it until it won't let you copy it anymore (you'll end up with 64 wait 0 commands), then delete one and add a Preserve trigger action. Save that trigger, then copy the whole trigger three times. You will have 3 triggers, each filled with 63 Wait 0 milliseconds commands and one Preserve trigger. This will cause StarCraft to process all your triggers much faster, and so will ensure you have speedy hyper triggers throughout the game.
ai scripts for advance map editors(only scxe for now):
ai scripts:
turn shared vision on for players 1 - 8:
will turn on shard vision causing a player to see everything another player can
turn shared vision off for players 1-8:
will turn of vision from another player.
ill do scmdraft later
Hope this guide helps all those ppl asking questions about triggers.
If I am missing something or you want to add something pm me.
Most triggers will need locations. To place a location u click on the drop down menu were it says terrain layer and u select location, now place your location any where and double click on it and name it anything you want.
Ok lets go through the conditions.
Accumulate:
Most of you would know that accumulate means to gather, so obviously this action means certain player collects minerals/gas it will start the actions.
Always:
This condition will automatically skip to the actions.
Bring:
The action will activate when a set player brings any units to a location.
Command:
If a certain player commands units the action will start.
Command the least:
The player with the least units will activate the action.
Command the leas at:
The player with the least units will activate the action at a location.
Command the most:
The player with the most units will activate the action.
Command the most at:
The player with the most units will activate the action at a location.
Countdown timer:
It sets a timer to count down a certain amount of time for a set player and
then starts the actions.
Deaths:
Soon as an amount of unit’s die the actions will be activated.
Elapsed time:
Soon as a certain time in game the actions will be activated to a set player.
NOTE: not the same as countdown timer, that condition will start a timer. This one will start a action soon as that time in the game comes.
Highest score:
A player with the highest amount of points will activate the actions.
Kill:
If a certain player kills amount of units the actions will be activated.
Least kills:
If a player has least kills of a units or all units the actions will be started.
Least resources:
The set player with the least resources will activate the actions.
Lowest score:
The set player with the lowest score will activate the actions.
Most kills:
A set player has the most kills will activate the actions.
Most resources:
The set player with the most resources will activate the actions.
Never:
This will do the opposite of always it will not activate the actions.
Opponents:
a set player has a certain amount of opponents left in the game will activate the actions.
Score:
If a set player has a certain score it will activate the actions.
Switch:
This allows you to test against a switch value. Switches are on/off values that can be set with an action. Switches can be used to keep track of which triggers have been activated, to disable or enable certain triggers or to link multiple triggers together. You may also rename switches from this dialog box.
Now lets go through the Actions.
Center view:
This will automatically move you to a certain location
Comment:
This will add a comment to the trigger box so you can keep track of them.
Create units:
This will create units for a certain player at a location.
Create units with properties:
This will create units with properties (cloaked, burrowed etc.)For a certain
player at a location.
Defeat:
Player gets defeat.
Display text message:
This will display text on the screen while you are playing the map.
Draw:
This will end the map in a draw for selected players
Give units to player:
This will give units that are owned by another player to the selected player at a location.
Kill unit:
This will kill units for a selected player.
Kill units at location:
That will kill units for a selected player at a location.
--! Leader board control will be added in later !—
Mini map ping:
This will set of a ping on the mini map (the little lines that form a square when a upgrade is complete)
Modify unit energy:
This will change the amount of energy a unit has for a selected player at a location.
Modify units hangar count:
This will modify how many things are in the hangar (scarabs, interceptors, spider mines) at a location.
Modify unit hit points:
This will modify the amount of health a unit has at location.
Modify unit resource amount:
This will modify how many resources there is in units (refinery could be changed from 2782 vespene to 4 vespene).
Modify unit shield points:
This will change the amount of shield points a units has for a selected player at a location.
Move location:
This will center a location on a unit owned by a certain player in a location
Move units:
This will move units form 1 location to the other (so u can make teleporters etc.)
Mute unit speech:
This action will mute all non-trigger units for a selected player.
Order:
This will tell a units owned by a certain player to ether move, attack or patrol from a location to another one (move: just walk no attack, patrol: will keep moving between location and attacking any enemy, attack: will attack any enemy it sees on its way to location.)
Pause game:
This will pause the game (nothing will move).
Pause timer:
This will pause a timer that is going.
Play WAV:
This will play a sound (has to be wav)
Preserve trigger:
Reuses the trigger through the whole map, if there isn’t a preserve trigger the trigger will only happen once.
Remove unit:
This will remove all units from the map for a certain player
Remove units at location:
This will remove a certain amount of units of the map at a location owned by a certain player.
Set alliance status:
This will change certain players to enemy, ally or to allied victory .
Set countdown time:
This will start a timer that you can see in the game.
Set deaths:
This will change a certain amount of deaths for a certain unit for a certain player.
Set Doodad State:
This will enable or disable the Doodad State for certain units at a location
(this will open doors, activate enemy traps, on instillation maps and other stuff like that)
Set invincibility:
Sets certain units invincible (cant be killed) or not invincible (cant be killed) for certain players at a location.
Set mission objectives:
This will change the objectives of the map
NOTE: it will not display it on screen so if you want you can use display text message and type in new objective or something
Set next scenario:
This will load the next map you have chosen after the conditions have been filled (used for campaigns)
Set resources:
This will set resources (add, subtract, set) to a chosen number for a certain player.
Set score:
Modifies the score for a selected player to a chosen amount. (add, subtract, set).
Set switches:
The set switch action can be used to:
Set a switch to its set position.
Clear a switch to its cleared position.
Toggle a switch: if a switch is cleared, it becomes set; if it is set, it becomes cleared.
Randomly choose between the set or cleared position.
You may also modify the switch names from this dialog box.
Talking portrait:
This will display a talking portrait of a chosen unit for a chosen amount of time.
Unmute unit speech:
This will unmute all non-trigger units.
Unpause game:
This will unpause the game
Unpause timer:
This will unpause a timer
Victory:
Certain player wins after conditions are fulfilled
Wait:
It will wait a certain amount of time before next trigger
These scripts can be activated by using the ‘run ai script" and "run ai script at location" actions
I am going to explain what ai script does what.
Ai scripts:
Send all units on a strategic suicide mission:
All computer units will mass and attack one target at a time until all enemy
structures and units are dead.
Send all units on a random suicide mission:
All computer units will choose random targets and attack anything that they see.
Switch Computer Player to Rescuable:
The computer town will become a rescuable area, and the player(s) in the campaign can gain control of all available units and/or structures.
Ai scripts at locations:
Terran custom level to expansion protoss campaign area town:
These are the difficulty setting the computer will run at, select one of these and the computers will mine resources, build buildings and men.
Set Player to Enemy:
Sets a chosen player to enemy
Set Player to Ally:
Sets a chosen player to ally
Value this Area Higher:
The computer will see the area more important and will send units to defend it.
Enter Closest Bunker:
This will make any unit at a location entered the closet bunker with a free
space.
Enter Transport :
This will make all units at a location enter some sort of transport.
exit transport:
This will make all units exit a transport at a location.
hyper triggers (from starcraft.org):
Hyper triggers can only be used on player who does not have any wait commands. It's pretty easy, simply make a trigger for a single player that does not have any other wait commands this trigger: Wait 0 milliseconds and copy it until it won't let you copy it anymore (you'll end up with 64 wait 0 commands), then delete one and add a Preserve trigger action. Save that trigger, then copy the whole trigger three times. You will have 3 triggers, each filled with 63 Wait 0 milliseconds commands and one Preserve trigger. This will cause StarCraft to process all your triggers much faster, and so will ensure you have speedy hyper triggers throughout the game.
ai scripts for advance map editors(only scxe for now):
ai scripts:
turn shared vision on for players 1 - 8:
will turn on shard vision causing a player to see everything another player can
turn shared vision off for players 1-8:
will turn of vision from another player.
ill do scmdraft later
Hope this guide helps all those ppl asking questions about triggers.
If I am missing something or you want to add something pm me.