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

Dependencies

Animation Kits have the ability to reference other modules, and use their own Cells. Which allows for other kits to focus on specific tasks, for example one for creating Stages, and another for connecting them with Roads.

Here’s a good use of it, first we’re going to create two Stages in one Animation Kit, and leave both of them disconnected. We’re calling its module “stage_setting_test”.

test_stage_kit.lua

local anim_kit = {
    VERSION = 1,
    module = "stage_setting_test",
    stages = {
        {
            id = "stage_test_1",
            tags = { "test" },
            pawns = {
                {
                    is_female = false,
                    pos_offset = { x = 0.0, y = 0.0 },
                    angle_offset = 0.0,
                    animtype = "player",
                }
            }
        },
        {
            id = "stage_test_2",
            tags = { "test" },
            pawns = {
                {
                    is_female = false,
                    pos_offset = { x = 0.0, y = 0.0 },
                    angle_offset = 0.0,
                    animtype = "player",
                }
            }
        }
    }
}

return anim_kit

There, now we have a specific animation kit for our stages. We can proceed, and create another Animation Kit. Which will have a special field called dependencies. This field should contain all the necessary modules that you need. This makes the Animation Kit only load after all the needed kits, and make sure that the elements we want are available.

test_road_kit.lua

local anim_kit = {
    VERSION = 1,
    module = "road_setting_test",
    roads = {
        {
            type = "SS", -- Stage to Stage
            from = { 
                id = "stage_test_1",
                -- This field is necessary for the kit to find the correct stage.
                module = "stage_setting_test",
            },
            to = {
                id = "stage_test_2",
                module = "stage_setting_test",
            }
        }
    }
}

return anim_kit

With this, we were able to connect two Stages from a completely different kit! You can also do this with Phases and other Cells.