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

ScriptTypes: Difference between revisions

From ModEnc
Jump to navigation Jump to search
Crimsonum (talk | contribs)
Replaced mentions of script actions with team missions (as they are internally known as such) and removed useless blank space from the top.
Crimsonum (talk | contribs)
mNo edit summary
Line 2: Line 2:
<div style="float: right">{{AIBar}}<br style="clear: right" />
<div style="float: right">{{AIBar}}<br style="clear: right" />
{{MappingBar}}</div>
{{MappingBar}}</div>
In {{ts}} through {{yr}}, this section defines a list of all AI Scripts in the game. AI Scripts control what the AI controlled units actually do, like "attack enemy buildings", "gather just outside our own base", "move to nearest GACNST", and so on. Consider it a primitive programming language which supports two kinds of loops and no conditional statements. Each AI Script needs its own section in the same file. That section should contain a zero-based list of actual [[ScriptTypes/TeamMissionTypes|Team Missions]] with arguments for the [[TaskForces|TaskForce]] to execute. Unlike most other object lists, the list containing the team missions '''does''' care about its ordering - it reads the lines indexed from {{Tt|0}} to {{Tt|49}} in ascending order. No other flags are read from that section, so nothing is stopping you from adding stuff like {{Tt|1=Name=}} for your own reference, which third party tools such as [[C&C AI Editor]] or [[FinalAlert 2]] usually can use as well.
In {{ts}} through {{yr}}, this section defines a list of all AI Scripts in the game. AI Scripts control what the AI controlled units actually do, like "attack enemy buildings", "gather just outside our own base", "move to nearest {{tt|GACNST}}", and so on. Consider it a primitive programming language which supports two kinds of loops and no conditional statements (the conditions are determined through [[Triggers]] or [[AITriggers]] instead).
 
Each AI Script needs its own section in the same file. That section should contain a zero-based list of actual [[ScriptTypes/TeamMissionTypes|Team Missions]] with arguments for the [[TaskForces|TaskForce]] to execute. Unlike most other object lists, the list containing the team missions '''does''' care about its ordering - it reads the lines indexed from {{Tt|0}} to {{Tt|49}} in ascending order. No other flags are read from that section, so nothing is stopping you from adding stuff like {{Tt|1=Name=}} for your own reference, which third party tools such as [[C&C AI Editor]] or [[FinalAlert 2]] usually can use as well.


== Format ==
== Format ==

Revision as of 09:00, 7 September 2022

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



In Tiberian Sun through Yuri's Revenge, this section defines a list of all AI Scripts in the game. AI Scripts control what the AI controlled units actually do, like "attack enemy buildings", "gather just outside our own base", "move to nearest GACNST", and so on. Consider it a primitive programming language which supports two kinds of loops and no conditional statements (the conditions are determined through Triggers or AITriggers instead).

Each AI Script needs its own section in the same file. That section should contain a zero-based list of actual Team Missions with arguments for the TaskForce to execute. Unlike most other object lists, the list containing the team missions does care about its ordering - it reads the lines indexed from 0 to 49 in ascending order. No other flags are read from that section, so nothing is stopping you from adding stuff 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

[ScriptTypes]
0 = 0438CD41-G
1 = 0438CD42-G

[0438CD41-G]
Index = mission,argument
Index = mission,argument

[0438CD42-G]
Index = mission,argument
Index = mission,argument

Both mission and argument are numbers, the meaning of arguments is different for each Team Mission.

Note again: Index is read from 0 to 49 inclusive in ascending order, unlike other object lists which read the contained items without paying attention to the keys on the left side.

Available Team Missions

List of available Team Missions

Additional information

  • This section is read from ai(md).ini and the current map file.
  • Unlike AITriggerTypes, there is no difference on where a ScriptType 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 -G suffix is used to distinguish global (ai(md).ini) ScriptTypes from local (map) ones (which have no suffix). It has no effect however.
  • Unlike TaskForces, there is no effect to prefixing a ScriptType's ID with a hexadecimal prefix.