TaskForces: Difference between revisions
Creating |
Important note |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{WrongTitle|[TaskForces]}} | {{WrongTitle|[TaskForces]}} | ||
{{ | {{AIBar}}{{clr}} | ||
In {{ts}} through {{yr}}, this section defines a list of all AI | {{MappingBar}} | ||
In {{ts}} through {{yr}}, this section defines a list of all AI task forces in the game. A task force is, like its name says, a group of units that gets recruited by the AI to perform a specific task. Each task force listed in this section needs its own section in the file. In that section, up to six unittypes can be defined. Unlike most other object lists, the list containing the task force's units ''does'' care about its ordering - the lines are read from index 0 to 5 in ascending order. The game also reads a flag named {{f|Group|link}} from each such section. It is common practice to add flags like {{f|Name|link}} for your own reference, which third party tools such as [[C&C AI Editor]] or [[Matze's_tools#FinalAlert|FinalAlert 2]] usually can use as well. | |||
== Format == | == Format == | ||
<pre style="overflow: auto; white-space: pre"> | |||
[TaskForces] | |||
0 = 0638CD41-G | |||
1 = 0638CD42-G | |||
[0638CD41-G] | |||
Index = count,unittype | |||
Index = count,unittype | |||
Group = -1 | |||
[0638CD42-G] | |||
Index = count,unittype | |||
Index = count,unittype | |||
Group = -2 | |||
</pre> | |||
Here, {{Tt|count}} stands for the amount of this unit to recruit, and {{Tt|unittype}} stands for the ID of the unit in question. [[AircraftTypes]], [[InfantryTypes]] and [[VehicleTypes]] are accepted here. | Here, {{Tt|count}} stands for the amount of this unit to recruit, and {{Tt|unittype}} stands for the ID of the unit in question. [[AircraftTypes]], [[InfantryTypes]] and [[VehicleTypes]] are accepted here. | ||
Line 24: | Line 27: | ||
== Additional information == | == Additional information == | ||
*This section is read from {{Ini|ai}} and the current map file. | *This section is read from {{Ini|ai}} and the current map file. | ||
* Unlike [[AITriggerTypes]], there is no known difference on where a | *Unlike [[AITriggerTypes]], there is no known difference on where a task force is declared, they are compiled into a single list after reading both files. The game does keep track of which ones were declared in the "global" scope (ai(md).ini) and which - in the "local" scope (map itself), but the only usage of that seems to be the unused functions to save them back to the source file. | ||
*The | *{{W}} The hexadecimal prefix of a task force's ID (e.g. {{tt|0832C3F0}}) is used in pointer remapping during saving and loading. It should not be lower than {{tt|0x01000000}} to avoid conflicts with real pointers. In addition, it should be unique, i.e. it should not be shared across local and global task forces, or by any [[Tags|Tag]], else they will remap to the same pointer. | ||
*The {{Tt|-G}} suffix in a task force's ID is used to distinguish global ({{Ini|ai}}) task forces from local (map) ones (which have no suffix). | |||
Latest revision as of 15:48, 23 November 2022
In Tiberian Sun through Yuri's Revenge, this section defines a list of all AI task forces in the game. A task force is, like its name says, a group of units that gets recruited by the AI to perform a specific task. Each task force listed in this section needs its own section in the file. In that section, up to six unittypes can be defined. Unlike most other object lists, the list containing the task force's units does care about its ordering - the lines are read from index 0 to 5 in ascending order. The game also reads a flag named Group from each such section. It is common practice to add flags like Name for your own reference, which third party tools such as C&C AI Editor or FinalAlert 2 usually can use as well.
Format
[TaskForces] 0 = 0638CD41-G 1 = 0638CD42-G [0638CD41-G] Index = count,unittype Index = count,unittype Group = -1 [0638CD42-G] Index = count,unittype Index = count,unittype Group = -2
Here, count stands for the amount of this unit to recruit, and unittype stands for the ID of the unit in question. AircraftTypes, InfantryTypes and VehicleTypes are accepted here.
Note again: Index is read from 0 to 5 inclusive in ascending order, unlike other object lists which read the contained items without paying attention to the keys on the left side.
Additional information
- This section is read from ai(md).ini and the current map file.
- Unlike AITriggerTypes, there is no known difference on where a task force is declared, they are compiled into a single list after reading both files. The game does keep track of which ones were declared in the "global" scope (ai(md).ini) and which - in the "local" scope (map itself), but the only usage of that seems to be the unused functions to save them back to the source file.
- The hexadecimal prefix of a task force's ID (e.g. 0832C3F0) is used in pointer remapping during saving and loading. It should not be lower than 0x01000000 to avoid conflicts with real pointers. In addition, it should be unique, i.e. it should not be shared across local and global task forces, or by any Tag, else they will remap to the same pointer.
- The -G suffix in a task force's ID is used to distinguish global (ai(md).ini) task forces from local (map) ones (which have no suffix).