SCRMaps
/
Sign in

What is inside a .scx

A .scx is an archive holding one file, that file is a list of named chunks, and each chunk is one of the editor's tabs.

9 min read

Take one map file apart and most of what follows explains itself - why too much text stops a map compiling, why an EUD map requires Remastered, why a compiled map's trigger list is empty.

A .scx is an MPQ archive. Only one file inside it matters and it is called staredit\scenario.chk; any sounds or graphics you imported sit in the same archive beside it.

The chk is nothing but a run of four-byte names, each with a four-byte size and its contents. Here is a real one taken apart - a 128x128 jungle map, not yet compiled.

VER      2     205 = 브룩워 / Brood War
ERA      2     4 = 정글 / jungle
DIM      4     128 x 128
MTXM 32,768     128*128*2 — 실제 타일 지도 / the actual tile map
TILE 32,768
ISOM 67,080     에디터의 지형 표현 / the editor's own terrain data
UNIT  1,008     36바이트 x 28개 배치 유닛 / 36 bytes x 28 placed units
PUNI  5,700     유닛 사용 가능 여부 / unit availability
UNIx  4,168     유닛 설정 / unit settings
MRGN  5,100     20바이트 x 255개 로케이션 / 20 bytes x 255 locations
STR   6,985     모든 글자 / every string in the map
UPRP  1,280     20바이트 x 64 CUWP 칸 / 20 bytes x 64 property slots
TRIG      0     아직 트리거가 없음 / no triggers yet
SWNM  1,024     4바이트 x 256 스위치 이름 / 4 bytes x 256 switch names
Every size works out exactly. The table-shaped sections are fixed, so the size alone tells you how many slots are in there.
What the sizes tell you
MRGN 5,10020 x 255. There are 255 locations and no more, and number 64 is Anywhere.
UPRP 1,28020 x 64. There are 64 Create Unit with Properties slots.
PUNI 5,70012x228 + 228 + 12x228: per-player availability, then global, then whether each player follows the global.
MTXM 32,768Two bytes a tile, so this is a 128 x 128 map.
SWNM 1,0244 x 256 - there are 256 switches.

ISOM standing at twice the size of the actual tile map is worth noticing. The game never reads it: it is the editor's own record of how the terrain was painted. A map with a broken ISOM runs perfectly and misbehaves only in the editor.

The section that matters most here is STR. Every piece of text in the map - its name, the force names, the location names, every line in every trigger - lives in that one section.

A STR entry's offset is two bytes, so the section cannot exceed 65,535 bytes. Past that the editor switches to STRx, whose offsets are four bytes and which only Remastered can read. A Korean syllable is three bytes in UTF-8, so a text-heavy Korean map reaches that line first.

And this is where an EUD map's code goes. The STR section is loaded whole and its address can be discovered at run time, so eudplib writes all of its trigger bytecode into it. That is why a compiled EUD map has a nearly empty TRIG and a STR or STRx of tens of megabytes.

Everything is a triggerWhen the Korean breaks
Sign in to track your progress