00 — Basics: file format, mods, editing existing entries¶
1. Files¶
| File | Contains | Entry headers |
|---|---|---|
tech.txt |
Technologies, tech-tree categories, tech levels, unit classes, DEFCON states | [TECHNOLOGY], [TYPE], [LEVEL], [UNIT_CLASS], [DEFCON] |
Ladders.txt |
Measure/countermeasure ladders by research levels (read right after tech.txt; optional) |
[LADDER] (06) |
TechLevels.txt |
Tech-level progression (how much each tech moves you up a level) | line commands, see 05 |
Tech_faction.txt |
Template for the built-in faction techs — do not edit | — |
Units/explosion.txt |
Explosions | [EXPLOSION] |
Units/Radars.txt |
Radar templates and sensors | [TYPE], [RADAR] |
Units/Missiles.txt |
Only USE "Units/Missile_types.txt" and USE "Units/Missile_defs.txt" |
— |
Units/Missile_types.txt |
Geneva & AI categories, missile templates | [GENEVA_CATEGORY], [AI_CATEGORY], [TYPE] |
Units/Missile_defs.txt |
Weapons | [MISSILE] |
Units/EW_Jamming.txt |
Example jamming lines for the guided weapons, commented out. Read only if Units/Missiles.txt has a USE of it (02 §10) |
[MISSILE] … MODIFY |
Units/Units.txt |
Unit types, global unit settings, the VirtualCity pseudo-unit |
[UNIT] |
lang/<Language>/tech_t.lng |
Display names/descriptions used by Name/Description in tech.txt |
"ID" LANG "text" |
Lang/Eng/namebank.txt |
Name banks: the names newly deployed units take (01 §11.1) | Unit, Prefix, Names |
Display names of units, missiles and radars always come from the technology named in their Tech
property — there is no separate name field.
A mod is a folder in MODS with an info.txt and only the files it changes, at the same paths as in the game folder:
MODS/Longer SAMs/info.txt ICBM MOD "Longer SAMs"
MODS/Longer SAMs/Units/Missile_defs.txt USE PREVIOUS "Units/Missile_defs.txt", then the changes (§3)
2. Syntax¶
- The format is free-form: line breaks do not matter to the game, but put one property per line.
- Keywords are case-insensitive. Unit, missile, radar and explosion IDs are case-sensitive; technology
IDs, unit classes, weapon config names, mod names and
IFmarkers are matched ignoring case. ALeadsTo/Parent/BlockedBylink to a technology that does not exist is silently ignored. - Comments:
// …to end of line and/* … */blocks. - Strings:
"…". Numbers:12,0.75. Booleans:Yes/No,true/false,1/0. - Flags such as
Slave,BallisticorNoAutoDeploymay be written bare (= Yes) or followed byYes/No. - Colours:
"RRGGBBAA",RGB r g b, orRGBA r g b a(0–255). Radar colours are the exception: four floats 0–1 (RadarColor 0.0 0.0 0.15 0.15). - A file ends at
[END],ENDor end-of-file. In a file read throughUSE, that ends only this file.
⚠ An unknown keyword stops the file¶
The game reads an entry's properties until it meets a word it does not recognise. It then goes back
to the top level and expects a new [HEADER], USE, IF or a global setting. If it finds anything
else, it stops reading that file and shows an error with the file, the line and the mod it came from:
Units/Missile_defs.txt (1014) (mod "My mod"): unknown keyword "Rnage" - the rest of this file was not loaded (misspelled property?).
What happens next is in §9.
[MISSILE] "SAM" MODIFY
Rnage 400 // typo: loading of this file stops here; the ABM entry below is not loaded
[MISSILE] "ABM" MODIFY
Range 900
Fix the word the message names and reload. The error names the word where the top level gave up, which is the first unrecognised word after the last valid property.
3. Mods and file overriding¶
A mod folder mirrors the game folder. A file with the same relative path (for example
MyMod/Units/Missile_defs.txt) replaces the original. To extend instead of replace, start the file
with a USE of the previous version and then add or modify entries:
USE PREVIOUS "Units/Missile_defs.txt" // the version from the game or from mods loaded before this one
[MISSILE] "SAM" MODIFY
Range 350
| Form | Loads |
|---|---|
USE "path" |
The file as currently resolved (would include this mod's own copy — use only for other files) |
USE "./path" |
A path relative to the folder of the file holding this line |
USE PREVIOUS "path" |
The same file as it was before this mod (base game or earlier mods) |
USE ORIGINAL "path" |
The unmodded game file |
USE MOD "ModName" "path" |
That file from a specific mod; the unmodded game file if that mod is not enabled |
An optional REPLACE keyword after the form is accepted and ignored. Paths start at the game folder (or the mod's
folder, which mirrors it). A USE of a file that does not exist reads nothing and gives no error, so check the path
when a change has no effect.
Using USE PREVIOUS plus MODIFY keeps your mod compatible with other mods that change other entries.
4. Creating, replacing and modifying entries¶
| Header form | Effect |
|---|---|
[UNIT] "New_ID" |
Creates a new entry. Required fields must be present. |
[UNIT] "Existing_ID" |
Replaces the entry: all its properties are reset to defaults and re-read. |
[UNIT] "Existing_ID" MODIFY |
Keeps everything and applies only the properties you write. |
[UNIT] "New_ID" COPY "Existing_ID" |
Creates a new entry as a copy of an existing one (everything, upgrades included, its Tech too unless you write another), then applies what you write as in MODIFY. Works for [UNIT], [MISSILE] and [RADAR]; the source must be defined earlier (in this file, an earlier file or the base game). On an ID already in use the entry is replaced by the copy. |
[MISSILE] … MODIFY, [RADAR] … MODIFY, [EXPLOSION] … MODIFY, [TECHNOLOGY] … MODIFY |
Same as for units. |
[TECHNOLOGY] "Existing_ID" remove |
Removes a technology from the tree (it can never be researched). |
In MODIFY mode:
- Single-value properties (
Range,Speed,Tech, …) are overwritten. - List properties (
Weapon,Config,Radar,CanDetect,CanBeUsedAgainst,Modifier,ImprovedBy,AffectedBy,LeadsTo, …) are appended. Usedeleteorresetto remove. - A unit's config cannot be written twice: a
Configwith the name of one it has (and a bareWeaponline on a unit that has adefaultconfig) stops loading with Double default weapon config. To change a config, writedelete Config "name"first and then the whole config again.
A MODIFY of an entry that does not exist is not an addition. A missile entry is skipped with a warning; a unit,
technology or explosion stops loading (§9); a radar is created as new, so it needs its Tech.
delete and reset¶
delete <property> <which> removes one item; reset <property> clears the whole list.
| Object | delete … accepts |
reset … accepts |
|---|---|---|
| Unit | ImprovedBy, AffectedBy, Config "name", Modifier "tech", AchievementProperty "id", Weapon "missile" [From "config"], CanStoreMissiles "missile", Radar "radar", Airway n, CanHostAircraft "unit", CanCarryUnit "unit", AttackerInPlanner, NoAutoDeploy, AttackIfDestroyed, CanPatrolPoint, CanHangInTheAir, HiddenFromAllies, CanAccessGlobalStorage, NoAutoAttack, NoAutoAttackSub, CheckCoverage "missile", CheckTargeting BY "missile", Slave, Icon, RoundIcon, AbstractMovie, DisablingTech, Produces "unit or missile", MoveToTarget "unit"/ANY |
ImprovedBy, AffectedBy, Modifiers, AchievementProperties, Weapon (all configs), CanStoreMissiles, Radars, Airways, CanHostAircraft, CheckCoverage, CheckTargeting, CanCarryUnit, Produces, MoveToTarget |
| Missile | ImprovedBy, AffectedBy, Explosion "exp", Ballistic, FreeFalling, AutoSlowDown, SingleAttack, CanBeUsedAgainst <class or "unit">, Affects <class>, GlobalShowType <group>, DisablingTech, AchievementProperty "id" |
ImprovedBy, AffectedBy, CanBeUsedAgainst, Affects, GlobalShowType, AchievementProperties |
| Radar | ImprovedBy, AffectedBy, CanDetect <class or "unit">, GlobalShowType <group>, DoNotShow, RangeByHeight |
ImprovedBy, AffectedBy, CanDetect, GlobalShowType |
| Explosion | Emulated, Sound, ImprovedBy, AffectedBy, AchievementProperty "id" |
ImprovedBy, AffectedBy, AchievementProperties |
| Technology | LeadsTo "tech", Parent "tech", BlockedBy "tech", AchievementProperty "id" |
LeadsTo, Parent, BlockedBy, AchievementProperty |
[UNIT] "Heavy_Cruiser" COPY "Cruiser" // a new unit type, the Cruiser's values to start with
Tech "U_Heavy_Cruiser" // its own new technology in tech.txt (and display name)
Power 60
[MISSILE] "SAM" MODIFY
delete ImprovedBy "SAM_Mk2" // one item of a list
reset AffectedBy // the whole list
For the delete ImprovedBy … / delete AffectedBy … forms (by tech, by Unit, by InRange, ALL <property>)
see 06 — Tech modifiers.
5. Conditional content: IF / ELSE / ENDIF¶
Every definition file supports conditions on mod markers. Each mod's name is automatically a marker;
a mod can declare more with marker "text" in its info.txt.
IF "Natural Resources Mod" AND NOT "OLD AI"
[UNIT] "Oil_Resource" MODIFY
ProductionCost 5
ELSE
[UNIT] "Army_Base" MODIFY
ProductionCost 4
ENDIF
- Conditions:
"marker",NOT "marker",( … ), combined withAND/OR.ANDandORrank equally and are read from left to right, so use parentheses when you mix them.NOTapplies to the marker or the parenthesis after it. - A marker counts only while its mod is enabled.
IFs may be nested. The game modes' mods are markers too ("BLITZ","CONQUEST","Standoff Mode"). IF/ELSE/ENDIFare only recognised between entries, never inside one. Wrap whole entries; anIFin the middle of a property list ends the entry and stops loading the file (see above).
6. Units of measure¶
| Quantity | Unit | Notes |
|---|---|---|
Distances: Range, MinRange, Precision, Size, explosion radii, radar range, ResupplyRange, RepairRange, OccupationRadius, MaxAutoEngageRange, ProductionPlacementRadius, SplitMinDist |
km | The globe is modelled with a 40 960 km circumference (π radians = 20 480 km). |
Altitudes: MaxElevation, MinElevation, radar MaxHeight |
km | |
Speed |
km per 400 simulation ticks | Same scale for units and missiles, and shown as-is in the unit panel: Speed 400 covers 1 km per tick, 60 km per "second" of the row below. VirtualSpeed uses the same scale. |
Disassemble |
1 = 1200 simulation ticks | A unit's relocation order (01 §2). |
TurnSpeed |
relative turn rate | Higher turns faster. |
"Seconds" fields — unit AttackDelay, ModelLaunchTime, SelfDestructTime, TimeToBoard, TimeToUnboard, TimeToHighState, TimeToLowState, AutoOnRestDelay, AutoCoolDownDelay, SensorsActivationDelay, WeaponsActivationDelay, OnDeployLaunchHostedDelay; global MinTimeToOccupyCity, MaxTimeToOccupyCity, MinTimeToOccupyUnit, CityOccupationMultPerPercent |
1 = 60 simulation ticks | |
Reload-time fields — Weapon … Time, Airway … Time, HangarExit … Time, Modify Weapon … Time (non-multiply operations), explosion LastingEffect |
1 = 2 simulation ticks | So Time 30 equals 1 in the row above; Time 1800 = 60. The shipped data comments call both groups "seconds" (e.g. Airway Launch 2 Time 180 // in seconds and TimeToHighState 3.0 // 3 seconds), but the scales differ by 30: Time 180 here lasts as long as 6 in the row above. A Weapon, Airway or HangarExit line without Time reloads in 400 ticks, like Time 200. |
InstantFlashDuration, InstantFlashGrowth (explosions) |
real seconds | The same at any game speed and frame rate. |
DecayTimer |
ticks | Lifetime from full Power to zero. |
TimeToOccupyMult on a unit |
ticks | Capture time (01 §7). |
Power (units and missiles) |
hit points | Damage from explosions is subtracted from it. |
Damage (explosions) |
hit points | For cities it scales casualties instead, see 03. |
ProductionCost |
production points | Relative build cost. |
Tech Points |
research points | Multiplied by 0.01 and scaled by tech level. |
Probabilities: CanBeIntercepted |
0–1 | Chance that one interceptor hit counts. |
Each kind of value in shipped lines (the Carrier and the SAM, shortened):
[UNIT] "Carrier" MODIFY
OnDeployLaunchHostedDelay 10.0 // "seconds": 600 ticks
Airway Launch 1 Time 60 // reload units: 120 ticks between launches
[MISSILE] "SAM" MODIFY
Range 300 // km
Speed 3000 // 7.5 km per tick
MaxElevation 30 Real // real km
7. Required fields¶
| Entry | Must have | Error if missing |
|---|---|---|
[UNIT] |
Tech, Movie, Type, ProductionCost > 0; Crash if the unit has a flight Range |
"No technology assigned", "No movie assigned", "No type assigned", "Incorrect production cost", "No Crash explosion set for the ranged unit" |
[MISSILE] |
Tech, at least one Explosion, Icon; Heads + FakeHeads within the warhead limit |
"No technology…", "No explosion type…", "No image…", "Too many warheads" |
[RADAR] |
Tech |
"No technology assigned" |
[TECHNOLOGY] |
Name, Description |
"No technology name", "No technology description" |
A missile entry that fails these checks while being created by a MODIFY header is skipped with a
warning instead of stopping the game.
The smallest entries that load (the technologies, pictures and explosion are shipped ones):
[UNIT] "My_Depot"
Tech "U_FOB"
Type Ground
Movie "Units/Images/Ground/Mid-Level/FOB.midx"
ProductionCost 2
[MISSILE] "My_Shell"
Tech "M_Surface_to_air_missile"
Icon "Units/Images/Missiles/SAM.png"
Explosion "std_bomb_small"
8. Referencing and forward references¶
- A missile, radar, explosion or technology must exist before an entry refers to it (by load order above).
- Unit types may refer to unit types defined later in
Units.txt(CanHostAircraft,HighState,LowState,Produces,ChangeTypeOnTech,MoveToTarget). If such a unit is never defined, loading stops with "Unit type referenced but not defined". COPYand adeleteof a unit name must name a unit type defined earlier, or loading stops with "Unit Type not found".CanCarryUnitmay name one defined later in the file; one defined nowhere stops loading at the end of the file.
[UNIT] "Submarine"
HighState "Submarine_Surfaced" // defined further down: allowed
[UNIT] "Submarine_Surfaced" COPY "Submarine" // the source of a COPY must come first
9. Errors at loading¶
A fatal error while the game reads its data shows Mod loading error, with the message, and writes it to Fatal.txt
in Documents/My Games/ICBM-Escalation. At start-up the game then switches all mods off and starts with the
unmodded data; when the mods are changed in the menu, it restores the previous mod configuration. If the unmodded data
fails too, the game ends.
| Message | Cause |
|---|---|
unknown keyword "x" - the rest of this file was not loaded |
A misspelled property, or a property written where only a new entry can start (§2). { as the word: a block written directly after a config's weapons (01 §3.3). |
Unit Type not found, Radar not found, Missile type not found, Technology not found, Explosion type not found |
A name that does not exist, or not yet (§8). IDs are case-sensitive. |
Unit type referenced but not defined |
A forward reference to a unit type that never came. |
No technology assigned, No movie assigned, No technology name, … |
A required field is missing (§7). Also the message of a MODIFY of a unit or technology that does not exist. |
Double default weapon config |
A config written twice (§4). |
Used too many airways, Used airway index is bigger |
At most 3 channels; declare the Airway before its CanHostAircraft (01 §5.1). |
Flying units cannot have OccupationRadius |
01 §7. |
Too many unit types, Too many missile types, Too many radar types |
At most 255 unit types, 512 missile types and 127 radars (each radar [TYPE] template counts as one). |
A word where a number belongs (Range abc, Type Aircraft) shows Unexpected ident found and counts as 0; the file
goes on. A fatal message names what was not found, for example a COPY "Destroyer_Mk2" of a unit that no earlier entry defines:
Unit Type not found Destroyer_Mk2
Test a mod in the Cheats build (ICBM_CHEATS.exe): start a game, read any message and Fatal.txt, then check the
changes in game.
10. What a game mode reads, and what a mod must repeat¶
The game modes are mods with their own data (12 §8):
- Standoff and Conquest read the base files with
USE PREVIOUS, so your mod's changes apply there. - Blitz has its own
Tech.txt,TechLevels.txt,Ladders.txt,Units/Units.txt,Units/Missiles.txt(templates and weapons in one file),Units/Radars.txt,Units/explosion.txtand most ofAI/. Your versions of these files are not read in Blitz: a change meant for Blitz too has to be made in a copy of the wholeGameMode/Blitz/folder. - A file of your mod that Blitz does not ship (
Limits.txt,espionage.txt, an AI file Blitz has no copy of) is read in Blitz too. It must not name a technology, unit or missile that Blitz lacks (Blitz has about a third of the units):Technology not foundandUnit Type not foundare fatal. - The game loads the data of all three modes when the player looks for a network game, to compare them with other players. A mod that breaks one mode only stops there, so test it by opening the lobby list as well as in a game.
An entry that names something Blitz lacks is kept out of Blitz with its marker (Blitz has no Spec_Ops_Team):
IF NOT "BLITZ"
[UNIT] "Spec_Ops_Team" MODIFY
Speed 70
ENDIF
A map or a campaign mission can bring a mod of its own too, and it is searched first (09 §13).