Making your mod more compatible...


Info

Interfaces are not heavily tested, so please let us know if there are issues...

We've provided some basic tooling to both the prototype and control stage. Both to support compatibility and expansions/plugins directly for this mod. The tools provided should allow you too:

The use of these interfaces varies based on the stage. I recommend looking at | Interfaces | for specific function information.

Prototype Examples

Prototype "interfaces" use cevo.interfaces global functions to allow you to import data. Sending data here means you should not use data:extend yourself.

We also provide the core tooling used in our own prototype creations. So you can utilize things you find in the source code(ammo_types, sounds, art, etc...).

--[[################################
# ballistic-plate-reinforcement.lua
#
# ---- DESCRIPTION:
################################--]]
local equipment_builder = require("equipment")

local function build_equipment()
    local equipment = equipment_builder()
    --[[################################
    # Defaults and Initialization
    ################################--]]
    equipment.parameters = {}
    --############### Item ##############
    equipment.parameters.item = {
        name = "ballistic-plate-reinforcement"
    }

    --############### equipment ##############
    equipment.parameters.equipment = {
        type = "belt-immunity-equipment",
        energy_source = {
            type = "electric",
            usage_priority = "secondary-input"
        },
        energy_consumption = "30kW"
    }

    --############### Recipe ##############
    equipment.parameters.recipe = {
        type = "recipe",
        enabled = false,
        ingredients =
        {
            {type="item", name="iron-gear-wheel", amount=100},
            {type="item", name="iron-plate",      amount=200},
        },
    }

    --############### Technology ##############
    equipment.parameters.technology = {name="rnd", tier=1}

    --############### Cevo ##############
    equipment.parameters.cevo = {
        type = "frontline",
        tier = 1,
        requirements = {},
        talents = {
            sturdy   = 1,
            armoured = 1,
        },
        attributes = {
            strength = 1
        },
    }

    --[[################################
    # Create
    ################################--]]
    function equipment:create()
        local params = {
            item      = self.parameters.item,
            equipment = self.parameters.equipment,
            recipe    = self.parameters.recipe,
            tech      = self.parameters.technology,
            cevo      = self.parameters.cevo
        }
        cevo.interface.create_equipment(params)
    end

    return equipment
end

return build_equipment()

This is just one example however. There are many different considerations for what data to send over. I would look at a similar item in our source-code as reference for your project.

Control Examples

The runtime interface use remote calls to provide access to:

The main use-case here would be to import a datamap that links your existing prototypes to our runtime systems. You could utilize our requirements, talent, attribute, career, etc... systems to integrate your mod with ours. There are some limitations, such as attachments/supply that require the use of our prototype stage factories. Variant data would need to be imported at the prototype stage as well.


TODO

--[[################################
# datamap.lua
#
# ---- DESCRIPTION:
# Follows the proper schema for json
# data being imported to enemy modules.
################################--]]
return [=[
{
"name": "enemy",
"data":{
    "variants":{
        "flaming":{
            "name":"flaming",
            "settings":{
                "tint":[255, 200, 075]
            },
            "weight":0.125,
            "prototype":{
                "attack_parameters":{
                },
                "max_health":225,
                "healing_per_tick":0.015,
                "resistances":0
            }
        }
    },
    "waves":{
        "flame_wave":{
            "name": "flame_wave",
            "type": "wave",
            "enemies":[
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter",
                "small-biter-flame"
                "small-biter-flame"
                "small-biter-flame"
                "small-biter-flame"
            ],
            "distance":200,
            "weights":[
                10,
                5
            ]
        }
    }
}
}
]=]

--[[################################
# control.lua
#
# ---- DESCRIPTION:
# This file will simply import our datamap and send it to cevo.
################################--]]
local datamap = require("datamap")

remote.call("cevo", "import_data", helpers.json_to_table(datamap), false)

One of the core functions of this interface is import_data. This allows you to quickly import cevo_data, allowing you to integrate many features. This is the basis for simple plugins/expansions. Passing names of your own content, with relevant cevo data, is enough to link them. Prototype interface is for much heavier integrations(attachments, supplies, icons, etc...).