Cells
Animation Cells are essentially the main building blocks of the entire Graph. With them in hands we can create complex structures and paths that allow extra dynamic animations to be possible. They can connect with each other through Roads that links their Gates, and deduce what conditions are needed to be met in order for scenes to continue.
There are four types of cells in the entire graph, with each having a specific task. Being Ticket, Depot, Stage, and Phase.
Gates
Gates are doorways that every cell has in some capacity. They are used to connect each Cell with another. There are two types of Gate, GateEntrance and GateExit. They can only be connected with each other but not if they are the same.
GateEntrance <–> GateExit, GateExit <-x-> GateExit, GateEntrance <-x-> GateEntrance.
Effects
GateEntrance has an special trait called Effects. They are essentially lua functions that are called with every Actor in a scene when a Cell is entered.
Here’s a body of a function that would be called when an effect is triggered:
---This function doesn't necessarily do anything to the character itself,
---but anything can be written in here in order to achieve certain effects,
---or if you want it to, do completely different features outside of actors.
---@param actor DS_Actor
local function effect(actor)
---Will print which is the hurt sound of the character.
local character = actor.character
print(character:getHurtSound())
end
Ticket
A Ticket is a Cell that is made purely as an entrance for the Graph. They are starting points where every scene begins. This Cell has only a GateExit.
Depot
A Depot is the reverse of a Ticket. They serve as an exit way out of the Graph, and liberate Actors from their scenes. This Cell has only a GateEntrance.
Stage
Now Stage is an important one. Their job is to define what are the requirements for a scene to happen. Which actors are needed, setting their offsets, and being a container for Phases to specify which animations will be played. You can think of each Stage being a specific pose for each scenario. This Cell has both GateEntrance and GateExit.
A Stage can also define which Phases are more going to be used as start positions.
Phase
Phase is the most significant Cell on the Graph. They specify which animations will be played, and by which actor. They can also define which animation events are going to be triggered at any given time. Unlike Ticket, Depot, and Stage, they don’t live on the global environment of the Graph. Instead, they are stored inside Stage Cells. This Cell has both GateEntrance and GateExit.