![Table of contents [*]](/skins/2/images/wiki_toc.png)
scenario.chk format
CHK FileThe scenario.chk file contains all the map data. This includes strings, units, triggers, doodads, mission briefings, terrain, fog of war, etc.; anything except the physical .wav files. It is stored inside an MPQ file with the .scx or .scm file extension, along with any .wav files included in the scenario.FormatThe scenario.chk file consists of "chunks," or "sections." Each section contains a particular group of data describing the scenario. For example, there is a separate section for strings, mission briefings, triggers, units, unit settings, etc.Section HeadersEach section starts off with a 4 byte string, and a 4 byte unsigned long.The string indicates which section it is. For instance, the mission briefing section has "MBRF", the trigger section has "TRIG", etc. The 4 byte unsigned long indicates how many bytes the section contains, not including the header itself. After this 8 byte header, the rest of the section follows. Section order does not matter. The sections are only listed the way they are written by the original Campaign Editor. "TYPE" SectionRequired for all game types (hybrid, broodwar)Not required for StarCraft This section specifies the type of scenario.
"VER " SectionRequired for all game types (vanilla, hybrid, broodwar)This section identifies the file format version.
"IVER" SectionNot required (vanilla, hybrid, broodwar)This section "additionally identifies" the map version.
"IVE2" SectionNot required (hybrid, broodwar)This section "additionally identifies" the map version.
"VCOD" SectionRequired for all game types. (vanilla, hybrid, broodwar)This section has a verification code to make sure this is actually a CHK file.
SC probably calculates the CRC of the VCOD sections and compares it with a hardcoded CRC (?). Thus if two VCOD sequences output the same CRC SC won't notice it. "IOWN" SectionNot required (vanilla, hybrid, broodwar)This section specifies the owner of each player.
"OWNR" SectionRequired for all game types (vanilla, hybrid, broodwar)This section designates the controller of a particular player. It is exactly the same as the "IOWN" section, except there is an additional value (0x00 for Unused).
"ERA " SectionRequired for all game types (vanilla, hybrid, broodwar)This section indicates the tileset of the scenario.
Desert, Arctic, and Twilight are Brood War-only tilesets. "DIM " SectionRequired for all game types (vanilla, hybrid, broodwar)This section contains the dimensions of the map.
Standard Dimensions are 64, 96, 128, 192, 256 "SIDE" SectionRequired for all game types (vanilla, hybrid, broodwar)This section contains the species/race of each player.
"MTXM" SectionRequired for all game types (vanilla, hybrid, broodwar)Note: Required for all game types, all versions. Terrain section that contains a map of the level's appearance. StarEdit disregards this section; it is only used in Starcraft.
Tiles in this section are listed from left to right, top to bottom. The values for each integer are their respective "MegaTile" values in the scenario's tileset. If the size of this section is greater than width*height*2, the data following is ignored. If the size of this section is less, the resulting tiles that have not been defined will be null tiles. This section includes doodads as terrain; TILE, which is otherwise identical, doesn't. Out of the terrain sections (TILE, ISOM, and MTXM), SC only reads MTXM for the sake of not having to generate this data on-the-fly: it contains the exact representation of the level's appearance, including doodads. TILE, on the other hand, is directly tied via a tile lookup function to ISOM, and exists for the sake of not having to generate tiles from ISOM on-the-fly in StarEdit. "PUNI" SectionRequired for Use Map Settings game type (vanilla, hybrid, broodwar)This section contains player unit restrictions: it indicates whether the player can or cannot build a particular unit.
"UPGR" SectionRequired for the Use Map Settings game type in vanilla maps or hybrid maps when run in vanilla mode (vanilla, hybrid)This section contains player upgrade restrictions: it indicates the starting/maximum levels at/to which a player can perform a particular upgrade.
"PTEC" SectionRequired for the Use Map Settings game type in vanilla maps or hybrid maps when run in vanilla mode (vanilla, hybrid)This section contains player technology availability restrictions: it indicates whether a player starts off with a particular technology or can research a particular technology.
"UNIT" SectionRequired for all game types (vanilla, hybrid, broodwar)This section contains all the pre-placed units on the map and their properties. Each unit on the map gets the following structure:
The "type of relation to another building" field is not fully discovered yet: please edit if you know more information. Also, please edit if you could confirm the bit values to be correct/if you know more bit values. Default values will apply if bit values are unchecked. Defaults: 100% HP, 100% SP, 100% EP, 0 resources, 0 hangar count. "ISOM" SectionNot required (vanilla, hybrid, broodwar)This section is required to place isometric terrain on the map. It provides data about the nature of the isometrical "diamonds" (the editing mode of StarEdit).
If you have additional research, post on the forums about it and/or edit this section. "TILE" SectionNot required (vanilla, hybrid, broodwar)This section will only be different from the MTXM section in tiles where doodads are present.
"DD2 " SectionNot required by StarCraftThis section contains the doodad map of the level. There are several parts to doodads. The graphical portion is stored in the ?MTXM? section. The second part of the doodad is stored in this section. This section seems to be only used by the map editor. Each doodad in the map gets the following structure
"THG2" SectionNote: Required for All game types, all versionsThe map editor only writes to this section. Starcraft uses this section. Certain doodads with sprites get the following structure.
"MASK" SectionNote: Not required for Melee game type.This section contains the data on fog of war for each player. This is whether at the start of the game that levels of black space that is available.
Note: Any size greator than width*height will be ignored. Any size less will default missing tiles to 0xFF "STR " SectionNote: Required for Melee game typeThis section contains all the strings in the map. Note: This section can contain more then 1024 strings and will work in Starcraft
"UPRP" SectionNote: This section is not required for melee.This section is used whenever the create units with properties trigger is used. Since a slot has to be assigned to the action, this is where each slot is designated. There are 64 of the following structures regardless of how many are used and it cannot exceed 64.
"UPUS" SectionNote: This section is not required for melee.This section goes along with the "UPRP" section. This section just indicates which of the 64 unit properties slot is used.
"MRGN" SectionNote: This section is required for all game types, all versions.This section contains all the locations that the map uses. In a scenario that is not Brood War, this section contains 64 locations. In a Brood War map, this section will expand to contain 255 locations. This section can be a size of 0 in melee. Each location gets one of the following location entries. The 'Anywhere' location, is ALWAYS location 64.
"TRIG" SectionNOTE: This section is required for the UMS game type. This section may be split.This section contains all the triggers in the map. This along with MBRF is the most complicated section in the entire scenario.chk file. There is too much data packed into too little of a space. Refer to the appendix at the bottom of this page for more information. For easy reference, since each trigger contains 2400 bytes, the amount of triggers can be gotten by taking the section length and dividing by 2400. Every single trigger in the map will have the following format: 16 Conditions Every trigger has 16 of the following format, even if only one condition is used. See the appendix for information on which items are used for what conditions.
Immediately following the 16 conditions, there are 64 actions. There will always be 64 of the following structure, even if some of them are unused.
Following the 16 conditions and 64 actions, every trigger also has this structure
"MBRF" SectionThis section contains all of the mission briefings shown by the players.This section has the exact same format as the "TRIG" section, except for the conditions. In this section the 16 conditions are still there, they are all null except for the very first condition, which only has a condition byte of 13. See appendix for the action bytes for the mission briefings. "SPRP" SectionThis section decides which strings are the scenario properties.
Note: A string index of 0 for the map name will default it to its file name. "FORC" SectionNote: Required for Melee game type (size may be 0), full size required for UMS mapsThis section specifies the forces and the information about them.
"WAV " SectionNot required by StarCraftThere are 1024 wav entires regardless of how many are actually used. Note: This section is not required and is often left out.
"UNIS" SectionNote: This section is overridden with "UNIx" when the scenario is Brood War. Not required for melee.This section contains the unit settings for the level.
"UPGS" SectionNote: This section is overridden with "UPGx" when the scenario is Brood War. Not required for melee.This section contains upgrade settings.
"TECS" SectionNote: This section is overridden with "TECx" when the scenario is Brood War. Not required for melee.This section contains technology/special abilities settings
"SWNM" SectionNot required by StarCraftThis section contains the strings used for each switch. There are 256 switches, and can't be any more or any less.
"COLR" SectionNote: Required for Melee game type (only on Brood War)Note: This section only has effect on Brood War This section indicates what color each player is.
"PUPx" SectionNote: This section overrides the "UPGR" when the scenario is Brood War.This section is identical to UPGR section except it uses the Brood War set of 61 upgrades instead of the original 46 "PTEx" SectionNote: This section overrides the "PTEC" when the scenario is Brood War.This section is identical to PTEC section except it uses the Brood War set of 44 technologies instead of the original 24 "UNIx" SectionNote: This section overrides the "UNIS" when the scenario is Brood War.This section is indentical to UNIS section except it uses the Brood War set of 130 weapons instead of the original 100 "UPGx" SectionNote: This section overrides the "UPGS" when the scenario is Brood War.This section is pretty much the same as UPGS except for two differences:
"TECx" SectionNote: This section overrides the "TECS" when the scenario is Brood War.This section is indentical to UNIS section except it uses the Brood War set of 44 technologies instead of the original 24 AppendixA set of references and IDs that should help you easier in the trigger section and the technology/player ids, etc:Trigger Conditions ListCode0 = No Condition 1 = Countdown Timer(Comparison, QNumber) 2 = Command(Player, Comparison, TUnit, QNumber) 3 = Bring(Player, Comparison, TUnit, Loc, QNumber) 4 = Accumulate(Player, Comparison, QNumber, ResType) 5 = Kill(Player, Comparison, TUnit, QNumber) 6 = Command the Most(TUnit) 7 = Commands the Most At(TUnit, Loc) 8 = Most Kills(TUnit) 9 = Highest Score(Score) 10 = Most Resources(ResType) 11 = Switch(Switch) 12 = Elapsed Time(Comparison, QNumber) 13 = Data is a Mission Briefing. Conditions are N/A (Same as Never) 14 = Opponents(Player, Comparison, QNumber) 15 = Deaths(Player, Comparison, TUnit, QNumber) 16 = Command the Least(TUnit) 17 = Command the Least At(TUnit, Loc) 18 = Least Kills(TUnit) 19 = Lowest Score(Score) 20 = Least Resources(ResType) 21 = Score(Player, Comparison, Score, QNumber) 22 = Always (Same as No Condition) 23 = Never Trigger Actions ListCode0 = No Action 1 = Victory 2 = Defeat 3 = Preserve Trigger 4 = Wait(Time) 5 = Pause Game (Single player only) 6 = Unpause Game (Single player only) 7 = Transmission(Text, Unit, Loc, Time, Modifier, Wave, WavTime) 8 = Play WAV(Wav, WavTime) 9 = Display Text Message(Text) 10 = Center View(Loc) 11 = Create Unit with Properties(Player, Unit, Number, Loc, UnitProp) 12 = Set Mission Objectives(Text) 13 = Set Switch(Switch, SwAction) 14 = Set Countdown Timer(Time, Modifier) 15 = Run AI Script(AIScript) 16 = Run AI Script At Location(AIScript) 17 = Leader Board (Control) (Text, TUnit) 18 = Leader Board (Control At Location) (Text, TUnit, Loc) 19 = Leader Board (Resources) (Text, ResType) 20 = Leader Board (Kills) (Text, TUnit) 21 = Leader Board (Points) (Text, Score) 22 = Kill Unit (Player, TUnit) 23 = Kill Unit At Location(Player, TUnit, Number, Loc) 24 = Remove Unit(Player, TUnit) 25 = Remove Unit At Location(Player, TUnit, Number, Loc) 26 = Set Resources(Player, Number, Modifier, ResType) 27 = Set Score(Player, Number, Modifier, Score) 28 = Minimap Ping(Loc) 29 = Talking Portrait(Unit, Time) 30 = Mute Unit Speech 31 = Unmute Unit Speech 32 = Leaderboard Computer Players(State) 33 = Leaderboard Goal (Control) (Text, TUnit, Number) 34 = Leaderboard Goal (Control At Location) (Text, TUnit, Number, Loc) 35 = Leaderboard Goal (Resources) (Text, TUnit, Number, ResType) 36 = Leaderboard Goal (Kills) (Text, TUnit, Number) 37 = Leaderboard Goal (Points) (Text, Number, Score) 38 = Move Location(Player, TUnit, SLoc, DLoc) 39 = Move Unit(Player, TUnit, Number, SLoc, DLoc) 40 = Leaderboard (Greed) (Number) 41 = Set Next Scenario(Text) (Single player only) 42 = Set Doodad State(Player, TUnit, Loc, State) 43 = Set Invincibility(Player, TUnit, Loc, State) 44 = Create Unit(Player, Unit, Number, Loc) 45 = Set Deaths(Player, TUnit, Number, Modifier) 46 = Order(Player, TUnit, SLoc, DLoc, Order) 47 = Comment(Text) 48 = Give Units to Player(SPlayer, DPlayer, TUnit, Number, Loc) 49 = Modify Unit Hit Points(Player, TUnit, Number, ModAmount, Loc) 50 = Modify Unit Energy(Player, TUnit, Number, ModAmount, Loc) 51 = Modify Unit Shield Points(Player, TUnit, Number, ModAmount, Loc) 52 = Modify Unit Resource Amount(Player, Number, ModAmount, Loc) 53 = Modify Unit Hanger Count(Player, TUnit, Number, ModAmount, Loc) 54 = Pause Timer 55 = Unpause Timer 56 = Draw 57 = Set Alliance Status(Player, AllyStatus) 58 = Disable Debug Mode (Single player only) 59 = Enable Debug Mode (Single player only) Mission Briefing Actions ListCode0 - No Action 1 - Wait(Time) 2 - Play WAV(Wave, WavTime) 3 - Text Message(Text, Time) 4 - Mission Objectives(Text) 5 - Show Portrait(Unit, Slot) 6 - Hide Portrait(Slot) 7 - Display Speaking Portrait(Slot, Time) 8 - Transmission(Text, Slot, Time, Modifier, Wave, WavTime) 9 - Skip Tutorial Enabled Switch StatesCode2 = Switch is set 3 = Switch is cleared Numeric ComparisonsCode0 = At least 1 = At most 10 = Exactly Score TypesCode0 = Total 1 = Units 2 = Buildings 3 = Units and Buildings 4 = Kills 5 = Razings 6 = Kills and Razings 7 = Custom Resource TypesCode0 = Ore 1 = Gas 2 = Ore and Gas Alliance StatusesCode0 = Enemy 1 = Ally 2 = Allied Victory Unit OrdersCode0 = Move 1 = Patrol 2 = Attack Action StatesCode4 = Enabled/Set switch 5 = Disabled/Clear switch 6 = Toggle/Toggle switch 11 = Randomize switch Number ModifiersCode7 = Set to 8 = Add 9 = Subtract Trigger Unit TypesCodeAll normal units (0-227) 228 = None 229 = Any unit 230 = Men 231 = Buildings 232 = Factories List of Players/Group IDsCode0 = Player 1 1 = Player 2 2 = Player 3 3 = Player 4 4 = Player 5 5 = Player 6 6 = Player 7 7 = Player 8 8 = Player 9 9 = Player 10 10 = Player 11 11 = Player 12 12 = None (Unused, One-entry Overflow in some cases) 13 = Current Player 14 = Foes 15 = Allies 16 = Neutral Players 17 = All Players 18 = Force 1 19 = Force 2 20 = Force 3 21 = Force 4 22 = Unused 1 23 = Unused 2 24 = Unused 3 25 = Unused 4 26 = Non Allied Victory Players List of Technology IDsCode0 = Stim Packs 1 = Lockdown 2 = EMP Shockwave 3 = Spider Mines 4 = Scanner Sweep 5 = Siege Mode 6 = Defensive Matrix 7 = Irradiate 8 = Yamato Gun 9 = Cloaking Field 10 = Personnel Cloaking 11 = Burrowing 12 = Infestation 13 = Spawn Broodling 14 = Dark Swarm 15 = Plague 16 = Consume 17 = Ensnare 18 = Parasite 19 = Psionic Storm 20 = Hallucination 21 = Recall 22 = Stasis Field 23 = Archon Warp 24 = Restoration 25 = Disruption Web 26 = Unused 26 27 = Mind Control 28 = Dark Archon Meld 29 = Feedback 30 = Optical Flare 31 = Maelstorm 32 = Lurker Aspect 33 = Unused 33 34 = Healing 35 = Unused 35 36 = Unused 36 37 = Unused 37 38 = Unused 38 39 = Unused 39 40 = Unused 40 41 = Unused 41 42 = Unused 42 43 = Unused 43 List of Unit Weapon IDsCode0 = Gauss Rifle (Normal) 1 = Gauss Rifle (Jim Raynor-Marine) 2 = C-10 Concussion Rifle (Normal) 3 = C-10 Concussion Rifle (Sarah Kerrigan) 4 = Fragmentation Grenade (Normal) 5 = Fragmentation Grenade (Jim Raynor-Vulture) 6 = Spider Mines 7 = Twin Autocannons (Normal) 8 = Hellfire Missile Pack (Normal) 9 = Twin Autocannons (Alan Schezar) 10 = Hellfire Missile Pack (Alan Schezar) 11 = Arclite Cannon (Normal) 12 = Arclite Cannon (Edmund Duke) 13 = Fusion Cutter 14 = Fusion Cutter (Harvest) 15 = Gemini Missiles (Normal) 16 = Burst Lasers (Normal) 17 = Gemini Missiles (Tom Kazansky) 18 = Burst Lasers (Tom Kazansky) 19 = ATS Laser Battery (Normal) 20 = ATA Laser Battery (Normal) 21 = ATS Laser Battery (Norad II+Mengsk+DuGalle) 22 = ATA Laser Battery (Norad II+Mengsk+DuGalle) 23 = ATS Laser Battery (Hyperion) 24 = ATA Laser Battery (Hyperion) 25 = Flame Thrower (Normal) 26 = Flame Thrower (Gui Montag) 27 = Arclite Shock Cannon (Normal) 28 = Arclite Shock Cannon (Edmund Duke) 29 = Longbolt Missiles 30 = Yamato Gun 31 = Nuclear Missile 32 = Lockdown 33 = EMP Shockwave 34 = Irradiate 35 = Claws (Normal) 36 = Claws (Devouring One) 37 = Claws (Infested Kerrigan) 38 = Needle Spines (Normal) 39 = Needle Spines (Hunter Killer) 40 = Kaiser Blades (Normal) 41 = Kaiser Blades (Torrasque) 42 = Toxic Spores (Broodling) 43 = Spines 44 = Spines (Harvest) 45 = Acid Spray (Unused) 46 = Acid Spore (Normal) 47 = Acid Spore (Kukulza-Guardian) 48 = Glave Wurm (Normal) 49 = Glave Wurm (Kukulza-Mutalisk) 50 = Venom (Unused-Defiler) 51 = Venom (Unused-Defiler Hero) 52 = Seeker Spores 53 = Subterranean Tentacle 54 = Suicide (Infested Terran) 55 = Suicide (Scourge) 56 = Parasite 57 = Spawn Broodlings 58 = Ensnare 59 = Dark Swarm 60 = Plague 61 = Consume 62 = Particle Beam 63 = Particle Beam (Harvest) 64 = Psi Blades (Normal) 65 = Psi Blades (Fenix-Zealot) 66 = Phase Disruptor (Normal) 67 = Phase Disruptor (Fenix-Dragoon) 68 = Psi Assault (Normal-Unused) 69 = Psi Assault (Tassadar+Aldaris) 70 = Psionic Shockwave (Normal) 71 = Psionic Shockwave (Tassadar/Zeratul Archon) 72 = Unknown72 73 = Dual Photon Blasters (Normal) 74 = Anti-matter Missiles (Normal) 75 = Dual Photon Blasters (Mojo) 76 = Anit-matter Missiles (Mojo) 77 = Phase Disruptor Cannon (Normal) 78 = Phase Disruptor Cannon (Danimoth) 79 = Pulse Cannon 80 = STS Photon Cannon 81 = STA Photon Cannon 82 = Scarab 83 = Stasis Field 84 = Psi Storm 85 = Warp Blades (Zeratul) 86 = Warp Blades (Dark Templar Hero) 87 = Missiles (Unused) 88 = Laser Battery1 (Unused) 89 = Tormentor Missiles (Unused) 90 = Bombs (Unused) 91 = Raider Gun (Unused) 92 = Laser Battery2 (Unused) 93 = Laser Battery3 (Unused) 94 = Dual Photon Blasters (Unused) 95 = Flechette Grenade (Unused) 96 = Twin Autocannons (Floor Trap) 97 = Hellfire Missile Pack (Wall Trap) 98 = Flame Thrower (Wall Trap) 99 = Hellfire Missile Pack (Floor Trap) 100 = Neutron Flare 101 = Disruption Web 102 = Restoration 103 = Halo Rockets 104 = Corrosive Acid 105 = Mind Control 106 = Feedback 107 = Optical Flare 108 = Maelstrom 109 = Subterranean Spines 110 = Gauss Rifle0 (Unused) 111 = Warp Blades (Normal) 112 = C-10 Concussion Rifle (Samir Duran) 113 = C-10 Concussion Rifle (Infested Duran) 114 = Dual Photon Blasters (Artanis) 115 = Anti-matter Missiles (Artanis) 116 = C-10 Concussion Rifle (Alexei Stukov) 117 = Gauss Rifle1 (Unused) 118 = Gauss Rifle2 (Unused) 119 = Gauss Rifle3 (Unused) 120 = Gauss Rifle4 (Unused) 121 = Gauss Rifle5 (Unused) 122 = Gauss Rifle6 (Unused) 123 = Gauss Rifle7 (Unused) 124 = Gauss Rifle8 (Unused) 125 = Gauss Rifle9 (Unused) 126 = Gauss Rifle10 (Unused) 127 = Gauss Rifle11 (Unused) 128 = Gauss Rifle12 (Unused) 129 = Gauss Rifle13 (Unused) 130 = None Complete Modifier ListCode0 = Condition: >= (greater than or equal to)
1 = Condition: <= (less than or equal to) 2 = Condition: == TRUE (Is True) 3 = Condition: == FALSE (Is False) 4 = Action: = TRUE (Set to True) 5 = Action: = FALSE (Set to False) 6 = Action: NOT (toggle) 7 = Action: = (Set to) 8 = Action: += (Add) 9 = Action: -= (Subtract) 10 = Condition: == (Exactly) 11 = Action: Randomize |