Difference between revisions of "Entity"

From Crash Bandicoot Hacking Wiki
Jump to navigation Jump to search
m (Type)
m
Line 9: Line 9:
 
!Value
 
!Value
 
|-
 
|-
|Length
+
|Length of this item
 
|4 bytes
 
|4 bytes
|Total length of this item
+
|*
 
|-
 
|-
 
|Unknown
 
|Unknown
Line 39: Line 39:
 
|es
 
|es
 
|-
 
|-
|Unknowm
+
|Unknown
 
|2 bytes
 
|2 bytes
 
|*
 
|*
Line 75: Line 75:
 
|-
 
|-
 
|0x4B
 
|0x4B
|Object position
+
|Position
 
|List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so)
 
|List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so)
 
|Int16 for each X, Y and Z coordinate
 
|Int16 for each X, Y and Z coordinate

Revision as of 05:09, 28 December 2015

An entity is an item that stores a collection of values (hereafter referred to as "fields") that can represent a game object/camera rail in Crash 2 and 3.

Format

Crash 2/3

Field Size Value
Length of this item 4 bytes *
Unknown 4 bytes x 2 *
Field count 4 bytes *
Field Info Structure h
Type 2 bytes *
Offset relative to 12 bytes at the start of the item 2 bytes *
Flags Byte *
Element size Byte es
Unknown 2 bytes *
Field Structure f
Element count 2 bytes ec
Unknown 2 bytes *
Data es * ec *
Unknown ? bytes *

Type

The format and usage of the field data depends on the field type. Incomplete list.

Type Name Purpose Format
0x2C Name String of characters for the internal name used to refer to the entity. It has no purpose so whatever you put here won't affect the game UTF-8 charset
0x4B Position List of position points to be used by the entity. Multiple of these can be used to make the entity follow a path (as long as it is programmed to do so) Int16 for each X, Y and Z coordinate
0x9F ID Value to uniquely identify the entity that is used to draw it, destroy it (see victims below) and other miscellaneous behaviors Int321
0xA4 General Settings List of values that can be used to change a certain object's behavior (i.e. flags, delay, speed) Int32 (UInt8 + Int24)
0xA9 Type Type of the entity Int32
0xAA Subtype Variant of the entity Int32
0x287 Victim List of entity IDs to destroy on certain occasions (i.e. TNT is undrawn, Nitro Switch activated) Int16

1 - Draw lists store this as an Int16, so setting this to a value higher than that will cause severe issues.