Event list.dat
event_list.dat contains all of the events that can occur in a map. Events encompass almost everything that is not normal gameplay, including opening doors and chests, talking to NPCs, and getting frozen and attacked by Redeads. The file is located within the map's Stage.arc, at Stage/dat/event_list.dat.
The file contains a header with offsets and counts for the different sections. After this header are the different types of data, stored in the order of events, actors, actions, properties, a float bank, an integer bank, and a string bank.
Contents
Overview
As a flattened hierarchy, the event data uses many indexes to connect pieces of data together. Events have indexes to their actors; actors have the index of their first action; actions have the index of their first property; and properties have an index or offset to the data that they represent.
Actions and properties are chained to other actions and properties in a linked list-style format. Actors have the index to their first action. This action then has an index to the next action in the chain, and so on, until the index of the next action is 0xFFFFFFFF/-1. It is the same with properties - the first property that belongs to an action has the index to the next property, and this continues until the next property index is -1.
To-do: Explain flags.
Header
Size: 0x40 bytes.
Offset | Size | Name | Description |
---|---|---|---|
|
|
Events Offset | |
|
|
Event Count | |
|
|
Actors Offset | |
|
|
Actor Count | |
|
|
Actions Offset | |
|
|
Action Count | |
|
|
Properties Offset | |
|
|
Property Count | |
|
|
Float Bank Offset | |
|
|
Float Bank Count | |
|
|
Integer Bank Offset | |
|
|
Integer Bank Count | |
|
|
String Bank Offset | |
|
|
String Bank Length | |
|
|
Padding 1 | |
|
|
Padding 2 |
Events
Events are the first layer in the event system. They have a name, indexes to actors, an array of flags, and a boolean that determines whether the famous "Puzzle solved!" jingle should play when the event is finished. Events are referenced by name by the EVNT chunk in the map's DZS file.
Their structure is as follows:
Size: 0xB0 bytes.
Offset | Size | Name | Description |
---|---|---|---|
|
|
Name | |
|
|
Index | Index of this event. |
|
|
Unknown 1 | 0 or 1 |
|
|
Priority | Presumably, an event with a higher priority will override an event with a lower priority if one starts to play at the same time as the other. |
|
|
Actor Indexes | 0x14 ints. Unused slots in the array are filled with -1. |
|
|
Actor Count | |
|
|
Starting Flags | Two ints. Purpose unknown. |
|
|
Ending Flags | Three ints. Once all of these flags have been set, the event will end. |
|
|
Play Jingle | Boolean. |
|
|
Unknown 1 | Initialized at runtime. |
|
|
Unknown 2 | Initialized at runtime. |
|
|
Unknown 3 | Initialized at runtime. |
|
|
Unknown 6 | Initialized at runtime. |
|
|
Unknown 7 | Initialized at runtime. |
|
|
Unknown 8 | Initialized at runtime. |
|
|
Event State | Initialized at runtime. Determines if the event is playing or has ended. |
|
|
Unknown 9 | Initialized at runtime. |
|
|
Unknown 10 | Initialized at runtime. |
Actors
Actors are the second layer in the event system. They represent entities, such as Link or NPCs, along with more abstract objects such as the camera and dedicated timer objects. They have a name, a "Staff Identifier" with an unknown purpose, a flag to set when the actor is finished executing its actions, and a "Staff Type" which is also unknown.
Size: 0x50 bytes.
Offset | Size | Name | Description |
---|---|---|---|
|
|
Name | |
|
|
Staff Identifer | Don't know what this is, J.H. wasn't sure either |
|
|
Index | Index of this actor. |
|
|
Flag ID | The actor sets this flag when all of its actions finish executing. |
|
|
Staff Type | See below |
|
|
First Action Index | The index of this actor's first action. The action's "Next Action Index" can be used to find the rest. |
|
|
Unknown 2 | Initialized at runtime. |
|
|
Current Action Index | Initialized at runtime. |
|
|
ActIndex | Initialized at runtime. Apparently stores the string length of the current action? |
|
|
Unknown 3 | Initialized at runtime. |
|
|
Unknown 1 | Initialized at runtime. |
|
|
Unknown 2 | Initialized at runtime. |
|
|
Is Advance | Initialized at runtime. Engine might set this when the actor is moving onto its next action? |
|
|
Unknown 3 | Initialized at runtime. |
|
|
Unknown 4 | Initialized at runtime. |
|
|
Unknown 5 | Initialized at runtime. |
Staff Type
Value | Name | Description |
---|---|---|
0x0 | Normal | |
0x1 | All | |
0x2 | Camera | |
0x3 | Unknown 1 | |
0x4 | Timekeeper | |
0x5 | Unknown 2 | |
0x6 | Director | |
0x7 | Message | |
0x8 | Sounds | |
0x9 | Light | |
0xA | Unknown 3 | |
0xB | Package | |
0xC | Create |
Actions
The third layer in the event system, actions allow actors to do something. For example, actions allow Link to walk to a certain location, or allow NPCs to animate or create message boxes. It is common for entities to have actions defined within their relocatable modules (their code) that are referenced by name by an action in the event_list.
Size: 0x50 bytes.
Offset | Size | Name | Description |
---|---|---|---|
|
|
Name | |
|
|
Duplicate ID | For when two or more actions in the same actor share the same name. |
|
|
Index | Index of this action. |
|
|
Starting Flags | Three ints. The action will not be performed until all of the flags in this array are set. Empty slots are filled with -1. |
|
|
Flag ID | The action sets this flag when it finishes executing. |
|
|
First Property Index | The index of this action's first property, or -1 if it has no properties. The property's "Next Property Index" can be used to find the rest. |
|
|
Next Action Index | Next action to perform. If there is no next action, it's -1. |
|
|
Unknown 6 | Initialized at runtime. |
|
|
Unknown 7 | Initialized at runtime. |
|
|
Unknown 8 | Initialized at runtime. |
|
|
Unknown 9 | Initialized at runtime. |
Properties
Properties are the last layer in the event system, and serve as parameters for actions. They provide actions with data that they can use to execute their functions. An example would be the position in space for Link to walk to for an action telling him to go somewhere.
Size: 0x40 bytes.
Offset | Size | Name | Description |
---|---|---|---|
|
|
Name | |
|
|
Index | Index of this property. |
|
|
Data Type | See below. |
|
|
Data Index | Index of the data in the relevant bank. For strings this acts as an offset. |
|
|
Data Size | Number of elements in the array. Valid for all data types. For strings this is the length of the string. |
|
|
Next Property Index | Index of the next property. It's -1 if there is none. |
|
|
Unknown 1 | Initialized at runtime. |
|
|
Unknown 2 | Initialized at runtime. |
|
|
Unknown 3 | Initialized at runtime. |
Property Data Type
Value | Name | Description |
---|---|---|
0 | Float | |
1 | Vector3 | Three floats. |
2 | Unknown | |
3 | Integer | |
4 | String |
Data Banks
At the end of the file are three banks of data that are referenced by properties. These banks are made up of floats, integers, and strings. For the float and integer banks, data is accessed by its index, which is stored in the property. For Vector3's, this means that the three component floats are stored at the initial index, the index + 1, and the index + 2 within the float bank.
The string bank is handled differently. Rather than accessing data by an index, strings are referenced by their offset within the bank. Strings are therefore extracted by the game by going to the offset in the string bank and copying out the amount of bytes given by the DataLength variable in the property data.