OBJECT STRUCTURE
 
Structure

Header area

byte 00-01 : Data block type (object = 1)
byte 02-03 : Length of data block
byte 04-05 : ID (always 1234h)
byte 06-07 : Pointer to the local variables pointer - 4 bytes
(in script file, set to 0000h (initialized at run-time))
byte 08-09 : Pointer to the Function area + 2 bytes
(in script file, offset to the Function area)
byte 10-11 : Number of selectors


Selector area

byte 12-13 : Species
byte 14-15 : Superclass
byte 16-17 : -info- (purpose unknown)
byte 18-19 : Pointer to the name of the object
byte 20-21 : First selector value
byte 22-23 : Second selector value
byte 24-25 : ...
byte ??-?? : Last selector value


Function area

byte ??-?? : Number of overloaded member functions
byte ??-?? : No of the first overloaded member function
byte ??-?? : ...
byte ??-?? : No of the last overloaded member function
byte ??-?? : Pointer to the superclass Pointer Area + 2 bytes
(in script file, set to 0000h (initialized at run-time))
byte ??-?? : Pointer to code of the first overloaded member function
(in script file, offset to the code)
byte ??-?? : ...
byte ??-?? : Pointer to code of the last overloaded member function


Example

From SCRIPT.044 of Colonel's Bequest
Object lamp1 of the first scene (room 44)

Header area

byte 00-01 : 0001h Data block type (object = 1)
byte 02-03 : 0052h Length of data block (82 bytes)
byte 04-05 : 1234h ID
byte 06-07 : 0000h
byte 08-09 : 0040h Offset to the Function area + 2 bytes
byte 10-11 : 001Fh Number of selectors (31)


Selector area

byte 12-13 : 0027h Species
byte 14-15 : 0027h Superclass ('Prop')
byte 16-17 : 0000h -info-
byte 18-19 : 1647h Offset to the name of the object ('lamp1')
byte 20-21 : 001Eh First selector value ('y' position = 30)
byte 22-23 : 00F0h Second selector value ('x' position = 240)
...
byte 72-73 : 0000h Last selector value ('timer' = 0)


Function area

byte 74-75 : 0001h Number of overloaded member functions (1)
byte 76-77 : 006Fh No of the first overloaded member function ('HandleEvent')
byte 78-79 : 0000h Will be class 'Prop' at run-time
byte 80-81 : 0ED0h Offset to code of 'HandleEvent'





Main | Specifications | Programs | Project | SCI | Links