Open main menu

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

→‎Object Scripts in V3/4 (OC): Filled out unknowns based on object.cpp/ScummEngine_v4::resetRoomObject
(Added info to v3/4 script blocks, clarified table entries & other bits.)
(→‎Object Scripts in V3/4 (OC): Filled out unknowns based on object.cpp/ScummEngine_v4::resetRoomObject)
Line 94: Line 94:
   Block name        2 bytes ("OC")
   Block name        2 bytes ("OC")
   Object ID        2 bytes (LE)
   Object ID        2 bytes (LE)
   unknown          3 bytes
   unknown          1 byte
  x pos            1 byte
  y pos, par. state 1 byte
   image width / 8  1 byte
   image width / 8  1 byte
   unknown          5 bytes
   parent            1 byte
   height & 0xF8    1 byte
  walk_x            2 bytes (LE)
  walk_y            2 bytes (LE)
   height, actor dir 1 byte
   name offset      1 byte
   name offset      1 byte
   offset table      variable {
   offset table      variable {
Line 110: Line 114:
This block contains all object data except for the actual image bitmap. Compare this to V5+ objects, where metadata is split into seperate CDHD and OBNA blocks.
This block contains all object data except for the actual image bitmap. Compare this to V5+ objects, where metadata is split into seperate CDHD and OBNA blocks.


Image width is given in strips, which are 8 pixels wide. Name offset is the absolute offset of object name (or, if you prefer, the position after table end).  
Image width is given in strips, which are 8 pixels wide. The high bit of y pos is used to store the parent's state (0 or 1). Both x pos and y pos will be multiplied by 8 by the interpreter. The lower three bits (mask 0x07) of height are used to store actor dir. Name offset is the absolute offset of object name (or, if you prefer, the position after table end).  


The offset table is a variable block like that used in the VERB block in later games, which contains the verb identifier (1 byte) and the absolute offset (2 bytes). The table end is marked with 0x00. Next is the object's name, which is a standard null-terminated string. After this follows the actual object code. Note that unlike other script types, because there are multiple entry points (one for each supported verb), there are also multiple exit points (or "stopObjectCode" instructions).
The offset table is a variable block like that used in the VERB block in later games, which contains the verb identifier (1 byte) and the absolute offset (2 bytes). The table end is marked with 0x00. Next is the object's name, which is a standard null-terminated string. After this follows the actual object code. Note that unlike other script types, because there are multiple entry points (one for each supported verb), there are also multiple exit points (or "stopObjectCode" instructions).
125

edits