Skip to content

02 — Missiles and weapons (Units/Missile_types.txt, Units/Missile_defs.txt)

Index · Basics

The shipped weapons are in Units/Missile_defs.txt and their templates in Units/Missile_types.txt of the game folder.

A [MISSILE] is anything a unit can fire or apply: missiles, bombs, shells, torpedoes, lasers, cyber attacks, espionage/research buffs, jammers. It travels from the launcher to a target point (or acts instantly) and then produces its explosions (03), which do the actual damage.

[MISSILE] "SAM"                         // shipped entry, shortened
  Tech "M_Surface_to_air_missile"       // required: availability + display name
  Type "AntiAir"                        // template: targeting classes etc. — write it FIRST
  Icon "Units/Images/Missiles/SAM.png"  // required
  Explosion "std_bomb_small"            // required (one or more)
  Range 300
  Speed 3000
  HitSpread 0.16                        // lands up to 0.16 km off (HitModel Deviation, from the template)
  MaxElevation 30 Real
  CanBeLimited false
  ImprovedBy "SAM_Mk2" Set Range 400
  ImprovedBy "SAM_Mk2" HitSpread 0.75            // 25 % more accurate
  AffectedBy Unit "ECM_Bonus_1" HitSpread 1.075  // targets with ECM are harder to hit
  AffectedBy Unit "ECM_Bonus_1" Damage 0.90

The file Units/Missiles.txt only pulls in Units/Missile_types.txt and Units/Missile_defs.txt with USE (its third line, USE "Units/EW_Jamming.txt", is commented out: §10). Headers MODIFY and COPY "Existing", and delete / reset, work as in 00 §4. COPY takes the source as it stands (its template values, its own lines and upgrades); a source not defined before it stops the loading.


1. Templates: [TYPE] in Missile_types.txt

[TYPE] "Name" defines a template with the same properties as a missile. Type "Name" inside a missile copies from the template what it holds at that moment:

Group Copied by Type
Targeting CanBeUsedAgainst (classes and unit IDs), Affects, RequiresPreciseTargeting, Subwater, SubwaterLaunch, CheckSubwaterRoute, AttackAngle
Flight and hit Range, MinRange, Speed, TurnSpeed, Power, Precision (HitSpread, HitChance), HitModel, MissileHitModel, CanBeIntercepted, DisableCanBeIntercepted, MaxElevation, MinElevation, MaxHeightDifference, LeadGuidance, MinExplosionHeight, Ballistic, FreeFalling, DirectLaunch, SurvivesLauncher, OutliveRange, RangeCountsHeight, CanRetarget
Rules and production GenevaCategory, AICategory, Class, ProductionCost, ProductionCostDegrades, ProducedByAnotherUnit, MaxNumberToOrder, CanBeLimited, Switchable, SingleAttack, AutoSlowDown, DoesNotTriggerWarOnAttack, Inhumane, MaximizeExposure, PreferPopulationOverDistance, AIHint, AchievementProperty
Display the drawing kind (DrawNuke, DrawBomb, DrawLaser, Immediate, DrawWave), Color, DrawSteps, DrawCycles, LaserCore, LaserStyle, LaserWidth, DrawSize, ModelDrawSize, AbstractDrawSize, MaxVisualAimAngle, GlobalShowType, Hidden, HideRange, HideNumberOfMissiles, DoNotShowInEncyclopedia, FixedRotationAngle, SimplifiedVisibilityCheck

Not copied: Tech, DisablingTech, Explosion, Icon, RoundIcon, Movie, Model, Sound, Heads, FakeHeads, SplitPathPercent, SplitMinDist, IndependentTargeting, ImprovedBy / AffectedBy, Trajectory, SmokeSpeedMult, SmokeSizeMult, LaunchPlume, LaunchLightSize, InRangeStringID, CanBeBuilt, ForceMipMap.

⚠ Type overwrites what it copies (only the unit IDs of CanBeUsedAgainst and DoNotShowInEncyclopedia add up), so write Type before any of those properties. A Range above the Type line takes the template's value, and an AICategory or GenevaCategory above it is lost, without a message: the weapon simply has no category.

  • A [TYPE] cannot start from another one: Type inside [TYPE] stops the loading with "Missile type not found".
  • The copy is made when the weapon is read. A [TYPE] "X" MODIFY in a mod reaches only the weapons read after it; the ones already defined need their own MODIFY.
  • A DrawNuke that comes from a template sets the look, not the trail: write DrawNuke or a Trajectory line in the weapon itself.
[MISSILE] "My_SAM" COPY "SAM"            // the SAM with its template values, lines and upgrades
  Tech "M_My_SAM"
  Range 400

[MISSILE] "My_Shell"
  Type "NukeArtillery"                   // first: the template's values ...
  Range 40                               // ... then the weapon's own

The shipped templates (in Units/Missile_types.txt) are named by role: Default, SemiGuided, LandAttack, Nuke, NukeArtillery, Torpedo, TorpedoNuke, AntiShip, AntiAir, AntiAirNuke, AntiAirAll, AntiMissile, AntiMissileMidcourse, AntiMissileTerminal, AntiMissileAA, AntiRadiation, AntiSat, Laser_Weapon, CFLaser, DepthCharge, Chemical, ChemicalArtillery, Biological, Army, Small Arms, Massacre, CyberAttack, No Attack.

2. Targeting classes

Property Syntax Meaning
CanBeUsedAgainst CanBeUsedAgainst <class> or CanBeUsedAgainst "Unit_ID" What the weapon may be aimed at. Classes: Ground, Naval, Subwater, Airborne, Missile, HighMissile, SubwaterMissile, Satellite, City, AbstractPosition (a point on the map). AbstractPosition also allows every unit that neither flies nor is under water. A quoted unit ID adds one specific unit type (e.g. anti-radiation missiles against radar sites), and that type is also in its Affects; an ID that exists nowhere stops the loading ("Unit Type not found"). List property.
Affects Affects <class> What the explosion damages in addition to the aim classes (collateral). Every CanBeUsedAgainst class is automatically in Affects. Example: nukes aim at ground/naval/city but also affect Airborne and Subwater. The blast does not tell friend from foe (03 §2). A blast reaches missiles only when the weapon can be aimed at Missile or HighMissile: Affects Missile alone does nothing.
RequiresPreciseTargeting Yes\|No Yes = can only be fired at a target that one of the faction's radars with PreciseTargeting currently sees (04).
AttackAngle <degrees> The target must lie within this cone around the launcher's heading, the full width of the cone (default 360). Forced to 360 for Ballistic missiles and 60 for FreeFalling ones.

How a missile counts as a target for other weapons (its own class):

  • Ballistic with MaxElevation > 0 → HighMissile (hit by mid-course interceptors, seen by over-the-horizon radars);
  • Subwater Yes → SubwaterMissile;
  • otherwise → Missile.

A MIRV's warhead counts as the class of its bus, whatever its own lines say.

[TYPE] "AntiRadiation"                   // shipped template, shortened
  CanBeUsedAgainst "Fixed_LW_radar"        // unit types by their ID (case-sensitive)
  CanBeUsedAgainst "Mobile_SW_Radar"

[MISSILE] "My_Missile" MODIFY
  CanBeUsedAgainst Ground
  Affects Naval                            // its blast also damages ships
  RequiresPreciseTargeting Yes

3. Flight and hit statistics

All numeric stats can be changed by tech modifiers (06).

Property Syntax Default Meaning
Range <km> 20 Maximum attack distance.
MinRange <km> 0 Cannot be fired at closer targets.
Speed <float> 100 Flight speed (same scale as unit speed): Speed × 0.0025 km per tick, 60 ticks a second at normal speed. So 200 km at Speed 100 take 800 ticks. Scaled by the global GlobalSpeedModifier of this file. Do not change with dynamic modifiers.
TurnSpeed <float> auto Turning rate. If not set it is derived from Range and AttackAngle; loading fails with "Turn speed too slow" if the turn rate makes the effective range less than half of Range. Ballistic missiles do not turn.
Precision <km> 1 Maximum miss distance: the impact point is moved in a random direction by a distance drawn evenly between 0 and Precision, so half of the shots land within Precision/2. Smaller = more accurate. How (and whether) it is used depends on HitModel; for a beam (DrawLaser/Immediate) it is the chance to hit (0–1) instead. By hand: 03 §2.1.
HitSpread <km> 1 Precision by its meaning for a weapon that deviates (HitModel Deviation, or MissileHitModel DeviateOnHit): how far a shot lands off. The same value, also as a tech modifier's property (ImprovedBy "Guided" HitSpread 0.75). On a beam (HitModel Chance) it reads as the chance to hit, and a warning goes to Fatal.txt. The shipped data writes it for these weapons, Precision for the others (a GuaranteedHit shot deviates only when fired at a map point).
HitChance 0…1 1 Precision by its meaning for a beam (HitModel Chance): the chance a shot hits. The same value, also as a tech modifier's property. On another weapon it reads as HitSpread, km off, and a warning goes to Fatal.txt. Shipped on the lasers.
HitModel Deviation | GuaranteedHit | Chance derived How a shot at a unit decides what it hits. Written bare, not quoted; another word stops the loading. Never changed by technologies (an upgrade's bigger blast or better Precision does not switch it). Deviation: lands up to Precision km off (a ballistic missile deviated at launch, a guided one where it reaches its target, a DirectLaunch shot when fired). GuaranteedHit: no deviation at a unit: a guided or direct-fire shot bursts right on the target, so the target takes the damage of a burst at its own position (units around it are hit by their distance from it); a ballistic one goes off where it was aimed at launch, the target's course led; a strike at a map point still deviates. Shipped on the gun rounds of aircraft and small arms, the nuclear AAMs, SAMs and ABMs, CIWS, C-RAM and some warheads. Chance: a beam, Precision is the chance to hit: only the target is touched, by the full damage. Beams always use it and other weapons cannot: a line that says otherwise writes a warning to Fatal.txt and the derived model is used. Without the line it is derived from the base values: beam → Chance; Ballistic → Deviation; other weapons → Deviation if one of their explosions has a Range of 1 km or less, else GuaranteedHit. The shipped templates in Missile_types.txt set it, weapons that differ override it after their Type line. See Hitting units.
MissileHitModel Interception | GuaranteedHit | DeviateOnHit | Chance derived How a shot at a missile decides what it hits (never changed by technologies). Interception: the target missile's CanBeIntercepted is rolled (no distances), a hit applies the damage to that missile alone: SAMs, ABMs, CIWS, C-RAM. GuaranteedHit: bursts right on the missile, every missile there damaged by its distance (no CanBeIntercepted): the nuclear ABMs. DeviateOnHit: bursts at the missile, every missile within 2 km of it hit as if Precision × random km off (no shipped weapon uses it). Chance: a beam, Precision is the chance to hit. Without the line: beam → Chance; DirectLaunch → Interception; Ballistic → DeviateOnHit if Precision < 2, else GuaranteedHit; other weapons → GuaranteedHit if their HitModel is, else Interception. Set in the shipped data for every weapon that can fire at missiles. See Interception.
CanBeIntercepted 0…1 0 Chance that one interceptor hit on this missile counts. 0 = interceptors never engage it automatically and hits (practically) never count. A counted hit subtracts the interceptor's explosion damage from this missile's Power.
DisableCanBeIntercepted (alias DisableCanBeInterceptedBitscale) class names none Interceptor classes that can never shoot this missile down: against them its CanBeIntercepted is 0 and they are not fired at it. Classes, by the interceptor weapon: EMP (one of its explosions is an EMP), Laser (DrawLaser or Immediate), DirectHit (DirectLaunch: CIWS, C-RAM), Missile (any other); also All, and None to clear the earlier ones (for mods). Several on one line or repeated lines add up. Example: the railgun slug, CanBeIntercepted 0.05 with DisableCanBeIntercepted DirectHit Missile EMP — only lasers can stop it.
Power <float> 1 Hit points of the missile in flight (not its damage).
MaxElevation (alias Elevation), MinElevation <km> [Real] 0 Flight altitude band. With Real in real km (01, Real heights): shipped for the anti-aircraft weapons (small arms 1.5, MANPAD 5, AA gun 13, light SAM and plane gun 15, AA laser 27, SAM and AAM 30, LAAM 40); the anti-missile ones are in game km. A ballistic missile with MaxElevation > 0 is a HighMissile; radars need a MaxHeight above it to see it at apogee. For interceptors this is the altitude band in which they can engage.
MaxHeightDifference <km> 0 (no limit) The most the target's height may differ from the launcher's, in real km (Real after the number is accepted and changes nothing). Meant for satellite weapons: MaxHeightDifference 5000 on a satellite's laser lets it hit satellites and missiles within 5000 km above or below its own orbit, wherever they pass. It is relative to the launcher, unlike MaxElevation/MinElevation, and applies on top of them and of Range (still the distance over the ground). A missile in flight counts its launcher's height. The weapon's info panel shows it. Not changeable by ImprovedBy/AffectedBy.
LeadGuidance <float> 0 A guided missile aims ahead of its moving target by this share of the predicted flight time (1 = the full prediction); 0 = it chases the target. Not for Ballistic and DirectLaunch shots, which always lead it fully. Tune by testing.
Ballistic flag off Ballistic trajectory (no steering, may be high-altitude).
FreeFalling flag off Unpowered bomb (use with Ballistic): drops at the target, 60° attack cone.
DirectLaunch flag off Direct fire (a gun's round, a railgun slug): fired straight at its target from any launcher, not along a moving launcher's (a ship's) heading turning toward it after, nor spread among its launchers; and drawn flying a straight line to it (not curving down onto a low target with the drawn heights' scale). Its end and whether it hits are decided as it is fired (its target led, the hit rolled), so it flies straight there: a miss (or a shot whose target is gone on the way) flies on past and is gone, exploding only where it reaches some unit; a missile it kills is drawn meeting it (the earliest killing shot's), one it only damages keeps its way. Its deviation is kept as an offset from the target and applied where the target is when the shot arrives.
MinExplosionHeight <km> [Real] 0 A ballistic missile goes off at least this high over its target: its trajectory ends there, and its explosion is there (from 61 game km, 30 real, its Variant Space, see 03 §1.3). The reach of its effects is measured along the ground, so it stays the same; but the interceptors only reach it within their own MaxElevation (the terminal ABMs, 200–250 km, never catch one bursting at 400 km). A falling bomb goes off no higher than it was dropped from. Shipped: 400 on the EMP missiles (Starfish Prime, 1962).
MaxVisualAimAngle <degrees> 10 Visual only. Fired at a unit with a model, the projectile is drawn bending onto a spot on the model, where its explosion is then drawn (see 03, hits on models); it only takes the spots it reaches turning aside at most this much, as seen from where it was fired, and between half and twice as far as the unit's middle along its way. Smaller: the hits stay near its line of fire. None of them (0, or fired from right beside or inside a big unit's model): it flies straight and its explosion is drawn where it hit. Up to 80.
Subwater Yes\|No No Travels under water (torpedo): also sets SubwaterLaunch and CheckSubwaterRoute, and OutliveRange to 2 (No: to 1); write your own OutliveRange after it.
SubwaterLaunch Yes\|No No Can be launched by a submerged unit.
CheckSubwaterRoute Yes\|No No The path to the target must be through water (depth charges, torpedoes).
CanRetarget Yes\|No No Picks a new target automatically if the original one disappears.
SurvivesLauncher Yes\|No Yes No = guided by its launcher to the end (a wire-guided torpedo): if the launcher is destroyed before it gets there, it is lost without exploding. Shipped: No on Torpedo (the attack submarines' and the destroyers'), not on the air-dropped or nuclear torpedoes. A submarine sunk in a duel does not sink its killer with the torpedoes already in the water (03 §2.1).
OutliveRange <multiplier> 1 (2 with Subwater Yes) A guided missile keeps flying up to this many times its Range before it runs out, so a slow one can still catch a moving target from behind. Range still decides what it can be launched at and the range drawn on the map. No effect on Ballistic missiles, which do not use up range. Must be above 0.
RangeCountsHeight Yes\|No No Yes = a guided missile's change of height uses up range as well, so its whole way counts. No = only its way over the map does, and a climb costs no range. No effect on Ballistic missiles.

A weapon's Precision modifiers only count where it deviates. Against units a GuaranteedHit weapon ignores them, so give a weapon with accuracy upgrades HitModel Deviation, and against missiles Interception ignores Precision and the blast altogether. A weapon whose blast is much larger than its deviation hits anyway: Precision matters only once it is larger than target Size + FullEffectRange (03 §2.1).

[MISSILE] "Torpedo"                      // shipped, shortened
  Type "Torpedo"                         // HitModel Deviation from the template
  Range 200
  Speed 100
  HitSpread 1.2
  SurvivesLauncher No

[MISSILE] "ASAT Laser"
  Type "AntiSat"
  HitModel Chance                        // a beam: HitChance is the chance to hit
  HitChance 0.9
  MaxHeightDifference 2500               // only targets within 2500 real km of its satellite's orbit

4. Warheads, explosions and MIRVs

Property Syntax Meaning
Explosion Explosion "explosion_id" Required. List property: every listed explosion is applied at impact (e.g. a blast plus a "guaranteed casualties" explosion). Up to 64.
Heads Heads <n> "missile_id" MIRV: the missile splits into n warheads of the given missile type, which must be defined before it ("Missile type not found"). Often written on the same line as the explosion: Explosion "nuke_250" Heads 6 "250kt MRBM MIRV warhead". The bus's Geneva/AI categories are copied to the warhead type.
FakeHeads FakeHeads <n> "missile_id" Decoy warheads released with the real ones. Heads + FakeHeads ≤ 20 ("Too many warheads").
SplitPathPercent <0…1> Where along the path the warheads separate (default 0.66).
SplitMinDist <km> Separation happens at least this far before the target.
IndependentTargeting Yes\|No Warheads may be redirected to other visible enemy units that are closer than 75 % of the distance to the original target (only for unit targets, not cities).
[MISSILE] "3x100kt_MRBM"                 // shipped MIRV, shortened
  Explosion "nuke_100" Heads 3 "100kt MRBM MIRV warhead"
  Explosion "Guaranteed_Casualties_4750"

5. Production and availability

Property Syntax Default Meaning
Tech "tech_id" required Availability and display name.
DisablingTech "tech_id" none Weapon becomes unavailable when the owner knows this tech (used to swap in improved versions).
Class "UC_…" / NULL auto Unit class for production UI (UC_Nuke_Weapon, UC_Nuke_Tac_Weapon, UC_Spec_Weapon, UC_Non_Nuclear_Weapons, …). NULL or none: the class goes by the weapon's target class.
ProductionCost <float> 0 Build cost. Only weapons with a cost > 0 appear in the production list; 0 = the weapon exists only as unit stock (guns, lasers, buffs).
ProductionCostDegrades flag off Cost is multiplied by the faction's nuclear efficiency factor (1 ÷ current efficiency), so nukes become cheaper as the efficiency grows (ProductionEfficiency.txt, 05).
ProducedByAnotherUnit flag off Built by a unit with Produces, not in the faction's production.
MaxNumberToOrder <int> unlimited Queue limit.
CanBeBuilt Yes\|No Yes Tech-modifiable number (0 = no).
[MISSILE] "100kt_nuke_light"             // shipped, shortened
  Tech "M_100kt_nuke_light"
  ProductionCost 0.75
  Class "UC_Nuke_Weapon"
  ProductionCostDegrades

6. Rules of engagement and politics

Property Syntax Default Meaning
GenevaCategory GenevaCategory "category" [Yes\|No] none Adds (or with No removes) a Geneva category. Categories are what the diplomacy "weapon ban" offers operate on. Must be declared with [GENEVA_CATEGORY].
AICategory AICategory "category" [Yes\|No] none AI weapon category (used by the AI's escalation logic and by scripts via AI_CATEGORY). Declared with [AI_CATEGORY].
CanBeLimited Yes\|No Yes Whether the weapon can be disabled by Geneva bans / limited-escalation rules. Set No for conventional weapons.
Inhumane Inhumane <weight> not set: the highest Inhumane of its explosions Marks the weapon inhumane with this weight, overriding its explosions' marks. Leave it out and mark the explosion instead (03 §1.6): the shipped weapons do. Copied by Type.
Switchable Switchable [Yes\|No] [ON\|OFF] No Player can switch the weapon on/off; OFF = off by default. Scripts use Weapon_Switch.
DoesNotTriggerWarOnAttack Yes\|No No Using it does not start a war (espionage, cyber).
SingleAttack flag off Firing this weapon is the whole attack — the unit does not add other weapons to the same salvo, and a target that only this weapon can hit counts as "single attack" (nukes).
MaximizeExposure Yes\|No No AI/war planner spreads these weapons to cover more area instead of focusing.
PreferPopulationOverDistance Yes\|No No AI picks city targets by population rather than proximity.
AutoSlowDown flag off In single-player (if enabled in settings) the game slows down when such a missile is launched at or by the human player.
[MISSILE] "100kt_nuke_light"             // shipped, shortened
  GenevaCategory "Light Gravity Bombs"
  GenevaCategory "Basic Fission Weapons"
  AICategory "Basic Nuclear"
  SingleAttack
  AutoSlowDown

Diplomacy. In Conquest every use of a weapon can add to the firing faction's infamy, which the other factions answer with their mood, protests and sanctions (20 — Diplomacy). What counts is read from the data:

  • a nuclear weapon by its AI category: the categories that AI/MissileCategoryMapping.txt lists under Tactical or Strategic (shipped: Tactical Nuclear, Basic Nuclear, Small MIRV; Strategic Nuclear, SLBM, Salted Weapons, Orbital Strike), weighed by the Kilotons of one warhead (a MIRV's launch is one use);
  • a chemical weapon (an explosion of Type Chemical): infamy, never an atrocity;
  • an inhumane weapon (Inhumane on one of its explosions, or on the weapon): a deliberate deed of that weight;
  • a weapon that can be aimed only at missiles (an ABM, a nuclear one too) never counts as used on the units its blast catches.

The rules and their numbers are in AI/Infamy.txt (08).

Declaring categories (in Missile_types.txt)

[GENEVA_CATEGORY] "Chemical" Name 3260     // Name = string ID in UI.lng
[AI_CATEGORY] "Strategic Nuclear"          // Name optional

At most 32 Geneva categories and 32 AI categories. A category must be declared before a weapon names it (an error at loading otherwise), and a weapon's own category lines go after its Type line (§1).

7. AI hints

AIHint gives the AI a base value when choosing a weapon config: it multiplies the config's score, and the highest score is chosen. 1.0 is normal, 0 means "never useful", 10 means ten times better. A config's hint H is the sum of the hints of its weapons that are usable against the target: a Specific line for that target's type if there is one, else CounterForce (or CounterValue for a city or no target). A 0 cannot be raised by other factors. The hint should carry what the rest of the score cannot see, such as a nuke's effect on the units around its target.

Against a unit:

score = min(1, K) × H × √(min(1, Range / TargetRange)) ÷ (1 + 10 × Cost / TargetCost)

K = max(1, Heads) × Damage ÷ target Power × hit chance × mean damage share × shots
Term Meaning
K The share of the target one attack destroys. Hit chance and mean damage share as in 03 §2.1, with the modifiers against that target. shots: for a flying attacker the rounds it carries of the weapon, at most 30; otherwise 1.
Range, TargetRange The weapon's range and the target's longest attack range. Counts only when the attacker can move and the weapon is outranged.
Cost The config's cost: each weapon's ProductionCost (with ProductionCostDegrades) × its stock in the config (a stock of 0 counts as 1). A config that costs nothing is not lowered.
TargetCost The target's production cost. A target that costs nothing: × 0.1 instead of the division.

For example, a weapon costing 0.75 is divided by 2.5 against a target costing 5 and by 1.4 against one costing 18.

Against a city: H × the points its expected casualties are worth × the warheads factor. With no target: H × heads × Damage × the warheads factor. The warheads factor is 1 for one warhead, otherwise the larger of 2.5 and √(Heads + FakeHeads).

Against a unit, K is capped at 1, so a small hint decides between two weapons that both destroy the target; keep the values close. The base game gives conventional weapons 1, tactical and basic light nukes 1.5, other light nukes 1.2, heavy nukes 0.5 or less, and chemical weapons 4 against the army units. The hint is a real multiplier: a weapon with hint 4 is preferred to one with hint 1 that destroys up to four times as much. The war plan's Select best config, the AI's attacks and what the AI stocks all use this score.

Form Meaning
AIHint CounterValue <v> Value against cities / population (default 1; automatically 0 if the weapon cannot hit cities).
AIHint CounterForce <v> Value against military units (default 1).
AIHint Specific "Unit_ID" <v> Value against a specific unit type, in place of CounterForce (e.g. chemical weapons vs armies). A unit ID that exists nowhere stops the loading.
AIHint Specific "Unit_ID" Delete Removes a specific hint (useful in MODIFY).
[MISSILE] "3x100kt_MRBM"                 // shipped, shortened
  AIHint CounterValue 8
  AIHint CounterForce 1.2
  AIHint Specific "ABM_Site" 3

8. Display and sound

Property Syntax Meaning
Icon "file.png" Required. Weapon icon.
RoundIcon "file.png" Round icon (defaults to Icon).
Movie, Model "file" 2D sprite / 3D model in flight.
DrawSize, ModelDrawSize, AbstractDrawSize <float> Size on screen (default 8): DrawSize the picture, ModelDrawSize the size among the 3D models (default DrawSize), AbstractDrawSize the zoomed-out icon. ModelDrawSize is its real size next to the units' models: a projectile with a Model is drawn that big; one with a picture only (Movie: a shell, a tracer, a cruise missile) turns into that size as it zooms in to the models (its picture as long as its model would be), in the terrain views at once. Shipped: by the real lengths, squeezed (a round 2, a shell or a railgun slug 3, bombs 3–5, the Tsar bomb 8, an air-to-air missile 7, a cruise missile 8, a SAM 9, an SRBM 10, an ICBM 14–16).
DrawNuke flag Draw as a nuclear missile; written in the weapon itself it also enables the trajectory trail (§1). It is marked by what it carries (its Explosions' types): a nuclear or EMP warhead with a red ring when zoomed out and a red head on its trail zoomed in, a biological one violet; the decoys a MIRV carries (FakeHeads) pass for its warheads; anything else (a kinetic rod) is not marked. It is always drawn where it really is.
DrawBomb flag Draw as a bomb (DrawNuke + DrawBomb = nuclear bomb).
DrawLaser flag Draw as a beam: a white-hot core in a coloured glow, a glow at the muzzle (the weapon's LaunchPoint on the unit's model) and on the target; Color, DrawSteps, DrawCycles and the Laser… properties below control it.
Immediate flag Instant effect with an invisible beam (hit-scan).
DrawWave [Passive] flag Draw as a wave (jammers, EMP-like effects).
Color "RRGGBBAA" / RGB r g b / RGBA r g b a Beam colour: its glow; the alpha is its strength (default 255 77 51 191, a red beam). Alpha 0: no beam drawn.
DrawSteps, DrawCycles <int> Beam timing (defaults 3 and 1): it lasts DrawSteps × DrawCycles ticks (60 a second at normal speed) and hits at the end; a pulsed beam's pulse runs to the target every 2 × DrawSteps ticks (at least 6).
LaserCore colour, as Color The beam's white-hot core (default white).
LaserStyle Pulse | Steady Pulse (default): a bright pulse runs to the target, the beam dimmer around it. Steady: an even beam, for the big continuous lasers.
LaserWidth <float> (0.1–10) The beam's width, times the usual (default 1).
Trajectory Trajectory [Style Missile\|Tracer\|Shell\|Railgun\|Wake\|Gas] [Disabled] [StandardBlend] [MaxPoints n] [MaxLength km] [WidthMult f] [StartColor "RRGGBBAA"] [EndColor "RRGGBBAA"] [BlendR f] [BlendG f] [BlendB f] [BlendA f] Trajectory trail. Defaults: 200 points, full length, white → transparent, blend powers 1/2/4/1. Without the line a weapon has no trail, unless its own DrawNuke enables one. MaxPoints at least 10, MaxLength at least about 100 km. Lower MaxPoints (≈20) and MaxLength (≈1000) for short-range weapons to save performance. MissTrail is accepted and has no effect. Style sets how it looks. Missile (default) follows the height: in space a thin glowing line with a white-hot core and light running along it; in the air (below about 40 km in the game's heights) a pale smoke trail spreading behind; a warhead coming down through the upper air glows orange instead. Tracer (gun rounds): a short bright streak, hot at the round, at any height. Shell: a thin warm streak with a short wisp of smoke. Railgun: an intense crackling streak with an ionised glow (give it blue-white StartColor/EndColor). Wake (torpedoes): white foam spreading behind. Gas (chemical, biological): a wide soft billowing cloud in the trail's colours. The trail reaches the projectile where it is drawn and, after it is gone, fades away from its tail: in 20 ticks (a tracer), 40 (a shell), 90 (a missile), 45 (a railgun), 150 (a wake) or 240 (gas); 60 ticks are a second at normal speed. A ballistic missile flying out of the air (its MaxElevation above 80 km, with the Missile style: not gun rounds, shells, rocket pods, torpedoes, bombs or warheads) also leaves a launch plume, on its own: the thick column of smoke of its climb through the air (below 80 km), staying where it was left after the missile has flown on, widening and thinning out over about 20 seconds; LaunchPlume overrides this. A nuclear burst clears the smoke around it as its flash grows (1.5 × its FullEffectRange, at least 5 km): its own warhead's last stretch, plumes and wakes in the blast. A MIRV's warheads' trails fan out from where its bus released them, with a glint and the thrusters' gas there (the emulated explosion MIRV_Split of explosion.txt, Units/Emulated/MIRVSplit.txt).
SmokeSpeedMult, SmokeSizeMult, LaunchLightSize <float> Launch smoke and flash (high ballistic missiles get defaults 1 and 50). The smoke is the emulated explosion Launch_Smoke of explosion.txt (Units/Emulated/LaunchSmoke.txt), drawn on the launcher's model at its exhaust, a quarter of the model's height up (a ship's deck), DrawSize launcher lengths across times SmokeSizeMult (a ship's: Launch_Smoke_Naval when there is one, DrawSize 0.5 shipped: a ship is much longer than a silo); without that type plain smoke sprites (SmokeSpeedMult is theirs). A submarine makes no smoke: surfaced (or firing a missile it cannot fire under water) only the launch plume; submerged a short burst of white spray where the missile breaks the surface (Launch_Spray, Units/Emulated/LaunchSpray.txt; nothing without that type). Smoke and plume are drawn only for a player who sees the launch.
LaunchPlume auto | Yes | No The column of smoke of the climb (see Trajectory): auto (default) only for a ballistic, not free-falling missile with the Missile trail style flying above 80 km; Yes always, No never. A missile launched from an aircraft has none.
Sound Sound <id> [or <id>]… [Priority n] [SoundSize f] [Volume f] [Speed f] [MuteLength f] Launch sound, random among up to 8.
Hidden Yes\|No Not listed in the unit's weapon panel or diplomacy screens (internal effects).
DoNotShowInEncyclopedia [Yes\|No] Never mentioned in the Explodopedia (14): no page, and no icon, link or row naming it on other pages. Alias DoNotShowInExplodopedia. Its MIRV warheads are left out with it. A Type written after it does not clear it. Default No.
HideRange Yes\|No Range circle not drawn.
HideNumberOfMissiles Yes\|No Stock count not shown.
GlobalShowType GlobalShowType <group> Range-display group: SAM_RANGES, ABM_RANGES, MRBM_RANGES, ICBM_RANGES, JAMMER_RANGES, LW_RANGES, SW_RANGES, OVERHORIZONT_RANGES, SONAR_RANGES, SPACE_RANGES, SATELLITE_RANGES, OPTICAL_RANGES. List property.
InRangeStringID <strID> Text shown in the unit panel of a unit that is inside this weapon's range (aura effects).
FixedRotationAngle, ForceMipMap Yes\|No Sprite options.
SimplifiedVisibilityCheck Yes\|No Cheaper visibility test for short-lived projectiles (bombs, shells): no sensor checks it, the shot is seen when its launch is seen (the launcher visible, or its last known position where the launcher really is) and stays seen. Not for what can be intercepted (CanBeIntercepted above 0): interceptors engage only what their side sees.
AchievementProperty "ACH_ID" [check "tech"] Achievement hook.
[MISSILE] "100kt_nuke_light"             // shipped, shortened
  Icon "Units/Images/Missiles/Level_1/100kt_nuke_light.png"
  Movie "Units/Images/Projectiles/Bomb_Conventional.midx"
  Model "Units/Images/Projectiles/Model/Bomb_Conventional.MIDX"
  DrawSize 4
  ModelDrawSize 4
  DrawBomb
  DrawNuke
  Trajectory Style Shell

9. Global settings (top level of the missile files)

Setting Default Meaning
GlobalSpeedModifier <f> 1 Multiplies every missile's speed.
MinMissilesPerTarget <n> 2 Interceptors fired at one target before other defences redistribute.
MaxMissilesPerTarget <n> 1024 Maximum interceptors that will engage one target.

(GlobalMissileLaunchDelayModifier, which scales reload times, lives in Units.txt.) The shipped files set none of them. Between entries, for example at the top of a mod's file:

USE PREVIOUS "Units/Missile_defs.txt"
GlobalSpeedModifier 1.25                 // every missile a quarter faster
MinMissilesPerTarget 3

10. Weapons that are not missiles

Buffs, debuffs and utility effects use the same format. The usual pattern:

  1. A missile with Type "No Attack" (or a narrow template), Hidden/HideRange, a large stock and Switchable so the player can toggle it — e.g. Research_Buff, Espionage_Buff, EW Jammer.
  2. Other objects react to it with ImprovedBy InRange "missile" (own/allied aura) or AffectedBy InRange "missile" (enemy aura):
[UNIT] "VirtualCity" MODIFY
  ImprovedBy InRange "Research_Buff" Science 1.10       // cities near an active Research Center

[RADAR] "Fixed Long Wave" MODIFY
  AffectedBy InRange "EW Jammer" Range 0.60             // radars inside an enemy jammer's range

An aura counts when the weapon is switched on and the affected unit is within the weapon's Range of the emitting unit. At most 32 different weapons can be named after InRange or TargetInRange in the whole game; one more stops the loading ("Too many checked missile types").

Jamming: AffectedBy TargetInRange

A jammer protects what stands under it: AffectedBy TargetInRange "aura" on the attacking weapon applies while its target is inside an active aura of the target's own side or an ally. The shipped game has no such jamming of weapons (the EW Jammer above jams radars): Units/EW_Jamming.txt holds the lines for 18 guided weapons and Units/Missile_defs.txt a "Missile Jammer" aura, both commented out, as an example. A mod that wants it writes the aura, puts it on a unit and gives the weapons the line, here through a ladder (06 §5.1):

[MISSILE] "My Missile Jammer"                           // Units/Missile_defs.txt of the mod
  Tech "M_EW_Ground"
  Type "No Attack"
  Icon "Units/Images/Missiles/JAMMER.png"
  Explosion "No_Explosion"
  Range 150
  Switchable ON
  CanBeLimited false
  ImprovedBy "Jammers_Mk2" Set Range 200

[MISSILE] "AGM" MODIFY
  AffectedBy TargetInRange "My Missile Jammer" Ladder "My_Jamming" HitSpread

The unit that carries it takes Weapon "My Missile Jammer" 1 in its configs; the ladder "My_Jamming" goes into Ladders.txt (07 has the whole recipe). A ladder that gives HitSpread × 4 two or more countermeasure levels behind, × 2 one behind, × 1.18 level and × 1 ahead leaves a small blast about 25 %, 50 %, 85 % and all of its hits.

  • It never applies to a shot at a missile, nor to a strike at a point of the map.
  • It is read when the shot deviates: a ballistic missile at launch (the target's cover then), a guided one at impact, a direct-fire one when fired.
  • It only does something on a weapon that deviates. On a GuaranteedHit weapon, or where Precision stays below target Size + FullEffectRange, it changes little or nothing (03 §2.1).
  • It stacks with the targets' own ECM (shipped: AffectedBy Unit "ECM_Bonus_1..4", HitSpread × 1.075 and Damage × 0.9 a level, on 15 guided weapons).
  • A Set in the same weapon discards what was applied before it: see the order in 06 §9.

11. Checklist for a new weapon

  1. Technology M_My_Weapon in tech.txt (+ strings).
  2. Explosion(s) in explosion.txt (or reuse existing ones).
  3. [MISSILE] with Tech, Type (first), Icon, Explosion, and the stats.
  4. Put it in a unit's Config with stock, Launch, Time, and AutoEngage if it should fire on its own (rate of fire: 03 §2.1).
  5. If it is a nuke or WMD: Class, GenevaCategory, AICategory, CanBeLimited (default Yes), ProductionCostDegrades, AIHints.
  6. Decide how it hits: HitModel (and MissileHitModel if it fires at missiles) after the Type line, and work out its hit chance by hand.
  7. A game mode with its own copy of the files needs it too (below).

Game modes

GameMode/Blitz has its own Units/Missiles.txt (templates and weapons in one file, no USE lines, no HitModel lines: all its models are derived) and its own Units/explosion.txt, so a weapon or a change in Units/Missile_defs.txt does not reach it. Its Tech.txt has Jammers to Jammers_Mk3 but no Jammers_Mk4 and no Electronic_Counters, and its Ladders.txt has no ladders: a technology, a unit or a ladder named in a Blitz file must exist in the Blitz files, or the loading stops. Conquest and Standoff extend the main files with USE PREVIOUS.

What stops the loading

Message Cause
No technology assigned, No explosion type assigned, No image assigned, Too many warheads A required property missing, or more than 20 warheads (00 §7).
Missile type not found Type naming no earlier [TYPE], Type inside a [TYPE], or Heads / FakeHeads naming no earlier [MISSILE].
Explosion type not found Explosion naming no entry of explosion.txt.
Technology not found Tech, DisablingTech or a modifier naming no technology.
Unit Type not found CanBeUsedAgainst "Unit_ID" or AIHint Specific naming no unit.
Turn speed too slow A TurnSpeed that makes the effective range less than half of Range.
HitModel must be…, MissileHitModel must be… Another word after these keywords.
Too many checked missile types More than 32 weapons named after InRange / TargetInRange.

These only write a warning to Fatal.txt in the save folder, and the game goes on: a HitModel or MissileHitModel that does not fit a beam or a non-beam (the derived model is used), HitChance on a non-beam, HitSpread on a beam.