Triggers: Difference between revisions
m Moving clearing below TOC, hard to notice the ini format is actually there otherwise |
Added anchors |
||
Line 33: | Line 33: | ||
! Meaning | ! Meaning | ||
|- | |- | ||
! ID | ! {{Anchor|ID|td}} | ||
| This trigger's ID. | | This trigger's ID. | ||
|- | |- | ||
! EVENT | ! {{Anchor|EVENT|td}} | ||
| This trigger's Event (See [[Maps/Events/TD|Events]]). | | This trigger's Event (See [[Maps/Events/TD|Events]]). | ||
|- | |- | ||
! ACTION | ! {{Anchor|ACTION|td}} | ||
| This trigger's Action (See [[Maps/Actions/TD|Actions]]). | | This trigger's Action (See [[Maps/Actions/TD|Actions]]). | ||
|- | |- | ||
! EVENT_PARAMETER | ! {{Anchor|EVENT_PARAMETER|td}} | ||
| The parameter for the Event. | | The parameter for the Event. | ||
|- | |- | ||
! HOUSE | ! {{Anchor|HOUSE|td}} | ||
| The name of the [[Maps/Houses/TD|house]] associated with this trigger, or {{Tt|None}}. This house is used as a parameter by some Events and Actions. | | The name of the [[Maps/Houses/TD|house]] associated with this trigger, or {{Tt|None}}. This house is used as a parameter by some Events and Actions. | ||
|- | |- | ||
! ASSOCIATED_TEAMTYPE | ! {{Anchor|ASSOCIATED_TEAMTYPE|td}} | ||
| Associated teamtype ID, or {{Tt|None}}. | | Associated teamtype ID, or {{Tt|None}}. | ||
|- | |- | ||
! REPEATING | ! {{Anchor|REPEATING|td}} | ||
| | | | ||
Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | ||
Line 91: | Line 91: | ||
! Meaning | ! Meaning | ||
|- | |- | ||
! R[''epeating''] | ! {{Anchor|R|ra}}[''epeating''] | ||
| Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | | Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | ||
Line 114: | Line 114: | ||
|- | |- | ||
! H[''ouse''] | ! {{Anchor|H|ra}}[''ouse''] | ||
| The index of the [[Maps/Houses/RA|house]] associated with this trigger. This house is used as a parameter by some Events and Actions. | | The index of the [[Maps/Houses/RA|house]] associated with this trigger. This house is used as a parameter by some Events and Actions. | ||
|- | |- | ||
! C[''ondition''] | ! {{Anchor|C|ra}}[''ondition''] | ||
| rowspan=2 | | | rowspan=2 | | ||
'''C'''''ondition'' can be set to {{Tt|0}}, {{Tt|1}}, {{Tt|2}} or {{Tt|3}}.<br /> | '''C'''''ondition'' can be set to {{Tt|0}}, {{Tt|1}}, {{Tt|2}} or {{Tt|3}}.<br /> | ||
Line 167: | Line 167: | ||
|- | |- | ||
! A[''ctivate''] | ! {{Anchor|A|ra}}[''ctivate''] | ||
|- | |- | ||
! E1 | ! E1 | ||
Line 226: | Line 226: | ||
! Meaning | ! Meaning | ||
|- | |- | ||
! ID | ! {{Anchor|ID|ts}} | ||
| The Trigger's ID. The game assumes the Actions and Events with the same ID belong to this Trigger automatically. | | The Trigger's ID. The game assumes the Actions and Events with the same ID belong to this Trigger automatically. | ||
|- | |- | ||
! HOUSE | ! {{Anchor|HOUSE|ts}} | ||
| The [[Maps/Houses|House]] associated with this trigger. This house is used as a parameter by some Events and Actions. | | The [[Maps/Houses|House]] associated with this trigger. This house is used as a parameter by some Events and Actions. | ||
|- | |- | ||
! LINKED_TRIGGER | ! {{Anchor|LINKED_TRIGGER|ts}} | ||
| A trigger that is fired automatically when this trigger fires, or {{Tt|<none>}} if no additional triggers should fire. | | A trigger that is fired automatically when this trigger fires, or {{Tt|<none>}} if no additional triggers should fire. | ||
|- | |- | ||
! NAME | ! {{Anchor|NAME|ts}} | ||
| A plain text string used as a name of this Trigger. Not used ingame, only in the map editor. Should not contain commas. | | A plain text string used as a name of this Trigger. Not used ingame, only in the map editor. Should not contain commas. | ||
|- | |- | ||
! ENABLED | ! {{Anchor|ENABLED|ts}} | ||
| Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is enabled at the beginning of the game. If it is disabled, another trigger has to explicitly enable it via a special Action. | | Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is enabled at the beginning of the game. If it is disabled, another trigger has to explicitly enable it via a special Action. | ||
|- | |- | ||
! EASY | ! {{Anchor|EASY|ts}} | ||
| Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Easy difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | | Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Easy difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||
|- | |- | ||
! NORMAL | ! {{Anchor|NORMAL|ts}} | ||
| Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Normal difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | | Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Normal difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||
|- | |- | ||
! HARD | ! {{Anchor|HARD|ts}} | ||
| Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Hard difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | | Can be set to {{Tt|0}} ('disabled') or {{Tt|1}} ('enabled'). Specifies whether this trigger is active in the Hard difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||
|- | |- | ||
! REPEATING | ! {{Anchor|REPEATING|ts}} | ||
| Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | | Specifies whether this trigger is repeating (see [[#The Repeating puzzle|The Repeating puzzle]] for more info). | ||
Revision as of 06:56, 10 April 2008
Map triggers are responsible for the special events happening in the map. For example, the singleplayer campaign maps have triggers to do things like "if unit x is destroyed, declare player the winner" or "if building y is still standing after twenty minutes, declare the player the loser". Without map triggers, scripting maps would be impossible.
The internal hierarchy works like this:
- A Tag or a CellTag points to a Trigger, and tells the game to consider this trigger when processing events.
- A Trigger points to an Event and an Action, and tells the game "If my Events happen, execute my Actions".
- An Event lists the condition(s) that invoke this trigger, e.g. "45 seconds have passed".
- An Action lists the actions that should be performed by the game when this trigger fires. These are things like "Give the AI three nuclear silos", "Reveal the aforealludedto silos to the player" or "Paradrop these desolators as a reinforcement for the player".
Section
TD/CO
The [Triggers] section in a map is a list of comma-separated strings that looks like this:
[Triggers] ID=EVENT,ACTION,EVENT_PARAMETER,HOUSE,ASSOCIATED_TEAMTYPE,REPEATING ID1=EVENT,ACTION,EVENT_PARAMETER,HOUSE,ASSOCIATED_TEAMTYPE,REPEATING
etc.
String | Meaning | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ID | This trigger's ID. | ||||||||||||
EVENT | This trigger's Event (See Events). | ||||||||||||
ACTION | This trigger's Action (See Actions). | ||||||||||||
EVENT_PARAMETER | The parameter for the Event. | ||||||||||||
HOUSE | The name of the house associated with this trigger, or None. This house is used as a parameter by some Events and Actions. | ||||||||||||
ASSOCIATED_TEAMTYPE | Associated teamtype ID, or None. | ||||||||||||
REPEATING |
Specifies whether this trigger is repeating (see The Repeating puzzle for more info).
|
RA/CS/AM
The section is called [Trigs] and again is a list of comma-separated strings that looks like this:
[Trigs] name=R,H,C,A,E1,E1P1,E1P2,E2,E2P1,E2P2,A1,A1P1,A1P2,A1P3,A2,A2P1,A2P2,A2P3 name1=R,H,C,A,E1,E1P1,E1P2,E2,E2P1,E2P2,A1,A1P1,A1P2,A1P3,A2,A2P1,A2P2,A2P3
etc.
String | Meaning | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
R[epeating] | Specifies whether this trigger is repeating (see The Repeating puzzle for more info).
1 ↑ "switch" means activate this trigger | ||||||||||||||||||||||||||||||||
H[ouse] | The index of the house associated with this trigger. This house is used as a parameter by some Events and Actions. | ||||||||||||||||||||||||||||||||
C[ondition] |
Condition can be set to 0, 1, 2 or 3.
| ||||||||||||||||||||||||||||||||
A[ctivate] | |||||||||||||||||||||||||||||||||
E1 | Event 1's index (see Events). | ||||||||||||||||||||||||||||||||
E1P1 | Event 1's first parameter. | ||||||||||||||||||||||||||||||||
E1P2 | Event 1's second parameter. | ||||||||||||||||||||||||||||||||
E2 | Event 2's index. | ||||||||||||||||||||||||||||||||
E2P1 | Event 2's first parameter. | ||||||||||||||||||||||||||||||||
E2P2 | Event 2's second parameter. | ||||||||||||||||||||||||||||||||
A1 | Action 1's index (see Actions). | ||||||||||||||||||||||||||||||||
A1P1 | Action 1's first parameter. | ||||||||||||||||||||||||||||||||
A1P2 | Action 1's second parameter. | ||||||||||||||||||||||||||||||||
A1P3 | Action 1's third parameter. | ||||||||||||||||||||||||||||||||
A2 | Action 2's index. | ||||||||||||||||||||||||||||||||
A2P1 | Action 2's first parameter. | ||||||||||||||||||||||||||||||||
A2P2 | Action 2's second parameter. | ||||||||||||||||||||||||||||||||
A2P3 | Action 2's third parameter. |
TS/FS/RA2/YR
The [Triggers] section in a map is a list of comma-separated strings that looks like this:
[Triggers] ID=HOUSE,LINKED_TRIGGER,NAME,ENABLED,EASY,NORMAL,HARD,REPEATING ID1=HOUSE,LINKED_TRIGGER,NAME,ENABLED,EASY,NORMAL,HARD,REPEATING
etc.
String | Meaning | ||||||||
---|---|---|---|---|---|---|---|---|---|
ID | The Trigger's ID. The game assumes the Actions and Events with the same ID belong to this Trigger automatically. | ||||||||
HOUSE | The House associated with this trigger. This house is used as a parameter by some Events and Actions. | ||||||||
LINKED_TRIGGER | A trigger that is fired automatically when this trigger fires, or <none> if no additional triggers should fire. | ||||||||
NAME | A plain text string used as a name of this Trigger. Not used ingame, only in the map editor. Should not contain commas. | ||||||||
ENABLED | Can be set to 0 ('disabled') or 1 ('enabled'). Specifies whether this trigger is enabled at the beginning of the game. If it is disabled, another trigger has to explicitly enable it via a special Action. | ||||||||
EASY | Can be set to 0 ('disabled') or 1 ('enabled'). Specifies whether this trigger is active in the Easy difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||||||||
NORMAL | Can be set to 0 ('disabled') or 1 ('enabled'). Specifies whether this trigger is active in the Normal difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||||||||
HARD | Can be set to 0 ('disabled') or 1 ('enabled'). Specifies whether this trigger is active in the Hard difficulty (It refers to the Campaign Difficulty slider or the Difficulty slider in the Options menu.) | ||||||||
REPEATING | Specifies whether this trigger is repeating (see The Repeating puzzle for more info).
|
Considerations
The Repeating puzzle
Template:NeedTesting As you may have noticed, different games specify different values for the Repeating flag: TD says R=1 means the trigger will repeat, RA says it will not, and TS-YR don't document this at all. This needs more testing.