11 — Campaigns and scenarios¶
Index · Maps · Cheats build · Event scripts
The layer above individual event scripts: how a campaign is assembled from missions, how a mission's win/lose conditions are declared, and how the mission map itself is prepared. The scripts themselves are in chapters 15 to 18.
Contents
- Overview
- The top-level SCENARIO file
- The map file's ScenarioInfo block
- Missions in event scripts
- Chaining missions across a campaign
- DLC campaigns and the virtual Scenario folder
- Preparing the mission map in the Cheats build
- Mission-specific mods
- Example 1: a single scenario from a saved game
- Example 2: a campaign of three missions
- Example 3: a mission with its own units and rules
1. Overview¶
A campaign is one top-level SCENARIO file plus an ordered set of missions. Each mission is a
separate map file (Scenario/<Campaign>/<Campaign>-N.txt) with its own ScenarioInfo block and its own
per-faction event scripts (see Where event scripts live).
Top-level campaigns:
Scenario/Main.txt— the base game's main campaign, 11 missions (Main-1.txt…Main-11.txt).Scenario/SNARE.txt— a 5-mission campaign (SNARE-1.txt…SNARE-5.txt).- Each DLC ships its own top-level
SCENARIOfile (DLC_1.txt,DLC_2.txt,DLC_3.txt), 11 missions each. See §6 for where these physically live.
A mission map is an ordinary map file (09 — Maps) that also carries the starting position —
units, technologies, borders — and a ScenarioInfo block. §7
shows how to make one. The files of the main campaign's first mission:
Scenario/Main.txt the campaign file
Scenario/Main/Main-1.txt the mission's map, with its ScenarioInfo block
Scenario/Main/Main-1.txt.remap.txt the region owners
Scenario/Main/Main-1.png the mission's picture in the campaign menu
Scenario/Main/Main-1/briefing.png the briefing and end screens' pictures
Scenario/Main/Main-1/EVENTS/<faction>.txt one event script per faction
2. The top-level SCENARIO file¶
SCENARIO
Name ID 6000
Description ID 6001
MAP "Scenario/Main/Main-1.txt"
Image "Scenario/Main/Main-1.png"
MAP "Scenario/Main/Main-2.txt"
Image "Scenario/Main/Main-2.png"
...
The file lies directly in a Scenario/ folder: the game's, or an enabled mod's. The game tries every file
there as a campaign and does not look into subfolders, so Scenario/BorderCrisis/BorderCrisis.txt is never
found. The lines come in this order:
SCENARIOstarts the file. A file that starts with anything else is not a campaign.Name ID/Description ID: the campaign's name and blurb as shown in the campaign menu. Instead of an ID, the text can be given directly:Name "text", or one line per language (Name Eng "text").Image(optional): the picture shown for the campaign when the selected mission has no picture of its own. Without one the picture area stays empty for such a mission. It comes straight afterDescription.Faction N(optional, default 0): the faction slot the player commands (SNARE.txt→Faction 0,DLC_1.txt→Faction 1,DLC_3.txt→Faction 0;Main.txthas none).MAP "path"/Image "path"pairs, one per mission, in campaign order: the mission's map file and its picture on the campaign screen (16:10; optional). This list sets the menu's order; the label and the description are the map file'sMAP NameandDescription. The mission-to-mission chaining at run time is done inside each map file'sScenarioInfo(§5).
A campaign without a name or at least one readable map is left out of the menu, without an error. So is a mission whose map file does not start with MAP Name.
The player can pick the first mission and every mission whose predecessors have all been won or skipped. The menu shows the stars of the won ones and selects the first mission not yet won. Progress is read from the result file of each mission (§5).
String IDs and the LANG file¶
Every Name ID, Description ID, Text ID and BriefingText ID is a number, looked up in a .lng file
at run time. From DLC-3's string file, UI.lng:
// DLC will use the range from 7099 to 7600
USE Previous "LANG/Eng/UI.lng"
7099 LANG "The year is 1946...."
7100 LANG "DLC: Assassin's Mace"
7101 LANG "Assassin's Mace"
7102 LANG "After decades of chaos, China is ready..."
USE Previous "path"chains this file to the base.lngfile, so a DLC's strings extend rather than replace the base game's.- Each entry is
<ID> LANG "<text>"— a flat table from numeric ID to the localised string. - A DLC reserves its own block of IDs so it cannot collide with the base game or another DLC (DLC-3 owns 7099–7600). Numbers from 7601 up are free for a mod's campaign.
DLC_3.txt'sName ID 7101/Description ID 7102resolve this way to the campaign's displayed name and blurb;BriefingText IDand every mission'sText IDwork the same way.
3. The map file's ScenarioInfo block¶
Each mission's map file (e.g. Scenario/Main/Main-1.txt) has a ScenarioInfo block. Its parts are read in
the order shown here, so keep to it (primary and secondary missions may be mixed, and so may the ON blocks):
ScenarioInfo
BriefingText ID 6004
BriefingImage "Scenario/Main/Main-1/briefing.png"
Primary Mission "Territory"
Text ID 6005
Value 1
ProductionPoints 150
Secondary Mission "NorthKorea"
Text ID 6006
Value 1
ProductionPoints 200
ON Success
Text ID 6008
Image "Scenario/Main/Main-1/success.png"
ON Failure
Text ID 6009
Image "Scenario/Main/Main-1/failure.png"
EndGameCountdown 600
ResultFileName "Scenario/Main/Main-1.txt.result"
ProceedTo "Scenario/Main/Main-2.txt"
BriefingText ID/BriefingImage: the text and image of the mission's briefing screen. The text can also be given directly, likeNamein §2. WithoutBriefingImagethe screen shows a generic picture.AdvisorPortrait "path"(afterBriefingImage, optional): the picture that event scripts read as ADVISOR_PORTRAIT.Primary Mission ["Name"]/Secondary Mission ["Name"]: one mission slot."Name"is the mission ID used from event scripts (§4); letter case does not matter. A map can declare several of each; the event scripts decide what winning each one means. The keywords of a slot are in the table below.ON Success/ON Failure: text and image of the end-of-mission screen. Both blocks are required; theImagein them is optional (a generic picture without it). The text can be given directly too.ON Failure1,ON Failure2(optional): the screens for a failure withFAIL TYPE 1orFAIL TYPE 2. Without the block, that failure shows theON Failurescreen.ON Partial(optional): the text for a game that ends by the game's own rules while primary missions are still open (pollution reaches 100%, the player surrenders). Without anImageit uses theON Successimage.EndGameCountdown: the ticks between the mission's outcome and the end of the game (600 in Main-1, 1200 in Main-2, 120 in Main-11; 60 ticks are one second at normal speed). Default 0.ResultFileName: where this mission's outcome is recorded. Default: the map file's path plus.result. Keep to that path: it is the one the campaign menu reads.ProceedTo: the next map file to load once this mission is won. Absent on the last mission.RetryFileName(optional): the map to load when the player accepts a retry after a lost mission. Default: this mission's own map.TransitionFileName: the result file read on this mission's start, normally the previous mission's. Absent on the first mission, unless the campaign gives it a starting budget (§5).DrawPopulationBitscale(optional): the factions whose remaining population is shown under the mission objectives, as a sum of bits (7= factions 0, 1 and 2). Scripts change it with Show / Hide Population.
The keywords of a mission slot, in the order they come:
| Keyword | Meaning |
|---|---|
Hidden (before the name) |
Not shown until a script gives Mission "Name" UNHIDE. A hidden primary mission still has to be completed. |
Text ID |
The mission's description in the mission list. It must be an ID here. |
Decreasing (before Value) |
The mission starts as completed and counts losses: it fails when Value minus the count drops below ValueToComplete. |
Value |
The target of the mission's progress counter (driven by Mission "Name" add … / SET … from the event scripts). Value 1 is a plain success/fail mission; Value 5 (as in Main-2.txt's "Missiles" mission) is a counted objective, e.g. "destroy 5 missiles". |
ValueToComplete (optional) |
The count that completes the mission when it should be lower than Value. Progress above it still earns points and stars. Default: Value. |
ProductionPoints (optional) |
The reward for the mission, paid in proportion to its progress (§5). Default 0. |
shown, finished, RemainingPoints, StartingTechs and a slot's CurrentCompletion, Status, FailureType
and Timer hold the state of a running mission. The game writes them into saved games; a mission's map file
leaves them out.
The campaign's last mission additionally declares ON FinalSuccess, ON FinalSuccess1 and
ON FinalSuccess2 (each with its own Text ID/Image; without an Image they use the ON Success image).
They are not alternative endings: they are up to three end-of-campaign screens shown one after another when
the finale mission reaches the Final_Success outcome (§4).
How a mission ends¶
Only primary missions decide the outcome:
| Primary missions | Outcome | Screen | Stars |
|---|---|---|---|
| Any one has failed | Lost | ON Failure, or ON Failure1 / ON Failure2 by its FAIL TYPE |
0 |
| All are completed | Won | ON Success |
1–5 |
All are completed, one of them with FINAL_SUCCESS |
Won | ON FinalSuccess, then 1, then 2 |
1–5 |
| Some are still open | The game goes on | ON Partial, if the game ends by its own rules |
0 |
The EndGameCountdown starts as soon as the mission is lost or won. A map without primary missions counts as
won from the start, so give every mission at least one. After a mission with 0 stars, the game offers a retry.
A lost mission with a ProceedTo can also be skipped from that question: its result file gets 0 stars (an earlier
win stays as it was) with the techs the player had at the end and no points but those of unfinished research. The
campaign menu shows the mission as skipped and opens the next one.
Mission "Convoy" FAIL TYPE 1 // shows the ON Failure1 screen
Mission "Casualties" FINAL_SUCCESS // the last mission: ON FinalSuccess, FinalSuccess1, FinalSuccess2
Stars. A won mission earns at least 1 star and at most 5. The stars above the first come from the
completed secondary missions and from primary progress above ValueToComplete; a mission that has neither gets
all 5. Scripts read the stars of the campaign's earlier missions as
SCENARIO_TOTAL_SCORE.
Satellite orbits¶
RealisticSatelliteOrbits is a line of the map file outside the ScenarioInfo block
(09 §7). A map without the line has realistic orbits, whose tracks
drift as the Earth turns. All missions of Main and SNARE have RealisticSatelliteOrbits false, the classic
orbits whose tracks stay in place. A new mission that needs classic orbits must carry the line itself:
RealisticSatelliteOrbits false
4. Missions in event scripts¶
A mission declared in ScenarioInfo is driven from the event scripts with the MISSION/Mission keyword:
the Mission event reacts to an outcome, and the
Mission action changes it.
// Main-1.txt / EVENTS/United Nations.txt
ON BESIEGED "Busan" BY ENEMY MISSION "Territory" FAIL
ON REGION_OCCUPIED "North Korea" BY ALLY PLUS ME MISSION "NorthKorea" SUCCESS
// Main-11.txt / EVENTS/United States.txt (the campaign's last mission)
if (Total>=15)
Mission "Casualties" Success
else
Mission "Casualties" Fail
end
...
BLOCK CheckForFinalSuccess()
Mission "China" Success
Mission "Russia" Success
Mission "Casualties" Final_Success // triggers the FinalSuccess / FinalSuccess1 / FinalSuccess2 screens
END
ScenarioInfo declares the mission slots (name, description, target value, reward) and the event
scripts decide when each one succeeds or fails. Mission "Name" SUCCESS/FAIL, Mission "Name" add N/SET N
and MISSION_STATE("Name") are the only connection between
the two files. SET N makes N the mission's new target and restarts its progress at 0. A mission name that
is not in the map file does nothing, without an error.
5. Chaining missions across a campaign¶
Across Main-1.txt → Main-2.txt → … → Main-11.txt, the fields form a linked list:
| Mission | ProceedTo |
TransitionFileName |
|---|---|---|
Main-1.txt (first) |
Main-2.txt |
(none) |
Main-2.txt |
Main-3.txt |
Main-1.txt.result |
| … | … | … |
Main-11.txt (last) |
(none) | Main-10.txt.result |
Each mission points forward to the next map to load (ProceedTo) and back to the previous mission's
recorded outcome (TransitionFileName, the previous mission's ResultFileName).
The result file. When a mission is won, the game writes its ResultFileName into the player's folder
(Documents/My Games/ICBM-Escalation/SCENARIO/<Campaign>/…). Delete these files to test a campaign from the
beginning. A later win with fewer stars does not lower the recorded stars.
5 // stars
ProductionPoints 450 // the reward
TechLevel 2
Techs // "standard": the mission gave it; "available": researched during it
"Nuclear_Fission" standard
"Generation_2_Aircraft" available
END
What the next mission receives:
- Points. The reward is the sum of each mission's
ProductionPointsin proportion to its progress, plus twice the points left unspent at the mission's start, plus the worth of research left unfinished. Half of the reward is added to the next map's starting points, and the player spends them on the points screen before the mission. This screen is skipped when there is nothing to spend. SoProductionPoints 150is worth 75 points to spend. - Technologies and tech level. The player's faction keeps its technologies and its tech level. A technology researched during the mission that the next map gives anyway is paid back in points instead.
- The faction slot. The next mission is played with the same faction slot number, so the player's faction
must have the same place among the
Playerblocks of every map of the campaign.
A budget for the first mission. TransitionFileName works on the first mission too, with a result file
shipped in the campaign's folder. SNARE-1.txt reads Scenario/SNARE/SNARE-0.txt.result, a file in the format
above that holds the campaign's starting points and technologies.
6. DLC campaigns and the virtual Scenario folder¶
Each DLC ships its own top-level SCENARIO file, structured like Main.txt/SNARE.txt:
// DLC_3.txt
SCENARIO
Name ID 7101
Description ID 7102
Faction 0
MAP "Scenario/DLC_3/DLC_3-1.txt"
Image "Scenario/DLC_3/DLC_3-1.png"
...
Physically, a DLC's SCENARIO file and its missions live inside the DLC mod's own package, under
DLC_n/Scenario/. The mod virtually extends the base game's Scenario/ tree, so every path inside these
files is still written as Scenario/DLC_n/..., as if it were part of the base game's folder (the same
convention as for USE paths in event scripts).
Case study — DLC-3 Mission 1. Its ScenarioInfo declares six mission slots — "All China",
"Destroy Enemy", "Control 2 Territories", "Lose less than 30 divs" (a bonus objective that can fail on its
own), "Complete Faster" and "Casualties" — driven from EVENTS/Communist Party of China.txt and
EVENTS/Kuomintang.txt. "Complete Faster" is a timed bonus objective:
// DLC_3-1.txt / EVENTS/Communist Party of China.txt
MISSION "Complete Faster" TIMER FasterTimer
ON TICK +FasterTimer MISSION "Complete Faster" FAIL
MISSION "Name" TIMER <var> starts a countdown tied to that mission slot; the ON TICK fails the mission
once it runs out.
7. Preparing the mission map in the Cheats build¶
The quickest way to build a mission's starting position is to set it up in a running game and save it as a scenario. This uses the Cheats build.
- Load a standard map (e.g. Atomic Earth) in a single-player game in the Cheats build.
- Research technologies. Queue the technologies the faction should start with and press Shift + T — the whole research queue is completed at once.
- Build units. Ctrl + click a unit in the production panel: it is added already built and is ready to deploy at once. Repeat for every unit you need.
- Place units. Deploy them on the map — holding Ctrl lets you place a unit anywhere, including outside your own territory. Select a deployed unit and press Ctrl + T to move it instantly to the point under the cursor.
- Adjust borders if the mission needs it: Ctrl + O gives the region under the cursor to the current faction.
- Switch factions with Shift + 0 … 9 (the faction slot number) and repeat steps 2–5 for every faction that needs a prepared position.
- Save as scenario: hold Shift when confirming Save. The game writes
Documents/My Games/ICBM-Escalation/SAVES/SAVEn/world.txtandworld.txt.remap.txt.
What a scenario save contains: the map part, all units on the map, each faction's technologies and stocks,
region owners (in world.txt.remap.txt), the game rules that differ from their defaults (classic satellite
orbits among them, §3), and two templates to fill in — a commented-out ScenarioInfo
block and, for every active faction, Events FromFile "Scenario/MY_SCENARIO_NAME/MISSION_N/Events/<faction>.txt".
It leaves out the game clock, the mod list, AI plans, diplomacy history, pollution and score.
Turning it into a mission:
- Copy the two files into the campaign folder with matching names, e.g.
Scenario/BorderCrisis/BorderCrisis-1.txtandScenario/BorderCrisis/BorderCrisis-1.txt.remap.txt(the region owners are read from the map file's name plus.remap.txt). - Set
MAP Name ID/Description IDto your string IDs. - Uncomment the
ScenarioInfotemplate and fill it in (§3). - Point each
Events FromFileline to the faction's event script (a file that does not exist stops loading), or remove it for factions without a script. - Add the map to the top-level
SCENARIOfile (§2).
The placeholders as the scenario save writes them:
MAP Name ID …
...
/*
ScenarioInfo
BriefingText ID XXXX
...
*/
...
Player "Europe" ...
Events FromFile "Scenario/MY_SCENARIO_NAME/MISSION_N/Events/Europe.txt"
Example 1 goes through all the steps.
The same save can also become a free-play map — see 09 — Maps §11.
8. Mission-specific mods¶
A campaign runs on the base game's data: no game-mode mod is active (12 §8). A mission that needs different data — another economy, changed or extra units, an extra technology — brings it in its own mod, named in the mission's map file:
MAP Name ID 6002
Description ID 6003
Restrictions …
MapSpecificMod "Scenario/Main/GDP-Mod"
The mod is active only while that mission is played, has priority over all other mods, and is kept in the mission's saved games. 09 §13 describes how it works; the points specific to campaigns are below.
The shipped campaigns:
| Mod | Used by | Changes |
|---|---|---|
Scenario/Main/GDP-Mod |
Main missions 1, 2, 3, 5, 9, 11 | A zero-cost technology GDP_MOD and ImprovedBy "GDP_MOD" Production 2.0, Science 1.0, Espionage 2.0 on VirtualCity; UseAbsolutePopulationForOccupationTime true. |
Scenario/Main/GDP-Mod-M4, GDP-Mod-M10 |
Main missions 4 and 10 | The same with Production 2.5 and 4.0. |
Scenario/Main/VIP-Mod, VIP-KILL-MOD |
Main mission 6, and missions 7–8 | The GDP-Mod changes plus a VIP unit for the missions' protect / eliminate objectives. |
Scenario/SNARE/SNARE_Mod (ForceLoading) |
SNARE missions 1–5 | Changed units (e.g. the SSBN loadouts), missiles and espionage.txt. |
One mod for several missions, or one each. Several missions can name the same folder. Make a separate
folder when one mission needs other values (as GDP-Mod-M4 does). Keep the folders under the campaign's
own Scenario/<Campaign>/ folder.
ForceLoading. The screen where the player spends the mission's starting points reads the map
without its mod. Add ForceLoading when the starting setup or the point costs use units or technologies
that only the mod defines.
Preparing such a mission in the Cheats build (§7).
Units and technologies that exist only in the mission's mod are available only while the mod is active.
Add the MapSpecificMod line to the map file you start from before you load it. The scenario save keeps
the line (re-add ForceLoading if you need it).
9. Example 1: a single scenario from a saved game¶
A scenario with one objective, made from a position set up in the Cheats build: "Hold Kharkiv" on the Atomic Earth map. The player commands Europe (faction slot 3) and must keep the city of Kharkiv for 30 minutes while Russia (slot 4) attacks. A single scenario is a campaign with one mission, so it appears in the campaign menu like the others.
Step 1: set up the position and save it¶
In the Cheats build, start a single-player game on Atomic Earth as Europe, then:
- Shift + 4 to play Russia. Ctrl + click
Army_Baseand a fewArmy_Divisionin the production panel, and deploy them near the Ukrainian border (hold Ctrl to place them anywhere; divisions are deployed near a base). - Shift + 3 back to Europe. Build and deploy two or three divisions at Kharkiv the same way.
- Hold Shift when you confirm Save. The game writes
world.txtandworld.txt.remap.txtintoDocuments/My Games/ICBM-Escalation/SAVES/SAVEn/(§7).
Step 2: the files¶
The scenario is a mod of its own, a folder in Documents/My Games/ICBM-Escalation/MODS/:
MODS/Hold Kharkiv/info.txt
MODS/Hold Kharkiv/Lang/Eng/UI.lng
MODS/Hold Kharkiv/Scenario/HoldKharkiv.txt <- the campaign file
MODS/Hold Kharkiv/Scenario/HoldKharkiv/HoldKharkiv-1.txt <- world.txt, renamed
MODS/Hold Kharkiv/Scenario/HoldKharkiv/HoldKharkiv-1.txt.remap.txt <- world.txt.remap.txt, renamed
MODS/Hold Kharkiv/Scenario/HoldKharkiv/HoldKharkiv-1/EVENTS/Europe.txt
MODS/Hold Kharkiv/Scenario/HoldKharkiv/HoldKharkiv-1/EVENTS/Russia.txt
info.txt makes the folder a mod (12 §2):
ICBM MOD "Hold Kharkiv"
Description "A single scenario: hold Kharkiv for 30 minutes."
The texts go into the mod's string file. USE PREVIOUS keeps the game's own strings:
// MODS/Hold Kharkiv/Lang/Eng/UI.lng
USE PREVIOUS "Lang/Eng/UI.lng"
9100 LANG "Hold Kharkiv"
9101 LANG "Russian armies mass on the border of Ukraine."
9102 LANG "Russian forces are about to cross into Ukraine. Kharkiv must not fall: hold it for 30 minutes."
9103 LANG "Hold Kharkiv for 30 minutes"
9104 LANG "Kharkiv held. The offensive has stalled."
9105 LANG "Kharkiv has fallen."
9106 LANG "Their armies are moving. Keep Kharkiv in our hands."
Add the same lines to Lang/<language>/UI.lng for every other language you want to support.
Step 3: the campaign file¶
// MODS/Hold Kharkiv/Scenario/HoldKharkiv.txt
SCENARIO
Name ID 9100
Description ID 9101
Faction 3
MAP "Scenario/HoldKharkiv/HoldKharkiv-1.txt"
Faction 3 is Europe's slot: the place of its Player block in the map file, counted from 0.
Step 4: the map file¶
Edit HoldKharkiv-1.txt, the saved world.txt:
- The first two lines become the mission's name and description:
MAP Name ID 9100
Description ID 9101
- Uncomment the
ScenarioInfotemplate (remove the/*and*/around it) and fill it in. One primary mission; noAdvisorPortrait,ProceedToorTransitionFileName, because there is no portrait to show and no next or previous mission:
``` ScenarioInfo BriefingText ID 9102
Primary Mission "Hold Kharkiv" Text ID 9103 Value 1 ProductionPoints 100
ON Success Text ID 9104
ON Failure Text ID 9105
EndGameCountdown 600 ResultFileName "Scenario/HoldKharkiv/HoldKharkiv-1.txt.result" ```
- In the
Playerblocks, point Europe's and Russia'sEvents FromFilelines at their scripts, and delete the line in every otherPlayerblock (a script file that does not exist stops loading):
Events FromFile "Scenario/HoldKharkiv/HoldKharkiv-1/EVENTS/Europe.txt"
Step 5: the event scripts¶
The player's script decides the mission: it fails if Kharkiv is occupied, and succeeds after 30 minutes of game
time. Mission … success does nothing to a mission that has already failed.
// Scenario/HoldKharkiv/HoldKharkiv-1/EVENTS/Europe.txt
FOR PLAYER
Message UI_STRING(9106) Position TopLeft
on Occupied "Kharkiv" BY ENEMY Mission "Hold Kharkiv" fail
on TICK +MINUTES(30) Mission "Hold Kharkiv" success
END
Russia's script starts the war at once and points its invasion at Ukraine:
// Scenario/HoldKharkiv/HoldKharkiv-1/EVENTS/Russia.txt
FOR AI
AttackFaction "Europe"
INVASION "Ukraine"
END
Step 6: check and play¶
Go over the scripts with the pitfalls checklist, then start the
game (the Cheats build, ICBM_CHEATS.exe): Hold Kharkiv is in the campaign menu. A mistake in the map file or a script stops the
loading with a message that names the file and the line. After a win, delete
Documents/My Games/ICBM-Escalation/SCENARIO/HoldKharkiv/ to play it as new.
10. Example 2: a campaign of three missions¶
A campaign, "Border Crisis", on the same map and with the same two factions: three missions, each prepared from
its own scenario save as in Example 1, and chained so that the
player's points and technologies carry over (§5). Its texts are the
strings 9000–9033 of the mod's Lang/Eng/UI.lng.
Folder layout¶
MODS/Border Crisis/info.txt ICBM MOD "Border Crisis"
MODS/Border Crisis/Lang/Eng/UI.lng
MODS/Border Crisis/Scenario/BorderCrisis.txt <- the campaign file
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-1.txt <- mission 1 (+ BorderCrisis-1.txt.remap.txt)
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-2.txt <- mission 2 (+ .remap.txt)
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-3.txt <- mission 3 (+ .remap.txt)
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-N.png <- the missions' pictures (optional)
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-N/EVENTS/Europe.txt
MODS/Border Crisis/Scenario/BorderCrisis/BorderCrisis-N/EVENTS/Russia.txt
The campaign file¶
// Scenario/BorderCrisis.txt
SCENARIO
Name ID 9000
Description ID 9001
Faction 3
MAP "Scenario/BorderCrisis/BorderCrisis-1.txt"
Image "Scenario/BorderCrisis/BorderCrisis-1.png"
MAP "Scenario/BorderCrisis/BorderCrisis-2.txt"
Image "Scenario/BorderCrisis/BorderCrisis-2.png"
MAP "Scenario/BorderCrisis/BorderCrisis-3.txt"
Image "Scenario/BorderCrisis/BorderCrisis-3.png"
The player can start mission 2 once mission 1 is won or skipped, and mission 3 after mission 2.
Mission 1, "Skirmish": a primary and a secondary mission¶
// Scenario/BorderCrisis/BorderCrisis-1.txt (ScenarioInfo block)
ScenarioInfo
BriefingText ID 9010
Primary Mission "Border"
Text ID 9011
Value 1
ProductionPoints 100
Secondary Mission "Recon"
Text ID 9012
Value 1
ProductionPoints 50
ON Success
Text ID 9013
ON Failure
Text ID 9014
EndGameCountdown 600
ResultFileName "Scenario/BorderCrisis/BorderCrisis-1.txt.result"
ProceedTo "Scenario/BorderCrisis/BorderCrisis-2.txt"
// Scenario/BorderCrisis/BorderCrisis-1/EVENTS/Europe.txt
BLOCK StdMessage(int ID)
Message UI_STRING(ID) Position TopLeft
END
FOR PLAYER
on Besieged "Kharkiv" BY ENEMY Mission "Border" fail
on Region_Occupied ANY OF "Russia" BY ME Mission "Border" success
on Destroyed ANY "Over_Horizon_radar" OF ENEMY Mission "Recon" success
ON Mission "Border" FAIL StdMessage(9015)
ON Mission "Border" SUCCESS StdMessage(9016)
END
// Scenario/BorderCrisis/BorderCrisis-1/EVENTS/Russia.txt (the same in mission 2)
FOR AI
AttackFaction "Europe"
INVASION "Ukraine"
END
"Border" fails as soon as Kharkiv is besieged, and succeeds when Europe takes any Russian region. "Recon", the secondary mission, succeeds when the player destroys a Russian over-the-horizon radar. It adds a star and its points; the mission is won or lost by "Border" alone (How a mission ends).
Mission 2, "Escalation": a counted objective¶
Value 3 makes "Airports" a counted mission: three add 1 complete it. "Casualties" fails if the player's losses
pass the limit first, and otherwise succeeds together with "Airports".
// Scenario/BorderCrisis/BorderCrisis-2.txt (ScenarioInfo block)
ScenarioInfo
BriefingText ID 9020
Primary Mission "Airports"
Text ID 9021
Value 3
ProductionPoints 150
Primary Mission "Casualties"
Text ID 9022
Value 1
ProductionPoints 100
ON Success
Text ID 9023
ON Failure
Text ID 9024
EndGameCountdown 900
ResultFileName "Scenario/BorderCrisis/BorderCrisis-2.txt.result"
ProceedTo "Scenario/BorderCrisis/BorderCrisis-3.txt"
TransitionFileName "Scenario/BorderCrisis/BorderCrisis-1.txt.result"
// Scenario/BorderCrisis/BorderCrisis-2/EVENTS/Europe.txt
USE "Scenario/LIB/Common.txt"
BLOCK CheckCasualties()
if (GetFactionCasualties(SelfID) > 200000) // from LIB/Common.txt
Mission "Casualties" fail
end
END
FOR PLAYER
on each Destroyed ANY "Airport" OF ENEMY Mission "Airports" add 1
on each TICK +SECONDS(10) CheckCasualties()
delete when Mission "Airports" SUCCESS
ON Mission "Airports" SUCCESS Mission "Casualties" success
END
TransitionFileName reads mission 1's result: half of its reward is added to this mission's starting points, and
Europe keeps the technologies it had (§5). Europe must be slot 3 in every
mission's map.
Mission 3, "Ceasefire": the last mission¶
The last mission has no ProceedTo. It is won when Russia surrenders or agrees to a ceasefire.
// Scenario/BorderCrisis/BorderCrisis-3.txt (ScenarioInfo block)
ScenarioInfo
BriefingText ID 9030
Primary Mission "Peace"
Text ID 9031
Value 1
ProductionPoints 200
ON Success
Text ID 9032
ON Failure
Text ID 9033
EndGameCountdown 300
ResultFileName "Scenario/BorderCrisis/BorderCrisis-3.txt.result"
TransitionFileName "Scenario/BorderCrisis/BorderCrisis-2.txt.result"
// Scenario/BorderCrisis/BorderCrisis-3/EVENTS/Europe.txt
FOR PLAYER
ON Surrendered "Russia" Mission "Peace" success
ON Ceasefire BETWEEN ME AND "Russia" Mission "Peace" success
ON Occupied "Kharkiv" BY ENEMY Mission "Peace" fail
END
// Scenario/BorderCrisis/BorderCrisis-3/EVENTS/Russia.txt
FOR AI
AttackFaction "Europe"
on Population less 40 Ceasefire With "Europe"
END
Russia stops the war once it has lost 60 % of its population, and the ceasefire wins the last mission. A finale
can instead show up to three closing screens with ON FinalSuccess and Mission … FINAL_SUCCESS
(§3).
11. Example 3: a mission with its own units and rules¶
The Hold Kharkiv scenario of Example 1 in winter: mud slows every army, and a war economy raises the cities' production by half. These changes belong to this mission only, so they go into a mission-specific mod that the map file names.
The mod's files¶
MODS/Hold Kharkiv/Scenario/HoldKharkiv/WinterMod/info.txt
MODS/Hold Kharkiv/Scenario/HoldKharkiv/WinterMod/Tech.txt
MODS/Hold Kharkiv/Scenario/HoldKharkiv/WinterMod/Units/Units.txt
// WinterMod/info.txt
ICBM MOD "Hold Kharkiv Winter"
Description "Mission data of Hold Kharkiv: winter mud and a war economy."
A technology with no cost and no parents is known to every faction from the start, so a modifier attached to it applies to everyone at once (09 §13):
// WinterMod/Tech.txt
USE PREVIOUS "tech.txt"
[TECHNOLOGY] "HK_WAR_ECONOMY"
Name "HK_WAR_ECONOMY"
Description "HK_WAR_ECONOMY"
[END]
Each state of a unit is a unit type of its own, so a division's speed is changed in both of its moving states,
Army_Division and Army_Mobile_Mode (30 and 50 km/h in the game's data):
// WinterMod/Units/Units.txt
USE PREVIOUS "Units/units.txt"
[UNIT] "Army_Division" MODIFY
Speed 20
[UNIT] "Army_Mobile_Mode" MODIFY
Speed 30
[UNIT] "VirtualCity" MODIFY
ImprovedBy "HK_WAR_ECONOMY" Production 1.5
[END]
USE PREVIOUS and MODIFY change only what is written and keep everything else
(00 §3). Any other data file can be changed the same way: missiles,
technologies, explosions, AI files, espionage.txt.
The map file¶
Add the MapSpecificMod line to HoldKharkiv-1.txt after Restrictions:
MAP Name ID 9100
Description ID 9101
Restrictions …
MapSpecificMod "Scenario/HoldKharkiv/WinterMod"
The mod is on while this mission is played, and off in every other game. Nothing else changes: the campaign file,
the ScenarioInfo block and the scripts stay as in Example 1. The mod only modifies units that the saved position
already has, so it needs no ForceLoading. A mission whose starting units or technologies exist only in its mod
needs ForceLoading, and the mod line must be in the map you start from when you prepare the position
(§8).
Check the data files by starting the mission in the Cheats build (ICBM_CHEATS.exe): a mistake stops the loading with
a message, and warnings go to Fatal.txt.