Skip to content

AI triggers

Mapping

Defines weighted conditions that create one or two TeamTypes for an AI house.

Format
Kind
Record
File
AI.INI, AIFS.INI, map file
Section
[AITriggerTypes]
Record form
<AITrigger ID>=<up to 18 comma-separated fields>
Enable section
[AITriggerTypesEnable]

Fields

#FieldAccepted valueRequired
1NameDisplay nameYes
2Primary teamTeamType ID or <none>Yes
3OwnerHouse ID, <all>, or <none>Yes
4IgnoredPresent but discardedYes
5Condition typeInteger from 0 through 4Yes
6Condition objectTechnoType IDYes
7ComparatorHexadecimal comparison blockYes
8Starting weightNumber truncated to an integerNo
9Minimum weightNumber truncated to an integerNo
10Maximum weightNumber truncated to an integerNo
11Skirmish0 or 1No
12IgnoredPresent but discardedNo
13Side1 for GDI, 2 for Nod, otherwise unrestrictedNo
14Base defense0 or 1Stored and written back, never consulted; whether a trigger counts as defensive comes from its teams' IsBaseDefense.No
15Secondary teamTeamType ID or <none>No
16Easy0 or 1No
17Medium0 or 1No
18Hard0 or 1No

Entries in [AITriggerTypes] are definitions: the key is the AITrigger ID and the value is its serialized record. Positions 1 through 7 must be present for parsing to finish. An incomplete entry remains registered with partially parsed state.

OpenTS loads AI.INI, then AIFS.INI when Firestorm is enabled, then the map-local definitions.

For global definitions, OpenTS enables every loaded AI trigger. For map definitions, [AITriggerTypesEnable] maps AITrigger IDs to booleans. In non-campaign sessions, a listed local trigger is enabled regardless of that boolean.

Five condition types are defined. The table sets each one against what it measures and which of the record’s two supporting fields that measurement reaches. What the third column settles is which fields a given condition leaves inert — a record may write anything at all in those and none of it is consulted. Only one of the five asks about the owning house; the other four are questions about that house’s enemy, and a house with no enemy passes none of them.

ValueWhat it measuresSupporting fields it reads
0How many of the condition object the enemy currently holdsCondition object and comparison block
1How many of the condition object the owning house currently holdsCondition object and comparison block
2The enemy’s power output less its drain, against a fixed 100Neither
3The enemy’s power output less its drain, against a fixed 0Neither
4The enemy’s spendable creditsComparison block

The comparison block carries two values rather than one: the number being compared against, and which of six comparisons is applied to it — less than, less than or equal to, equal to, greater than or equal to, greater than, or not equal to.

The condition object resolves as infantry, vehicle, aircraft, then building, and the first matching ID is used. An ID that matches none of them does not reject the trigger: the count it stands for is taken as zero and the comparison is made against that.

Accepted settings

1 of 1

KeyDescriptionValueWhen omitted
Name[<ObjectType ID>]The display name of a type definition, a scenario, a multiplayer map, or a musical score.stringComputed

Source files

Linked at revision 59fae722af8c.