A Creatures 1 COB file contains a set of scripts and 'imports'.
Format:
Type | Name | Description |
unsigned short | version | This value should always be 1. |
unsigned short | no_objects | This value is how many objects are available. |
unsigned long | expire_month | This value is the month when the COB expires. |
unsigned long | expire_day | This value is the day when the COB expires. |
unsigned long | expire_year | This value is the year when the COB expires. |
unsigned short | noscripts | This number of scripts in the file. |
unsigned short | noimports | This number of imports in the file. There should only be one import, the injection script. |
unsigned short | no_objects_used | number used?? |
unsigned short | null | must be set to zero??. |
PascalString[noscripts]/td> | scripts | The scripts, in the format 'scrp 1 2 3 4,blah,blah,blah,endm'. |
PascalString[noimports] | imports | The imports, in the format 'blah,blah,blah,endm'. |
ImageData | imagedata | The preview image for the COB. |
PascalString | name | The name of the COB.. |
PascalString = first byte is length of string, if first byte is FF (255) then the next two bytes determine the length of the string. after the length byte(s) follows the string itself - NOT null-terminated.
ImageData:
Type | Name | Description |
unsigned long | width | The width of this sprite. |
unsigned long | height | The height of this sprite. |
unsigned short | width | The width of this sprite repeated, but in short. |
char[width * height] | data | The raw sprite data, upside-down. |