Object Definition

World objects: everything that stands in the world rather than being carried. Their names and menu operations, the ground they cover, the models they are drawn from, and how the map should represent them.


ObjectDefinition.Create

function TObjectDefinition.Create(objID, revision: Integer; const data: TByteArray): TObjectDefinition; static;

Decodes a world object: its name and menu operations, its footprint, its models, and how the map should draw it.

revision is the archive’s revision, which decides whether the ambient sound opcodes carry the extra retain byte that was added in build 1673.

Fields left unset by the stream fall back to defaults, and two of those defaults are worked out afterwards rather than up front: an object counts as a wall or door if it has a wall shaped model or any menu operations, and it supports items if it can be interacted with at all.


TObjectDefinitionArray.IndexOf

function TObjectDefinitionArray.IndexOf(id: Integer): Integer;

The position of id in the array, or -1 if there is no such object.

Object definitions are stored one per id with no gaps, so an id is its own index; this exists to keep that assumption in one place.