SCRMaps
/
Sign in

Why there is a rock floating above it

An iscript header's length depends on its type. Read a slot that is not there and script bytes get used as an animation address - and that rock is where it ends.

11 min read

An iscript header is simple: the four letters SCPE, one type number, then animation addresses two bytes each. There are 28 animations in all and their order is fixed - slot 0 Init, slot 1 Death, slot 2 ground attack start, slot 3 air attack start, ... slot 24 Disable, slot 27 Enable.

But not every script carries all 28. What the type decides is how many of the list it holds, counting from the front. Counted directly out of the installed game's iscript.bin:

칸 수 = (타입 + 1)을 짝수로 올림

slots = (type + 1) rounded up to an even number
It is a rule rather than a table: the type is the last slot index, and the length is padded to an even number.
The types that actually occur
0, 12 - Init and Death only.
24.
12, 1314. The Marine is here.
14, 1516.
20, 2122.
2324.
2426.
26, 2728 - all of them.

The rule checks out against the installed iscript.bin two ways: the computed length never exceeds the gap to the next header, and in almost every header some slot points exactly at the computed end, which is where the first script begins.

Two wrong tables circulate. The old BWAPI-era one says type 1 has 4 slots; it has 2. The other comes from measuring only "slot 0 points just past the header" and gets type 23 wrong at 26, because in a type-23 header it is slot 23, not slot 0, that sits immediately after it.

And here is the problem. Disable is slot 24. A Marine has 14 slots, so slot 24 points outside the header, into the middle of the script body - and StarCraft does not read that as "no animation". It jumps there.

Where it jumps is a property of that build's iscript.bin layout, and it moves between patches. The 1.16.1-era write-ups say a Marine lands on 0x0E80, the Ensnare overlay. Measured against the installed Remastered copy, the Marine's slot-24 position reads 06 3f = address 16134 - bytes belonging to a waitrand inside the Marine's own death script - and what plays there is a four-frame loop belonging to something else entirely.

So "a disabled Marine spins" is not a fact to write down. The bug is the same and only the landing changes. The rule is "do not do it", not "expect this".

A slot that reads as zero is worse. StarCraft does not treat address 0 as "none" either - it starts executing there. But address 0 does not contain a make-a-rock instruction. Open the file and the story is a little different.

What is actually at iscript.bin offset 0
0A 2-byte pointer to the entry table. Not code.
2 ~ 13671,366 zero bytes of padding. Read as code that is 457 x playfram 0, and not one of them is a wait, so they all pass in a single tick.
1372The next entry's header begins: the four letters SCPE.
1376That header's type field. Its value is 15 - and opcode 0x0F is sprol.
1377 ~ 1380The rest of the type field and the first animation pointer, which become sprol's arguments: sprite 0, and 0x84 = 132.

So the rock is not an instruction written at address 0; it is a header being misread as code. And sprite 0 is thingy\tileset\AshWorld\rock01.grp - an Ashworld terrain doodad. That is why the dolmen looks like it wandered in from another map.

Before Remastered this path usually just crashed, because the script runs an engine-only command on something that is not an engine. In Remastered it does not crash: the unit's graphics disappear and the rock is left. The symptom changed, the cause did not.

There is one common way into this in practice: using the Set Doodad State trigger on a unit that is not a doodad. Disable plays the Disable animation, Enable plays Enable and only works if it is already disabled - and if that unit's header has no slot 24, everything above happens.

So the rule is two lines. Do not use Set Doodad State on a unit that is not a doodad. And before reading or pointing at an animation slot, check that the type holds that slot at all - a slot that is not there is not empty, it is something else.

Every animation slotMaking any unit cast a spell