01 — Unit types (Units/Units.txt)¶
The shipped unit types are in Units/Units.txt of the game folder: every value below can be looked up there.
A [UNIT] entry defines a unit type: anything that exists on the map and belongs to a faction —
buildings, armies, ships, submarines, aircraft, satellites. (Missiles in flight also behave as units on the map,
but they are defined in Missile_defs.txt; cities are handled by the special VirtualCity entry.)
[UNIT] "Fighter"
Tech "U_Fighter" // required: availability + display name
Type Airborne // required
Movie "Units/Images/Airborne/Topdown/Fighter_1.midx" // required
Power 0.65
Speed 700
Range 2400 // flight range: needs a Crash explosion
Size 0.05
TurnSpeed 9
MaxElevation 20
ProductionCost 1.0 // required, > 0
Crash "std_bomb"
Slave
AutoReturn Yes
Radar "STD Vision Air"
Radar "Air Vision"
ImprovedBy "Generation_2_Aircraft"
{
Set Speed 800
Set Range 2800
}
Config "Air-To-Air" Default
Weapon "AAM" 2 Launch 1 Time 120 AutoEngage
Weapon "Plane Gun" 20000 Launch 1 Time 6 AutoEngage
Properties can appear in any order, with the exceptions below. Everything not written takes the default shown below.
Order rules. The lines are read from top to bottom, and some change what an earlier line set:
Typefirst. It setsTargetInPlannerand both stockpile flags again, so these,Slave,ResupplyRangeandRepairRangecome after it. In aMODIFYor aCOPY, leaveTypeout unless you change it.Slave,ProducedByAnotherUnitandSpecialStateclearTargetInPlanner. To keep such a unit a target, writeTargetInPlanner Yesafter them, as the shipped satellites do.OccupationRadiussetsCanCrossBorderDuringPeaceTime No. To allow it, write that line after it.PowerbeforeDecayTimer,IconIDXbefore anImprovedBythat changes theMovie,Airwaybefore theCanHostAircrafton it.- An
ImprovedBydirectly after a config's weapons belongs to that config (§3.3).
1. Identity and availability¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
Tech |
Tech "tech_id" |
— required | The unit can be built only when this technology is known; its name is the unit's display name. Give every unit its own zero-cost tech whose parent is the real research tech. |
DisablingTech |
DisablingTech "tech_id" / NULL |
none | When the owner knows this tech the unit type is no longer available (used for obsolescence). |
Type |
Type Ground\|Naval\|Subwater\|Airborne\|Satellite |
— required | Movement domain and targeting class. Also accepted but meant for internal types: Missile, HighMissile, SubwaterMissile, City, AbstractPosition. Setting Type also sets defaults: Airborne → AutoReturn Yes; Naval/Subwater → MaxTiltDivider ×5; Ground → can access unit and weapon stockpiles; Ground/Naval/Subwater → TargetInPlanner Yes. |
Class |
Class "UC_…" / NULL |
auto by Type |
Unit class (an [UNIT_CLASS] from tech.txt), used in the production and diplomacy UI. If absent, the class whose AutoAssignTo matches the unit's Type is used. |
ChangeTypeOnTech |
ChangeTypeOnTech "tech" to "Unit_ID" / NULL |
none | Existing units of this type automatically turn into Unit_ID when the owner learns tech. Ignored if the target is the same type, or if tech equals the unit's own Tech. |
AchievementProperty |
AchievementProperty "ACH_ID" [check "tech"] |
none | Marks the type for a Steam achievement check (optionally only when tech is known). |
[UNIT] "Spec_Ops_Team" // shipped, shortened
Tech "U_Spec_Ops"
Type Ground
Class "UC_Ground_Mobile"
2. Core combat statistics¶
All of these can be changed by tech modifiers (see 06).
| Property | Syntax | Default | Meaning |
|---|---|---|---|
Power |
Power <float> |
1 | Hit points. Explosion damage is subtracted; the unit dies at ≤ 0. Also scales repair speed (see AutoRepair). |
Size |
Size <km> |
1 | Physical radius used by hit calculation: a blast reaches the unit if distance − Size ≤ blast radius, so bigger units are easier to hit. It also sets the area that bombers/precision weapons are evaluated against. |
Speed |
Speed <float> |
0 | Movement speed. 0 = immobile. Do not change it with dynamic modifiers (InRange, Explosion, Terrain, AffectedBy) — use simple ImprovedBy only. |
VirtualSpeed |
VirtualSpeed <float> |
0 | For relocations (see Disassemble): the speed used to compute their time. |
TurnSpeed |
TurnSpeed <float> |
1 | How fast the unit turns. |
Range |
Range <km> |
0 | Flight range (fuel) for aircraft. A unit with Range > 0 must also have a Crash explosion. The AI and the path UI keep a safety margin; a unit that exceeds its range crashes. |
MinElevation, MaxElevation (alias Elevation) |
<km> [Real] |
0 | Altitude band the unit flies in (an aircraft cruises at MaxElevation). Radars with a lower MaxHeight cannot see it. For a satellite, the band of orbit heights the player chooses from (§5.4). With Real in real km (see below). Shipped: helicopters 1, maritime patrol aircraft 2, fighters, attack, EW aircraft and transports 10, bombers, AWACS and SOF aircraft 12, interceptors and high-speed bombers 20, spy planes 25, satellites 1200–2000 (all Real). |
ProductionCost |
ProductionCost <float> |
— required, > 0 | Production points to build one. Also the base of repair speed. |
MaxNumberOnMap |
MaxNumberOnMap <int> |
1 000 000 | Maximum alive units of this type per faction. |
MaxNumberToOrder |
MaxNumberToOrder <int> |
unlimited | Maximum that can be in the production queue at once. |
CanBeBuilt |
CanBeBuilt Yes\|No |
Yes | No = never appears in production (units created by scripts, Produces, or as states). Tech-modifiable as a number (0 = no). |
AutoRepair (alias AutoHealing) |
AutoRepair Yes\|No\|<float> |
1 (Yes) | Repair rate multiplier for non-flying units. Repair happens only where repair is allowed (own territory, or within the RepairRange of one of the faction's own units) and heals AutoRepair × MaxPower × RepairValue ÷ (ProductionCost × 0.01) per step — expensive units heal proportionally slower. 0 = never repairs. |
DecayTimer |
DecayTimer <ticks> |
0 (off) | The unit loses Power ÷ DecayTimer every tick, dying after that many ticks (temporary units). Uses the Power written before it. |
Crash |
Crash "explosion_id" |
none | Explosion drawn when the unit is destroyed, without damage. When the unit runs out of flight range it also damages ground and naval units around the wreck, never city population (03 §5). Required when Range > 0. |
SelfDestructTime |
SelfDestructTime <s> |
0 | Time the self-destruct order takes. |
Disassemble |
Disassemble <float> |
−1 (off) | > 0 gives the unit a relocate order in place of the move order, also with no Speed: it stays where it is, its picture pulsing, for 3 × Disassemble + distance ÷ VirtualSpeed (1 = 400 ticks), and then stands at the target point. The point must be one where the unit could be placed. Disassemble 0.35 with VirtualSpeed 650 takes 420 ticks + 0.6 ticks per km. Shipped only in Blitz, on its mobile launchers. In modifiers it is DisassembleTime, in the time units themselves: Disassemble 0.35 is DisassembleTime 1.05. |
[UNIT] "Army_Division" // shipped, shortened
Size 1.0
AutoRepair 0.35
Speed 30
TurnSpeed 4
Power 150
SelfDestructTime 60
Real heights. The game flies its aircraft higher than real ones for the sake of the view, most of all the lowest. Up to 1000 km a game height is 1000 × (real / 1000)^0.8 (real 1 km is 4 in the game, 10 km is 25, 100 km is 158). Above 1000 km lies the satellites' band, with straight lines between these points:
| Real km | 1000 | 1200 | 2000 | 35786 (geostationary) |
|---|---|---|---|---|
| Game km | 1000 | 4000 | 10000 | 35786 |
From the geostationary height up, the two are the same. So a low orbit of real 1200–2000 km is game 4000–10000 km.
A height followed by Real is in real km and converted on loading, e.g. MaxElevation 10 Real (25 game km);
without it, in the game's km. The info panels and the Explodopedia show real km.
Real works for MaxElevation, MinElevation, MinExplosionHeight, a radar's MaxHeight, and the Set,
Set Max and Set Min modifiers of these (ImprovedBy "X" Set MaxElevation 25 Real); not with Add or Multiply.
Shipped in real km:
- the aircraft and helicopters;
- the satellites: MinElevation 1200 Real, MaxElevation 2000 Real (the early-warning satellite 6000); higher with
research, up to 37000 Real (geostationary) for the spy satellite (Improved_Optics 6000 … Geostationary_Spy_Satellites_Buffer
37000) and the early-warning satellite (Geostationary_satellites); the Hunter-Killer_Satellite 37000, 2000 on classic orbits;
- the anti-aircraft weapons;
- the anti-missile weapons (ABMs up to 1733–2000);
- the Ground ASAT Laser (5000) and, on classic orbits, the ASAT Laser (2000). The satellites' lasers keep to targets
near their own orbit with MaxHeightDifference 2500 instead (02 §3).
In game km: the shuttle (MaxElevation 120), the ballistic missiles' Elevation, the ASAT missiles'
MaxElevation (50000, above the geostationary height: the same either way) and the radars' MaxHeight.
3. Weapons¶
3.1 Weapon configs¶
A unit has one or more weapon configs; the player (or AI) switches between them. Each config is a list of weapons.
Config "ASM" Default // [Default] [OnlyFull] [Special]
Weapon "ASM" 2 Launch 2 Time 90 AutoEngage
Weapon "AAM" 2 Launch 1 Time 60 AutoEngage Principal
A Weapon line written without any Config before it creates a single config named default, and the Weapon
lines right after it belong to that config. A unit with only one config always treats it as its default. Config names
are matched ignoring case, and a unit cannot have two of one name
(00 §4).
| Config flag | Meaning |
|---|---|
Default |
The config selected when the unit is built. |
OnlyFull |
The config is available only when every weapon in it is researched. Without the flag, one researched weapon is enough. |
Special |
Special config (not offered as a normal choice by the AI). |
3.2 Weapon line¶
Weapon "missile_id" <stock> [Launch <n>] [Time <t>] [AutoEngage [WhenAttacked [ByNuke] [AIOnly]]] [Principal] [DefaultOff] [LaunchPoint <n>]
| Part | Default | Meaning |
|---|---|---|
<stock> |
— | Number of missiles carried in this config (use a large number such as 20000 for guns/lasers). |
Launch <n> |
1 | Missiles fired per salvo. |
Time <t> |
200 | Reload time between salvos, in reload units (Time 30 = one "second", see 00 §6). Scaled by the global GlobalMissileLaunchDelayModifier. Weapons that never fire (auras such as "EW Jammer") leave it out. |
AutoEngage |
off | The weapon may fire automatically. WhenAttacked = only after the unit was attacked; ByNuke = only after a nuclear attack; AIOnly = the restriction applies only to AI factions. Scripts can override per unit with Weapon_Use. |
Principal |
off | The weapon that represents the config in the UI/AI evaluation. |
DefaultOff |
off | The weapon's range circle is hidden by default (the player can show it). It does not switch the weapon off: a weapon starts switched off only through its missile's Switchable OFF. |
LaunchPoint <n> |
0 | Which launch point of the 3D model the missile leaves from, counted from 0. -1, or a model without that point: the middle of the unit. |
3.3 Upgrading configs with technologies¶
- Replace a config's contents when a tech is known — put
ImprovedBy "tech"directly after the config's weapons, followed by the new weapon list:
Config "Air to Air" Default
Weapon "AAM" 2 Launch 1 Time 120 AutoEngage
ImprovedBy "Generation_3_Aircraft"
Weapon "LAAM" 4 Launch 2 Time 120 AutoEngage
* A config that exists only after a tech — an empty Config followed by ImprovedBy "tech" and weapons
(used for the bombers' AL-ICBM configs). Alternatively, anywhere in the entry:
ImprovedBy "tech" Config "name" followed by Weapon lines.
* Change launch count / reload / load of one weapon — ImprovedBy "tech" Modify Weapon "missile" <op> Launch|Time|Load <value>
(see 06). Example from the data:
ImprovedBy "Spec_Ops_Boost_1" Modify Weapon "Small Arms" Set Time 4.
Config-replacing ImprovedBy must be a simple ImprovedBy "tech" (no Unit/InRange, no Modify).
Any ImprovedBy directly after a config's weapons is read as such a replacement. An upgrade of the unit itself
written there fails: ImprovedBy "tech" Set Speed 800 or a { … } block stops the file with an unknown keyword,
and ImprovedBy Unit, ImprovedBy InRange or Modify Weapon stop it with their own error. Write the unit's upgrades
before the first Config, or put another property (a Radar line, say) between them and the config. A Modify Weapon
line goes after all the configs, with another property before it.
3.4 Other weapon-related properties¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
CanStoreMissiles |
CanStoreMissiles "missile" <n> [DefaultOff] |
none | Extra magazine carried by the unit (e.g. bombers' nuclear stock, carriers' aircraft munitions). Hosted units rearm from it. |
AttackDelay |
AttackDelay <s> |
0 | Readiness build-up: the unit must "prepare to attack" for this long before its weapons fire; readiness decays while moving (unless it can attack on the move) and cancels after AutoCoolDownDelay of inactivity. |
AttackOnMove |
AttackOnMove Yes\|No\|<float> |
Yes (1) | Whether the unit can fire while moving (> 0 = yes). Tech-modifiable, so a tech can grant it. Units that cannot attack on the move also turn to face the target first. |
ModelLaunchTime |
ModelLaunchTime <s> |
1 | Length of the 3D launch animation. |
AutoCoolDownDelay (alias AutoCancelReadinessDelay) |
<s> |
10 | Idle time after which attack readiness is lost. |
WeaponsActivationDelay (alias WeaponActivationDelay) |
<s> |
0 | Fixed delay before weapons work after deployment/launch. |
WeaponsActivationDelayMult (alias WeaponActivationDelayMult) |
<float> |
0.25 | Additional delay = this × each weapon's reload Time. |
SensorsActivationDelay (alias SensorActivationDelay) |
<s> |
0 | Delay before radars work after deployment. |
ShowDisabledOnDeploymentMarker |
Yes\|No |
Yes | Shows the "not yet active" marker during these delays. |
NoAutoAttack |
NoAutoAttack [Yes\|No] |
auto-attack on | The unit never picks targets on its own. |
NoAutoAttackSub |
NoAutoAttackSub [Yes\|No] |
on | Same, against submarines only. |
MaxAutoEngageRange |
<km> |
1000 | For hosted units (aircraft): the host auto-launches them only against targets within this distance. |
CheckTargeting |
CheckTargeting BY "missile" [OR "missile"…] Message Lock <strID> NoLock <strID> |
none | Shows lock/no-lock messages (string IDs from UI.lng) when this unit is or is not covered by the listed enemy weapons (e.g. jammers). Also registers those weapons for InRange checks. |
CheckCoverage |
CheckCoverage "missile" BY "radar" [OR "radar"…] Message <strID> |
none | Warns the player (string ID) when firing missile without coverage from one of the listed radars. |
InfluencesAllies |
Yes\|No |
Yes | Whether the unit's aura-type weapons (buffs/debuffs checked through InRange) also affect allies. |
[UNIT] "Carrier" // shipped lines
CanStoreMissiles "Free fall bomb" 50000 // its aircraft rearm from this
CanStoreMissiles "100kt_nuke_light" 30
[UNIT] "Bomber"
CheckTargeting BY "AAM" OR "SAM" Message Lock 2841 NoLock 2842 // "locked on" / "no lock" messages
4. Sensors¶
| Property | Syntax | Meaning |
|---|---|---|
Radar |
Radar "radar_id" [DefaultOff] |
Adds a sensor. DefaultOff = its range circle is hidden by default; the radar still works. List property. |
| Tech-dependent radar set | ImprovedBy "tech" { Radar "…" Radar "…" }, or one ImprovedBy "tech" Radar "…" line per radar |
When tech is known, the whole radar list is replaced by the listed radars. Sets defined later are checked first; the first set whose tech is known wins. |
Plain
Radarlines always belong to the base list, wherever they are written (also in laterMODIFYentries, and right after anImprovedBy "tech" Radar "…"line); tech-dependent sets are kept separately.
[UNIT] "Forward_Operating_Base" // shipped lines
Radar "Resupply Range FOB"
Radar "STD Vision"
Radar "Reconnaissance"
SensorsActivationDelay 5.0
Radar ranges and detection classes are defined in 04 — Radars.
5. Carrying other units¶
5.1 Airways (aircraft launch/landing channels)¶
Airway Launch 2 Time 60 // airway 0
Airway Launch 1 Time 90 // airway 1
CanHostAircraft "Fighter" 24 Patrol 4 AIAutoPatrol
CanHostAircraft airway 1 "AWACS" 2
| Property | Syntax | Meaning |
|---|---|---|
Airway |
Airway [Launch <n>] [Time <t>] |
Declares a launch channel: n aircraft per launch (default 1), t reload units between launches (default 200). Scaled by GlobalAircraftLaunchDelayModifier. |
CanHostAircraft (alias CanHostAircrafts) |
CanHostAircraft [airway <i>] "Unit_ID" <count> [Patrol <n> [AIAutoPatrol]] |
Unit type hosted on airway i (default 0) with capacity count. Patrol n = how many can be sent on patrol at once; AIAutoPatrol lets the AI patrol automatically. The airway must have been declared. |
MaxAutoEngageRange |
see §3.4 | |
OnDeployLaunchHostedDelay |
<s> |
Delay before hosted units can launch after the host deploys. |
A unit may have at most 3 channels in total (airways plus the hangar channel created by CanCarryUnit/HangarExit).
5.2 Hangar (transport of ground units)¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
CanCarryUnit |
CanCarryUnit "Unit_ID" [build <n>] |
— | The unit can transport this type in its hangar. build n = it comes with n of them. Creates the hangar channel automatically. Unit_ID may be defined later in the file. |
HangarExit |
HangarExit [Launch <n>] [Time <t>] |
1 / 200 | Unload rate of the hangar. |
HangarMaxLoad |
<int> |
sum of build loads |
Hangar capacity in space units. Raised automatically to fit the initial load. |
HangarSpaceRequired |
<int> |
1 | Space this unit type takes in someone else's hangar. |
TimeToBoard, TimeToUnboard |
<s> |
0 | Boarding/unboarding time. |
ReportAsHosted |
Yes\|No |
No | While inside a host, the unit is still reported (e.g. listed with the host). |
[UNIT] "Landing_Ship" // shipped, shortened
HangarExit Launch 4
CanCarryUnit "Army_Division"
CanCarryUnit "Mobile_SRBM"
HangarMaxLoad 4
[UNIT] "Army_Division"
HangarSpaceRequired 1
ReportAsHosted Yes
5.3 Being hosted¶
| Property | Default | Meaning |
|---|---|---|
Slave |
No | The unit belongs to a host (aircraft): it must stay within safe return distance of the host, is not a war-planner target and gets different AI handling. |
AutoReturn |
Yes for Airborne, else No | Returns to its host automatically after the mission. |
CanPatrolPoint |
No | Can be ordered to patrol a point. |
CanHangInTheAir |
No | Can loiter (helicopters, drones) instead of needing to keep flying. |
PatrolOver |
Any | PatrolOver Any, Land or Water: where a host picks this aircraft's automatic patrol points (the Patrol count of CanHostAircraft): anywhere, over land only, or over water only (e.g. Water for anti-submarine aircraft). Player-set patrol points are not restricted. |
ProducedByAnotherUnit |
No | Can be built only while the faction has an active unit whose Produces lists it, or VirtualCity lists it; otherwise it is greyed out in production (§8). Excludes it from planner targets. |
[UNIT] "Navy_Helicopter" // shipped lines
Slave
AutoReturn Yes
PatrolOver Water
5.4 Satellites¶
Type Satellite needs no Speed and no Range: a satellite's speed follows from its height. MinElevation and
MaxElevation give the heights the player can choose on launch, and a technology can widen them, as the shipped
ImprovedBy "Geostationary_satellites" Set MaxElevation 37000 Real. Whether the orbits drift under the Earth is a
setting of the map, not of the unit (RealisticSatelliteOrbits, 09). The
shipped ones are built with ProducedByAnotherUnit true and TargetInPlanner Yes, by a Space_Operations_Center that
lists them with Produces, with SensorsActivationDelay and WeaponsActivationDelay 20. A radar's range can depend on
the orbit with RangeByHeight (04 §2).
[UNIT] "Satellite" // shipped, shortened
Type Satellite
MinElevation 1200 Real
MaxElevation 2000 Real
ImprovedBy "Improved_Optics" Set MaxElevation 6000 Real
ProducedByAnotherUnit true
TargetInPlanner Yes
SensorsActivationDelay 20.0
[UNIT] "Space_Operations_Center"
Produces "Satellite"
6. Readiness states (submerge/surface, deploy/undeploy)¶
Two unit types can form a pair of states — for example Submarine (low) and Submarine_Surfaced
(high). The unit switches between the types, keeping its identity.
[UNIT] "Submarine" [UNIT] "Submarine_Surfaced" COPY "Submarine"
HighState "Submarine_Surfaced" HighState NULL
TimeToHighState 3.0 LowState "Submarine"
TimeToLowState 3.0
SpecialState Yes
| Property | Syntax | Meaning |
|---|---|---|
HighState, LowState |
"Unit_ID" / NULL |
The type to switch to. |
TimeToHighState, TimeToLowState |
<s> |
Switching time. |
SpecialState |
Yes\|No |
This type is only a state of another unit: it cannot be built and is not a planner target. |
RetreatShift, AttackShift, DefenceShift, FastMoveShift, UnderIceShift |
High\|Low\|None |
Automatic state change when the unit retreats, attacks, defends, moves fast or goes under ice. |
AutoOnMoveShift |
High\|Low\|None |
State change when ordered to move. |
AutoOnRest |
High\|Low\|None |
State change after resting for AutoOnRestDelay seconds. |
HighStateStringIDX, LowStateStringIDX, StateStringIDX |
<strID> |
UI strings for the state buttons/label (default 2447). |
ToHighStateProcessStringIDX, ToLowStateProcessStringIDX |
<strID> |
UI string while switching. |
StateIcon, ToHighStateIcon, ToLowStateIcon |
"image" / NULL |
Icons for the state UI. |
7. Occupation (armies)¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
OccupationRadius |
<km> |
none | Makes the unit an occupier (it can capture cities/units). Not allowed for flying units: fatal at loading. Also sets CanCrossBorderDuringPeaceTime No. |
TimeToOccupyMult |
<float> |
0 | Makes the unit occupiable (> 0). On a unit it is the capture time in ticks, at least MinTimeToOccupyUnit. On VirtualCity (default 1) it multiplies the cities' capture time, see the globals below. None of the shipped units is occupiable. |
ExecuteOrdersWhenBesieged |
Yes\|No |
No | Whether an occupiable unit under siege can still act (self-destruct, attack…). |
CanCrossBorder |
Yes\|No |
Yes | No = never leaves own territory; also means CanCrossBorderDuringPeaceTime No. |
CanCrossBorderDuringPeaceTime |
Yes\|No |
Yes | May enter foreign territory before war. |
AlwaysVisibleOnEnemyTerritory |
Yes\|No |
No | Revealed to the territory owner while inside it. |
[UNIT] "Army_Division" // shipped lines
OccupationRadius 75
AlwaysVisibleOnEnemyTerritory Yes
8. Support and logistics¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
ResupplyRange |
<km> |
0 | The faction's own units within this distance count as on their own territory for the stockpiles: they can rearm and take units from them. It does not repair them. Gives the unit itself both stockpile flags. Allies get nothing from it. |
RepairRange |
<km> |
0 | The faction's own units within this distance repair (see AutoRepair). Gives the unit itself both stockpile flags. |
CanAccessGlobalStorage |
[Yes\|No] |
Ground: Yes | Shortcut for both stockpile flags below. |
CanAccessUnitStockpile |
Yes\|No |
Ground: Yes | Can draw units from the faction's reserve when outside own territory. |
CanAccessWeaponStockpile |
Yes\|No |
Ground: Yes | Can draw weapons (e.g. nukes) from the faction stockpile when outside own territory. |
Produces |
Produces "Unit_ID or missile_id" / NULL |
none | The types this unit makes available while it is active, to go with ProducedByAnotherUnit on them. NULL clears the list. List property. |
ProductionPlacementRadius (alias UnitPlacementRadius) |
<km> |
0 | A ProducedByAnotherUnit type is placed within this distance of a producer, and the circle is shown. 0 = anywhere it may be placed. Shipped: Army_Base 100. |
The unit panel shows ResupplyRange, or RepairRange if it has none; the Explodopedia shows the Resupply range, and
the Repair range when it differs. Shipped: Forward_Operating_Base and Army_Base 150 km, Resupply_Ship 225 km, each
with RepairRange of the same value, so write both. Neither draws a range circle. The shipped units carry a sensor for
that, Radar "Resupply Range" (225) or "Resupply Range FOB" (150), which sees nothing: when you change the range,
change that radar's Range with it (04 §4).
[UNIT] "Forward_Operating_Base" // shipped lines
ResupplyRange 150
RepairRange 150
Radar "Resupply Range FOB" // draws the 150 km circle
9. Politics, visibility and war triggers¶
| Property | Default | Meaning |
|---|---|---|
HiddenFromAllies |
No | Allies do not see this unit. |
HideOwnership |
No | Enemies (other than permanent allies) do not see who owns it. |
CovertOperative [f\|Yes\|No] |
No | A covert unit whose operations do harm on others' land (spec-ops teams, bomb trucks; not their transports, not a hidden building). Destroyed on the destroying faction's own land it counts as caught: the destroying faction learns the owner, may ask it in a deal to stop its covert operations, and at peace its mood towards the owner drops by f (Yes: CovertCaught of AI/Mood.txt, 0.25), times CovertCaughtNuclearFactor (3) with a nuclear weapon on board. Caught after such a promise, the promise is broken. Shipped: Spec_Ops_Team 0.25, Bomb_Truck and Heavy_Bomb_Truck 0.33. |
AttackIfDestroyed |
No | Losing this unit triggers limited escalation (the owner may then nuke cities); automatic attacks on such units are disabled. Only while it stands on its owner's or an ally's territory (a satellite: always) - one left in a region an enemy took is an ordinary unit. |
DoesNotTriggerWarWhenAttacked |
No | Attacking this unit does not start a war. |
DoesNotTriggerWarOnAttack |
No | Attacks by this unit do not start a war. |
DestroyOnFactionSurrender |
Yes | Removed when its owner surrenders. |
CanSetDEFCON |
No | Owning this unit allows changing DEFCON. |
[UNIT] "Spec_Ops_Team" // shipped lines
HiddenFromAllies
HideOwnership Yes
CovertOperative 0.25
DoesNotTriggerWarWhenAttacked Yes
DoesNotTriggerWarOnAttack Yes
How the AI and the other factions judge these deeds (moods, infamy) is in 20 — Diplomacy.
10. AI and war-planner hints¶
| Property | Syntax | Default | Meaning |
|---|---|---|---|
AttackerInPlanner |
[Yes\|No] |
No | The war planner may use this unit as an attacker. |
TargetInPlanner |
Yes\|No |
Ground/Naval/Subwater: Yes | The war planner may target it. Cleared by Slave, ProducedByAnotherUnit, SpecialState. |
MoveToTarget |
MoveToTarget ANY / MoveToTarget [AVOID] "Unit_ID" |
none | For raiding units (spec-ops): which target types the AI moves towards (ANY) or must avoid (AVOID). List property. |
MoveToTargetInWarPlan |
[Yes\|No] |
No | Also move towards targets while executing a war plan. |
NoAutoDeploy |
[Yes\|No] |
No | Not deployed automatically at game start / auto-deploy. |
DoNotShowInEncyclopedia |
[Yes\|No] |
No | Never mentioned in the Explodopedia (14): no page, and no icon, link or row naming it on other pages. Alias DoNotShowInExplodopedia. |
BlockedZoneTypeID |
"zone_type" / NULL |
none | AI "blocked zone" category this unit creates (areas the AI avoids). A technology can reset zones with ResetBlockedZone. |
Helper, AIVarietyHint |
"text" |
— | Accepted and ignored. |
[UNIT] "Fighter" // shipped lines
NoAutoDeploy
BlockedZoneTypeID "FighterZone"
[UNIT] "Army_Division"
AttackerInPlanner
MoveToTargetInWarPlan Yes
11. Presentation¶
| Property | Syntax | Meaning |
|---|---|---|
Movie |
"file.midx" / NULL |
Required. Map sprite/animation. |
AbstractMovie |
"file" / NULL |
The picture shown when zoomed far out, in place of Movie. |
Model |
"file" / NULL |
3D model: drawn in the terrain view, and on the map and the globe once it is bigger than ModelSwitchSize. |
Icon, RoundIcon |
"file.png" |
UI icons; default to frame IconIDX of the movie; RoundIcon defaults to Icon. |
IconIDX |
<int> |
Frame of the movie used as icon. |
LaunchMePathIcon |
element "ui_element" / NULL |
Path icon used when this unit is launched (default "path/launch STD"). |
DrawSize, ModelDrawSize, AbstractDrawSize |
<float> |
On-screen size (default 32): DrawSize the map picture, ModelDrawSize the 3D model (default DrawSize), AbstractDrawSize the zoomed-out icon (default DrawSize). A picture or model drawn bigger or smaller in its frame (an upgrade's, a faction's own) gets a Scale in its .midx (12). For a seamless switch the unit itself should look as big in its picture as the model when the unit switches to it. |
ModelSwitchSize |
<float> |
The unit is drawn as its 3D model once the model is this big, in % of the screen's width (default 2); its map picture before. A unit with a big picture (an airport, a base) switches when its model has grown as big as the picture: e.g. ModelSwitchSize 5.2 with DrawSize 35, ModelDrawSize 90. |
LaunchSmokeSize |
<float> |
Its missiles' launch smoke this many times as big (default 1; the smoke is measured in the launcher's model lengths). None of the shipped units sets it (Launch_Smoke itself is 0.75 launcher lengths). |
HideAbstract |
Yes\|No |
Hidden when zoomed far out. |
FollowRadius |
<float> |
The distance units following this one keep. Default DrawSize ÷ 1.35; a written value counts × 0.6, so FollowRadius 17.28 equals the default of DrawSize 14. |
DrawOrder |
<int> |
Drawing order among units of the same class (smaller first). |
TablePriority |
<int> |
Its place in the unit tables (units grouped on the map), the highest first. Zoomed out a table shows at most 6 rows (one unit type each, with its count): the 5 rows of the highest priority, a ship or submarine row among them if the table has one, and the rest counted in a last "+N" row; the full table opens as the cursor comes near. Unset, it is given after loading: 3 for armies (movable, at least through a state change, with an occupation radius), 1 for ground units that never move and host units (bases, airports, silos), 0 for the rest. The player's own units showing a nuclear marker (ready, or a reason they cannot fire) count 2 at least, as long as they show it. Equal priorities: the bigger icon first. |
FixedRotationAngle |
Yes\|No |
Sprite does not rotate with heading. |
MaxTiltDivider |
<float ≥ 1> |
Banking when turning (larger = less tilt; default 1.5, ships ×5). |
ForceMipMap |
Yes\|No |
Force mip-mapping for the sprite. |
Sound |
Sound <id> [Volume <f>] |
Selection/voice sound. |
LaunchMeSound |
LaunchMeSound <id> [Priority <n>] [SoundSize <f>] [Speed <f>] [MuteLength <f>] |
Sound when launched from a host. |
LaunchMeSoundUI |
<id> |
UI sound when launched. |
DestructionMessage |
Default\|None\|GroundMobile\|Ground\|Naval\|Subwater\|Airborne\|Missile\|Satellite\|City (unquoted, case-sensitive; anything else means Default) |
Which "unit destroyed" message category to use. |
[UNIT] "Forward_Operating_Base" // shipped, shortened
Movie "Units/Images/Ground/Mid-Level/FOB.midx"
AbstractMovie "Units/Images/Ground/Abstract/FOB.midx"
Model "Units/Images/Ground/Forward Operating Base.midx"
Icon "Units/Images/Icons/Ground/FOB.png"
DrawSize 20
ModelDrawSize 46
ModelSwitchSize 3.7
AbstractDrawSize 30
FixedRotationAngle true
Sound 137 Volume 0.5
11.1 Unit names (name banks)¶
A unit deployed without a name of its own (by its player, the AI or an event script) takes a random name from its
type's name bank that no unit of its faction carries at the moment; with every name taken, or no bank for it, it
keeps its type's name. A name is free again once its unit is destroyed. The banks are in Lang/Eng/namebank.txt, the
same for every language; the shipped file holds only commented-out examples, so no unit takes a bank name until a bank
is written.
// Lang/Eng/namebank.txt of a mod
USE PREVIOUS "Lang/Eng/namebank.txt"
Unit "Carrier" // one or more unit type IDs
Prefix "NA" "EU" // optional: the faction prefixes of model_info.txt
Names
"Enterprise" "Nimitz" "Forrestal"
- A bank with
Prefixlines is for the factions with that model prefix, whatever a map calls them; their banks are used first, then the banks withoutPrefix, which are for every faction. - A state of a unit (
Submarine_Surfaced) takes the bank of the type it is a state of. - A unit type the game does not have is skipped (the file also loads in Blitz); another word than
Unit,Prefix,Names,USE,IForENDstops the file with an error. - Translations, the premade decks and the rest: 12 §5.
12. Modifier tags¶
Modifier "tech_id" [value <float>] attaches a tag to the unit type. Tags do nothing by themselves;
tech modifiers elsewhere test for them with ImprovedBy Unit "tag" / AffectedBy Unit "tag" and can use
the tag's value with the value keyword. The tag must be a technology ID in tech.txt (usually a
zero-cost tech that is always known, or the tech that activates the effect).
The unit type's own research (its Tech line) is a tag of it too, value 1, without a Modifier line: e.g.
AffectedBy Unit "U_Fighter" HitSpread 5.0 on a weapon applies against fighters. A Modifier line of that tech
gives it another value. A COPY of the type gets its own Tech's tag, not its source's.
[UNIT] "Stealth_Bomber" Modifier "Bomber_Stealth_Bonus_Modifier_1" value 0.5 // illustrative
[RADAR] "STD Long Wave" AffectedBy Unit "Bomber_Stealth_Bonus_Modifier_1" Range value // ×0.5 against that bomber
A tag with value 0 is still present. Tags can be added or removed dynamically with the Modifier
property of a tech modifier (Set Modifier, Delete Modifier), see 06.
13. Tech modifiers on units¶
ImprovedBy … and AffectedBy … lines (and { … } blocks) change unit properties when technologies,
tags, auras, explosions or terrain apply. Unit property names usable in modifiers: Speed,
VirtualSpeed, TurnSpeed, Range, Power, Size, ProductionCost, CanBeBuilt, MaxNumberOnMap,
MaxElevation, MinElevation, DisassembleTime, ResupplyRange, RepairRange, AttackDelay,
AttackOnMove, ModelLaunchTime, Movie (appearance), Modifier (tags), Config/Radar
(replacement lists), Modify Weapon. Full grammar in 06.
ImprovedBy "Generation_4_Aircraft"
{
Movie "Units/Images/Airborne/Topdown/Fighter_4.midx" Icon "Units/Images/Icons/Airborne/Fighter_4.png"
Movie Model "Units/Images/AIRBORNE/4th Gen Fighter.midx"
Set Size 0.03
Set Speed 1000
Set Range 3750
}
14. Global unit settings (top level of Units.txt, outside any entry)¶
| Setting | Default | Meaning |
|---|---|---|
GlobalSpeedModifier <f> |
1 | Multiplies every unit's speed. |
GlobalAircraftLaunchDelayModifier <f> |
1 | Multiplies all airway/hangar launch delays. |
GlobalMissileLaunchDelayModifier <f> |
1 | Multiplies all weapon reload times. |
GlobalCitySizeModifier <f> |
1 | Multiplies city radius for blast calculations (bigger = more exposed). |
MinTimeToOccupyCity <s> |
0 | Lower bound of city capture time. |
MaxTimeToOccupyCity <s> |
900 (15 min) | Upper bound of city capture time. |
MinTimeToOccupyUnit <s> |
0 | Lower bound of unit capture time. |
CityOccupationMultPerPercent <s> |
60 | Capture time per 1 % of the faction's initial population living in the city (× VirtualCity's TimeToOccupyMult), kept between the two limits above. |
UseAbsolutePopulationForOccupationTime Yes\|No |
No | Use absolute population (per million) instead of percent of the faction. |
Shipped values: MinTimeToOccupyCity 150, MinTimeToOccupyUnit 30; Blitz sets none of these, so they have the
defaults there. They stand between entries, for example at the top of a mod's file:
USE PREVIOUS "Units/Units.txt"
GlobalMissileLaunchDelayModifier 1.2 // every reload 20 % longer
MaxTimeToOccupyCity 600 // a city falls within 10 "minutes"
15. VirtualCity — the city pseudo-unit¶
Cities are not [UNIT]s, but [UNIT] "VirtualCity" MODIFY (the only allowed form) attaches properties to
all cities. Useful properties:
Modifiertags (e.g."Resist_Nuke_ABM","EMP_Defence_Mod_3") that weapons test withAffectedBy Unit.ImprovedBy/AffectedByon the city economy:Production,Science,Espionage(multipliers of the city's output), plusPower,Size,MaxNumberOnMap,ResupplyRange,RepairRange.ProducesandProductionPlacementRadius: every faction may build the listedProducedByAnotherUnittypes, near its cities if a radius is given.TimeToOccupyMult(default 1): a factor on the capture time of all cities.
[UNIT] "VirtualCity" MODIFY
ImprovedBy "Production_Booster_1" Production 1.10
ImprovedBy InRange "Research_Buff" Science 1.10 // aura from the Research Center
AffectedBy Explosion "EMP_Blast" Complex Production
case "EMP_Defence_Mk4" Multiply 0.75
default Multiply 0.25
ImprovedBy "DEFCON_2" Production 0.75 // DEFCON penalties are modelled this way
The city's technology is U_City. Cities are hit by any missile whose type Affects City (see 02).
16. Checklist for a new unit¶
- Add
[TECHNOLOGY] "U_My_Unit"withName/Descriptionintech.txt, aParentor aLeadsTofrom the research tech, and the strings inlang/*/tech_t.lng. - Add
[UNIT] "My_Unit"withTech,Type,Movie,ProductionCost,Power,Size, andSpeedif mobile. - Give it at least one sensor (
Radar "STD Vision"or similar) — units see nothing without one. - Add weapons (configs), and
Crash+Rangeif it flies. - Add hosting (
CanHostAircrafton a carrier/base) if it is an aircraft. - Start the game and make sure no error appears (see 00); read
Fatal.txtfor warnings too. - For the AI to build it, add it to the AI files: a support or nuclear role and a group (08 §13). A unit named in no AI file is never built by the AI; a unit named there that does not exist is fatal. A mod that leaves a shipped unit out must also clear its name from the AI files and from the maps and scenarios it uses.
- Blitz does not read your
Units.txt. If the unit should exist there too, see 00 §10.