AI triggers
Defines weighted conditions that create one or two TeamTypes for an AI house.
- 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
| # | Field | Accepted value | Required |
|---|---|---|---|
| 1 | Name | Display name | Yes |
| 2 | Primary team | TeamType ID or <none> | Yes |
| 3 | Owner | House ID, <all>, or <none> | Yes |
| 4 | Ignored | Present but discarded | Yes |
| 5 | Condition type | Integer from 0 through 4 | Yes |
| 6 | Condition object | TechnoType ID | Yes |
| 7 | Comparator | Hexadecimal comparison block | Yes |
| 8 | Starting weight | Number truncated to an integer | No |
| 9 | Minimum weight | Number truncated to an integer | No |
| 10 | Maximum weight | Number truncated to an integer | No |
| 11 | Skirmish | 0 or 1 | No |
| 12 | Ignored | Present but discarded | No |
| 13 | Side | 1 for GDI, 2 for Nod, otherwise unrestricted | No |
| 14 | Base defense | 0 or 1Stored and written back, never consulted; whether a trigger counts as defensive comes from its teams' IsBaseDefense. | No |
| 15 | Secondary team | TeamType ID or <none> | No |
| 16 | Easy | 0 or 1 | No |
| 17 | Medium | 0 or 1 | No |
| 18 | Hard | 0 or 1 | No |
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.
| Value | What it measures | Supporting fields it reads |
|---|---|---|
0 | How many of the condition object the enemy currently holds | Condition object and comparison block |
1 | How many of the condition object the owning house currently holds | Condition object and comparison block |
2 | The enemy’s power output less its drain, against a fixed 100 | Neither |
3 | The enemy’s power output less its drain, against a fixed 0 | Neither |
4 | The enemy’s spendable credits | Comparison 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
| Key | Description | Value | When omitted |
|---|---|---|---|
Name[<ObjectType ID>] | The display name of a type definition, a scenario, a multiplayer map, or a musical score. | string | Computed |
No keys match the current filters.
Source files
Linked at revision 59fae722af8c.