Skip to main content

Zone Entities

Author(s): PlatinumMaster
Research: Kaphotics, PlatinumMaster, Hello007

The NARC containing these files can be found in the following game paths:

  • Black and White: /a/1/2/5
  • Black 2 and White 2: /a/1/2/6

Container Structure

struct ZoneEntitiesContainer {
uint32_t pInitializationScripts; // Relative pointer to initialization scripts.
uint8_t InteractablesCount;
uint8_t NPCCount;
uint8_t WarpCount;
uint8_t TriggerCount;

InteractableEntry Interactables[InteractablesCount];
NPCEntry NPCs[NPCCount];
WarpEntry Warp[WarpCount];
TriggerEntry Trigger[TriggerCount];


DynamicInitializationEntry pDynamicInitScripts;
StaticInitializationEntry StaticInitScripts;
}

Section Structures

Interactable Entry

Field NameDescriptionData Type
Script IDThe script to execute when interacted with. Read from the zone's script container.uint16_t
ConditionThe condition needed for this interactable to allow interactions.uint16_t
InteractibilityThe sides which the interactable can be interacted with.uint16_t
RailSystem IndexThe index of the interactable in the context of RailSystem, the 3D permissions system.uint16_t
XThe world X position of the interactable.uint32_t
ZThe world Z position of the interactable.uint32_t
YThe world Y position of the interactable.int32_t

NPC Entry

Field NameDescriptionData Type
IDThe ID that will be used to reference the NPC in game.uint16_t
Model IDThe ID of the sprite to use for the NPC in game.uint16_t
Movement CodeThe default movement behavior of the NPC in game.uint16_t
TypeThe type of NPC to be spawned.uint16_t
Spawn FlagThe flag which can be used to control the NPC's presence in game.uint16_t
Script IDThe script which the NPC will use when interacted with in game.uint16_t
Face DirectionThe default direction that the NPC will look before they start their movement.uint16_t
Parameter 1An optional parameter, whose value purpose depends on the actor's movement code.uint16_t
Parameter 2An optional parameter, whose value purpose depends on the actor's movement code.uint16_t
Parameter 3An optional parameter, whose value purpose depends on the actor's movement code.uint16_t
Traversal WidthHow far the NPC will travel from left to right, in game units.uint16_t
Traversal HeightHow far the NPC will travel up and down, in game units.uint16_t
Coordinate SystemIf this value is 1, then RailSystem (the system for nonlinear collisions) is used. Otherwise, it is the grid system.uint32_t
XThe world X position of the NPC.uint16_t
ZThe world Z position of the NPC.uint16_t
RailSystem Side PositionIf the coordinate system is RailSystem, then this specifies the NPC's side position.uint16_t
YThe world Y position of this NPC.int16_t

Warp Entry

Field NameDescriptionData Type
Target ZoneThe map header where this warp will teleport you to.uint16_t
Target WarpThe warp where you will be teleported to.uint16_t
Contact DirectionThe direction you need to interact with the warp.uint8_t
Transition TypeThe transition that will be played when warping.uint8_t
Coordinate TypeThe type of coordinates you will be passing in.uint16_t
XThe world X position of the warp.uint16_t
ZThe world Z position of the warp.int16_t
YThe world Y position of the warp.uint16_t
WidthThe width of the warp zone, in game units.uint16_t
HeightThe height of the warp zone, in game units.uint16_t
Coordinate SystemIf this value is 1, then the coordinates are based on RailSystem. Otherwise, it uses the grid system.uint16_t

Trigger Entry

Field NameDescriptionData Type
Script IDThe script ID which will be used when the trigger is executed.uint16_t
Work Reference ValueThe value that must be in the work in order for this trigger to execute.uint16_t
WorkThe variable that is being monitored for the value we want.uint16_t
UnknownThe purpose of this field has yet to be discovered.uint16_t
Unknown 2The purpose of this field has yet to be discovered.uint16_t
XThe world X position of the trigger.uint16_t
ZThe world Z position of the trigger.uint16_t
WidthThe width of the trigger area.uint16_t
HeightThe height of the trigger area.uint16_t
YThe world Y position of the trigger.int16_t
Unknown 3The purpose of this field has yet to be discovered.uint16_t