From CloudModding TWW Wiki

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.

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
0x00
4
Events Offset
0x04
4
Event Count
0x08
4
Actors Offset
0x0C
4
Actor Count
0x10
4
Actions Offset
0x14
4
Action Count
0x18
4
Properties Offset
0x1C
4
Property Count
0x20
4
Float Bank Offset
0x24
4
Float Bank Count
0x28
4
Integer Bank Offset
0x2C
4
Integer Bank Count
0x30
4
String Bank Offset
0x34
4
String Bank Length
0x38
4
Padding 1
0x3C
4
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
0x00
0x20
Name
0x20
4
Index Index of this event.
0x24
4
Unknown 1 0 or 1
0x28
4
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.
0x2C
0x50
Actor Indexes 0x14 ints. Unused slots in the array are filled with -1.
0x7C
4
Actor Count
0x80
8
Starting Flags Two ints. Purpose unknown.
0x80
0xC
Ending Flags Three ints. Once all of these flags have been set, the event will end.
0x94
1
Play Jingle Boolean.
0x95
1
Unknown 1 Initialized at runtime.
0x96
1
Unknown 2 Initialized at runtime.
0x97
1
Unknown 3 Initialized at runtime.
0x98
4
Unknown 6 Initialized at runtime.
0x9C
4
Unknown 7 Initialized at runtime.
0xA0
4
Unknown 8 Initialized at runtime.
0xA4
4
Event State Initialized at runtime. Determines if the event is playing or has ended.
0xA8
4
Unknown 9 Initialized at runtime.
0xAC
4
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
0x00
0x20
Name
0x20
4
Staff Identifer Don't know what this is, J.H. wasn't sure either
0x24
4
Index Index of this actor.
0x28
4
Flag ID The actor sets this flag when all of its actions finish executing.
0x2C
4
Staff Type See below
0x30
4
First Action Index The index of this actor's first action. The action's "Next Action Index" can be used to find the rest.
0x34
4
Unknown 2 Initialized at runtime.
0x38
4
Current Action Index Initialized at runtime.
0x3C
4
ActIndex Initialized at runtime. Apparently stores the string length of the current action?
0x40
4
Unknown 3 Initialized at runtime.
0x44
1
Unknown 1 Initialized at runtime.
0x45
1
Unknown 2 Initialized at runtime.
0x46
1
Is Advance Initialized at runtime. Engine might set this when the actor is moving onto its next action?
0x47
1
Unknown 3 Initialized at runtime.
0x48
4
Unknown 4 Initialized at runtime.
0x4C
4
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
0x00
0x20
Name
0x20
4
Duplicate ID For when two or more actions in the same actor share the same name.
0x24
4
Index Index of this action.
0x28
4
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.
0x34
4
Flag ID The action sets this flag when it finishes executing.
0x38
4
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.
0x3C
4
Next Action Index Next action to perform. If there is no next action, it's -1.
0x40
4
Unknown 6 Initialized at runtime.
0x44
4
Unknown 7 Initialized at runtime.
0x48
4
Unknown 8 Initialized at runtime.
0x4C
4
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
0x00
0x20
Name
0x20
4
Index Index of this property.
0x24
4
Data Type See below.
0x28
4
Data Index Index of the data in the relevant bank. For strings this acts as an offset.
0x2C
4
Data Size Number of elements in the array. Valid for all data types. For strings this is the length of the string.
0x30
4
Next Property Index Index of the next property. It's -1 if there is none.
0x34
4
Unknown 1 Initialized at runtime.
0x38
4
Unknown 2 Initialized at runtime.
0x3C
4
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.