SCUMM/Technical Reference/Script resources
SCUMM/Technical Reference → Script resources
Scripts control the internal logic of the games. They exist in different flavours:
- global scripts
- local scripts
- room entry scripts
- room exit scripts
- object scripts
Starting with Scumm V5, the blockname contains 4 bytes and the block size is BE including the 8 bytes for the header. Older games just have a 2 bytes blockname and the block size is in LE without the 6 bytes for the header.
Global Scripts (SC or SCRP)
Global scripts are limited to 200 and stored in the LF or LFLF container. The id and the offset is stored in the directory of scripts in the game index file.
Block name 2 ("SC") or 4 ("SCRP") bytes Block size 4 bytes Script code variable
Local Scripts (LS or LSCR)
Local scripts are stored within a room. The first byte after the blockname contains the id of the script. IDs for local scripts always start at 200.
Block name 2 ("LS") or 4 ("LSCR") bytes Block size 4 bytes ID 1 byte Script code variable
Room Entry Scripts (EN or ENCD)
This block contains special code when a room is entered.
Block name 2 ("EN") or 4 ("ENCD") bytes Block size 4 bytes Script code variable
Room Exit Scripts (EX or EXCD)
This block contains special code when the player leaves a room
Block name 2 ("EX") or 4 ("EXCD") bytes Block size 4 bytes Script code variable
Object Scripts (OBCD in V5+, OI in V3/4)
These are scripts that correspond to VERB actions. VERBs are predefined activities at the bottom of the screen, e.g. "Open", "Look", "Give" etc. For each named object in a room, the game designer could define responses to the players actions. Starting with version 5, the whole code can be found in an Object Resource.
OBCD Block name 4 bytes ("OBCD") Block size 4 bytes
CDHD Block name 4 bytes ("CDHD") Block size 4 bytes (25) obj id 2 bytes ...
VERB Block name 4 bytes ("VERB") Block size 4 bytes offset table variable verb 1 byte (0xFF is default) offset 2 bytes table end 1 byte(must be 0) code variable
TODO: V3/4 ???