ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "TaskForces"

From ModEnc
Jump to: navigation, search
m (retracting defined vs declared... stupid code)
(Important note)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{WrongTitle|[TaskForces]}}
 
{{WrongTitle|[TaskForces]}}
{{SideBar|[[AI programming]]|Template:AI}}
+
{{AIBar}}{{clr}}
In {{ts}} through {{yr}}, this section defines a list of all AI TaskForces in the game. A TaskForce is, like its name says, a group of units that gets recruited by the AI to perform a specific task. Each TaskForce 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 TaskForce's units does care about its ordering - it reads the lines indexed from 0 to 5 in ascending order. The game also reads a flag named {{TTL|Group}} from each such section. It is common practice to add flags like Name= for your own reference, which third party tools such as FinalAlert 2 or [[AI Editor V2]] usually can use as well.  
+
{{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 ==
[TaskForces]
+
<pre style="overflow: auto; white-space: pre">
0 = 0638CD41-G
+
[TaskForces]
1 = 0638CD42-G
+
0 = 0638CD41-G
+
1 = 0638CD42-G
[0638CD41-G]
+
 
Index = count,unittype
+
[0638CD41-G]
Index = count,unittype  
+
Index = count,unittype
Group = -1
+
Index = count,unittype  
+
Group = -1
[0638CD42-G]
+
 
Index = count,unittype
+
[0638CD42-G]
Index = count,unittype  
+
Index = count,unittype
Group = -2
+
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 TaskForce 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.
+
*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 infamous {{Tt|-G}} suffix has no meaning whatsoever.
+
*{{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.
*There is an unknown effect attached to the hexadecimal prefix of a TaskForce's ID.
+
*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).
 
 
[[Category:AI(md).ini Sections]]
 
[[Category:Maps Sections]]
 

Latest revision as of 17:48, 23 November 2022

This page should correctly be named "[TaskForces]"; it is wrong due to technical restrictions.



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.
  • Warning small.png 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).