SCRMaps
/
Sign in

iscript opcodes

Every opcode in StarCraft's unit animation scripts, 0x00 to 0x44.

Explained in: Making any unit cast a spell

This is 2020 Brood War era material. The source itself states that the behaviour was never verified in game for this project, so test it on Remastered before relying on it.

The source's own unknown, hypothesised and crashes wording is preserved verbatim, including unnamed entries such as __0c and __2d.

playfram 0x00params: <frame#> — displays a particular frame, adjusted for direction.
playframtile 0x01params: <frame#> — displays a particular frame dependent on tileset.
sethorpos 0x02params: <x> — sets the current horizontal offset of the current image overlay.
setvertpos 0x03params: <y> — sets the vertical position of an image overlay.
setpos 0x04params: <x> <y> — sets the current horizontal and vertical position of the current image overlay.
wait 0x05params: <#ticks> — pauses script execution for a specific number of ticks.
waitrand 0x06params: <#ticks1> <#ticks2> — pauses script execution for a random number of ticks given two possible wait times.
goto 0x07params: <labelname> — unconditionally jumps to a specific code block.
imgol 0x08params: <image#> <x> <y> — displays an active image overlay at an animation level higher than the current image overlay at a specified offset position.
imgul 0x09params: <image#> <x> <y> — displays an active image overlay at an animation level lower than the current image overlay at a specified offset position.
imgolorig 0x0aparams: <image#> — displays an active image overlay at an animation level higher than the current image overlay at the relative origin offset position.
switchul 0x0bparams: <image#> — only for powerups. Hypothesised to replace the image overlay that was first created by the current image overlay.
__0c 0x0cparams: no parameters — unknown.
imgoluselo 0x0dparams: <image#> <x> <y> — displays an active image overlay at an animation level higher than the current image overlay, using a LO* file to determine the offset position.
imguluselo 0x0eparams: <image#> <x> <y> — displays an active image overlay at an animation level lower than the current image overlay, using a LO* file to determine the offset position.
sprol 0x0fparams: <sprite#> <x> <y> — spawns a sprite one animation level above the current image overlay at a specific offset position.
highsprol 0x10params: <sprite#> <x> <y> — spawns a sprite at the highest animation level at a specific offset position.
lowsprul 0x11params: <sprite#> <x> <y> — spawns a sprite at the lowest animation level at a specific offset position.
uflunstable 0x12params: <flingy# — creates an flingy with restrictions; supposedly crashes in most cases.
spruluselo 0x13params: <sprite#> <x> <y> — spawns a sprite one animation level below the current image overlay at a specific offset position. The new sprite inherits the direction of the current sprite. Requires LO* file for unknown reason.
sprul 0x14params: <sprite#> <x> <y> — spawns a sprite one animation level below the current image overlay at a specific offset position. The new sprite inherits the direction of the current sprite.
sproluselo 0x15params: <sprite#> <overlay#> — spawns a sprite one animation level above the current image overlay, using a specified LO* file for the offset position information. The new sprite inherits the direction of the current sprite.
end 0x16params: no parameters — destroys the current active image overlay, also removing the current sprite if the image overlay is the last in one in the current sprite.
setflipstate 0x17params: <flipstate> — sets flip state of the current image overlay.
playsnd 0x18params: <sound#> — plays a sound.
playsndrand 0x19params: <#sounds> <sound#> <...> — plays a random sound from a list.
playsndbtwn 0x1aparams: <firstsound#> <lastsound#> — plays a random sound between two inclusive sfxdata.dat entry IDs.
domissiledmg 0x1bparams: no parameters — causes the damage of a weapon flingy to be applied according to its weapons.dat entry.
attackmelee 0x1cparams: <#sounds> <sound#> <...> — applies damage to target without creating a flingy and plays a sound.
followmaingraphic 0x1dparams: no parameters — causes the current image overlay to display the same frame as the parent image overlay.
randcondjmp 0x1eparams: <randchance#> <labelname> — random jump, chance of performing jump depends on the parameter.
turnccwise 0x1fparams: <turnamount> — turns the flingy counterclockwise by a particular amount.
turncwise 0x20params: <turnamount> — turns the flingy clockwise by a particular amount.
turn1cwise 0x21params: no parameters — turns the flingy clockwise by one direction unit.
turnrand 0x22params: <turnamount> — turns the flingy a specified amount in a random direction, with a heavy bias towards turning clockwise.
setspawnframe 0x23params: <direction> — in specific situations, performs a natural rotation to the given direction.
sigorder 0x24params: <signal#> — allows the current unit's order to proceed if it has paused for an animation to be completed.
attackwith 0x25params: <ground = 1, air = 2> — attack with either the ground or air weapon depending on a parameter.
attack 0x26params: no parameters — attack with either the ground or air weapon depending on target.
castspell 0x27params: no parameters — identifies when a spell should be cast in a spellcasting animation. The spell is determined by the unit's current order.
useweapon 0x28params: <weapon#> — makes the unit use a specific weapons.dat ID on its target.
move 0x29params: <movedistance> — sets the unit to move forward a certain number of pixels at the end of the current tick.
gotorepeatattk 0x2aparams: no parameters — signals to StarCraft that after this point, when the unit's cooldown time is over, the repeat attack animation can be called.
engframe 0x2bparams: <frame#> — plays a particular frame, often used in engine glow animations.
engset 0x2cparams: <frameset#> — plays a particular frame set, often used in engine glow animations.
__2d 0x2dparams: no parameters — hypothesised to hide the current image overlay until the next animation.
nobrkcodestart 0x2eparams: no parameters — holds the processing of player orders until a nobrkcodeend is encountered.
nobrkcodeend 0x2fparams: no parameters — allows the processing of player orders after a nobrkcodestart instruction.
ignorerest 0x30params: no parameters — conceptually, this causes the script to stop until the next animation is called.
attkshiftproj 0x31params: <distance> — creates the weapon flingy at a particular distance in front of the unit.
tmprmgraphicstart 0x32params: no parameters — sets the current image overlay state to hidden.
tmprmgraphicend 0x33params: no parameters — sets the current image overlay state to visible.
setfldirect 0x34params: <direction> — sets the current direction of the flingy.
call 0x35params: <labelname> — calls a code block.
return 0x36params: no parameters — returns from call.
setflspeed 0x37params: <speed> — sets the flingy.dat speed of the current flingy.
creategasoverlays 0x38params: <gasoverlay#> — creates gas image overlays at offsets specified by LO* files.
pwrupcondjmp 0x39params: <labelname> — jumps to a code block if the current unit is a powerup and it is currently picked up.
trgtrangecondjmp 0x3aparams: <distance> <labelname> — jumps to a block depending on the distance to the target.
trgtarccondjmp 0x3bparams: <angle1> <angle2> <labelname> — jumps to a block depending on the current angle of the target.
curdirectcondjmp 0x3cparams: <angle1> <angle2> <labelname> — only for units. Jump to a code block if the current sprite is facing a particular direction.
imgulnextid 0x3dparams: <x> <y> — displays an active image overlay at the shadow animation level at a specified offset position. The image overlay that will be displayed is the one that is after the current image overlay in images.dat.
__3e 0x3eparams: no parameters — unknown.
liftoffcondjmp 0x3fparams: <labelname> — jumps to a code block when the current unit that is a building that is lifted off.
warpoverlay 0x40params: <frame#> — hypothesised to display the current image overlay's frame clipped to the outline of the parent image overlay.
orderdone 0x41params: <signal#> — most likely used with orders that continually repeat, like the Medic's healing and the Valkyrie's afterburners (which no longer exist), to clear the sigorder flag to stop the order.
grdsprol 0x42params: <sprite#> <x> <y> — spawns a sprite one animation level above the current image overlay at a specific offset position, but only if the current sprite is over ground-passable terrain.
__43 0x43params: no parameters — unknown.
dogrddamage 0x44params: no parameters — applies damage like domissiledmg when on ground-unit-passable terrain.

Source: Ar3sgice/eudtools. Used with the author's confirmation; no licence is assigned.