Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Prints

Print are essentially tables of an Animation Kit that adds Cells to the main global environment of the Graph (which includes Ticket, Depot, Stage, and Road). Phase is separated into its own special type of table called Phase Kit that are only looked inside Stage cells. More into them in Phase Kit

All Prints created in an Animation Kit are then associated with the module of that kit. This will become more important later on.

Tickets & Depots

Ticket & Depot are the simplest tables on the Animation Kit. Ticket only has an id to be set, while Depot can have optional effects imbued to it.

---@class DS_TicketPrint
---@field id string

---@class DS_DepotPrint
---@field id string
---@field effects (fun(actor: DS_AnimActor))[][] | nil

---@type DS_AnimKit
local animation_kit = {
    VERSION = 1,
    module  = "your_unique_name",
    ---This adds tickets to the graph.
    tickets = {
        { id = "YOUR_TICKET_ID_1" },
        { id = "YOUR_TICKET_ID_2" },
    },
    ---This adds depots to the graph.
    depots = {
        { id = "YOUR_DEPOT_ID_1" },
        {
            id = "YOUR_DEPOT_ID_2",
            ---With depots you can also implement your effects. This is optional.
            effects = {
                ---@param DS_AnimActor
                function(actor)
                    ---Will print which seat the actor is located in.
                    print(actor.bus_seat)
                end
            }
        }
    }
}

return animation_kit

This Animation Kit will essentially create two Tickets, and two Depots on the graph.

Stages

Stages, as we explained earlier are our scene setups. In an Animation Kit you essentially need to create a stage from scratch, make sure you set up the right offsets, and all values are set correctly. You can use the example below as a reference.

---@class DS_StagePrint
---@field id string
---@field tags string[]
---@field pawns DS_AnimPawn[]
---@field effects (fun(actor: DS_AnimActor))[][] | nil
---@field anchor DS_AnimAnchor | nil

---@type DS_AnimKit
local animation_kit = {
    VERSION = 1,
    module = "your_unique_name",
    stages = {
        {
            id = "YOUR_STAGE_ID",
            tags = {"test", "just_a_stage"},
            pawns = {
                {
                    animtype = "player",
                    is_female = true,
                    has_penis = false, -- optional value, defaults to what matches to a cisgender character
                    active = false,    -- optional value, defaults to `false`.
                    pos_offset = {x = 0, y = 0},
                    angle_offset = 0
                },
                {
                    animtype = "zombie",
                    is_female = false,
                    has_penis = false,
                    active = true,
                    pos_offset = {x = 0, y = 0},
                    angle_offset = 0,
                },
            },
            anchor = {type = "actor", actor_id = 1},
            effects = {}, -- optional, you can add your effects here.
        }
    }
}

return animation_kit

Roads

As we mentioned before in here, Roads are the bridges between the Cells of our Graph. And in here, there are four types of it mirroring all possible types of connections, TS, TD, SS, SD. (Ticket to Stage, Ticket to Depot, Stage to Stage, Stage to Depot). They define how two fields in a Road find the Cells. from, and to. In those fields you will put the exact id of the Cell you wish to connect based on the Road type.

Here’s an example:

---@class DS_RoadPrint
---@field from DS_CellAddress
---@field to DS_CellAddress
---@field animx string[] | nil
---@field events DS_AnimEvent[][] | nil
---@field conditions (fun(anim_bus: DS_AnimBus): boolean)[]
---@field reorder integer[] | nil

---@type DS_AnimKit
local animation_kit = {
    VERSION = 1,
    module = "your_unique_name",
    tickets = {
        { id = "UNIQUE_TICKET_ID" }
    },
    depots = {
        { id = "UNIQUE_DEPOT_ID" }
    },
    roads = {
        {
            type = "TD", -- TD stands for 'Ticket to Depot'.
            from = "UNIQUE_TICKET_ID",
            to   = "UNIQUE_DEPOT_ID",
            conditions = {}, -- We're leaving this empty to make the Road truthy.
            events = nil, -- Optional. Our animation events if there is an animation.
        }
    }
}

return animation_kit

This simple kit will create a Ticket, and a Depot, then connect them via our Road. Of course you can do more, and add more spices, like adding conditions to the Road to make the AnimBus only drive through it when it is available.

If a Road has an animation in them, the Animation Events that we’re inserted in them will be played.