Difference between revisions of "SCUMM/Technical Reference/Script resources"

Jump to navigation Jump to search
m
no edit summary
(Put object code for V3/4 into separate part)
m
Line 12: Line 12:
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.
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.


<br>


= Global Scripts (SC or SCRP) =
== 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 [[SCUMM/Index File|index file]].
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 [[SCUMM/Index File|index file]].
Line 21: Line 22:
  Script code        variable
  Script code        variable


= Local Scripts (LS or LSCR) =
== 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.
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.
Line 31: Line 32:




= Room Entry Scripts (EN or ENCD) =
== Room Entry Scripts (EN or ENCD) ==


This block contains special code when a room is entered.  
This block contains special code when a room is entered.  
Line 40: Line 41:




= Room Exit Scripts (EX or EXCD) =
== Room Exit Scripts (EX or EXCD) ==


This block contains special code when the player leaves a room  
This block contains special code when the player leaves a room  
Line 49: Line 50:




= Object Scripts V5+ (OBCD) =
== Object Scripts V5+ (OBCD) ==


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 resources|Object Resource]].  
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 resources|Object Resource]].  
Line 73: Line 74:
   
   


= Object Scripts in V3/4 (OC) =
== Object Scripts in V3/4 (OC) ==


In Version 3 and 4 the code can be found in the '''OC''' block:
In Version 3 and 4 the code can be found in the '''OC''' block:
24

edits

Navigation menu