Rules registration lists
Registers named rules types and Side membership from rules-layer lists.
- Kind
- Registry
- File
RULE*.INI,LANGRULE.INI,FIRESTRM.INI,LANGFS.INI
Registration sections
| Section | ID from | Definition |
|---|---|---|
[InfantryTypes] | Value | [<InfantryType ID>] |
[Houses] | Value | [<HouseType ID>] |
[VehicleTypes] | Value | [<UnitType ID>] |
[AircraftTypes] | Value | [<AircraftType ID>] |
[Sides] | Key | Comma-separated HouseType IDs |
[SuperWeaponTypes] | Value | [<SuperWeaponType ID>] |
[BuildingTypes] | Value | [<BuildingType ID>] |
[TerrainTypes] | Value | [<TerrainType ID>] |
[SmudgeTypes] | Value | [<SmudgeType ID>] |
[OverlayTypes] | Value | [<OverlayType ID>] |
[Animations] | Value | [<AnimType ID>] |
[VoxelAnims] | Value | [<VoxelAnimType ID>] |
[Warheads] | Value | [<WarheadType ID>] |
[Particles] | Value | [<ParticleType ID>] |
[ParticleSystems] | Value | [<ParticleSystemType ID>] |
[Tiberiums] | Value | [<Tiberium ID>] |
All but two of these registration sections are read the same way. Each entry is taken by its position in the section and only its value is looked at, so the key text decides nothing and the order the lines are written in is the order the types are registered. The value is both the type ID and the name of the section the definition is written in, and is kept to its first thirty-one characters. An empty value registers nothing, and a value naming an ID the game already carries reuses that type instead of adding a second one.
The two exceptions read their keys. In [Sides] the key is the Side ID and the value is a comma-separated HouseType list. In [Tiberiums] the key is a slot number: a number below the count already registered selects that existing Tiberium and the value is discarded, and only a number at or above it creates a new one under the name the value gives.
Registering an ID and defining it are separate passes. Registration creates the type carrying the built-in defaults for its kind, and the section named by the ID is read afterwards, so an ID registered with no section of its own is kept with those defaults rather than dropped.
OpenTS processes the selected RULE*.INI, then LANGRULE.INI, then FIRESTRM.INI when Firestorm is enabled, and finally LANGFS.INI when present.
[InfantryTypes]0=MYINF
[MYINF]Name=Example infantryStrength=100Weapons and projectiles have no registration section of their own. A weapon is created the first time a type’s Primary=, Secondary= or Elite= names it, and a projectile the first time a weapon’s Projectile= names it. Each is then filled in from the section carrying its name on the same terms as above, and keeps the built-in defaults where no section carries it.
Source files
Linked at revision 59fae722af8c.