Extension User Guide
This guide will cover the basics of developing an extension to CEVO. We built this framework around supporting 3rd party inclusions, and there are a few ways it can be done. The main 2 ways are via datamap adjustments/inclusions/changes, or through a more traditional factorio mod.
Note
If you interested in learning about the implementations of specific content, look into their specific documentation pages...
The codeberg directory also contains "extension-example", providing an example with files.
Datamap Extension
The simpler form of building new content via json or datamaps. This system is a bit more limited, because of the inability to add new prototypes.
What can be done
- Jobs
- Expertise
- Professions
- Player Attributes
- Crit Triggers
- Talents
- Requirement Changes
- Enemy Variants(Must be imported during prototype stage)
- Boss changes
- Enemy waves
- Personal Research
- Boss difficulty
- Exp Rewards
Anything that requires new items/entities/prototypes should be done in the typical mod format. This is for small 1-2 files additions/changes
Examples
Here are some examples of small extensions that could exist for the mod:
- Career extension: Media Personality
- Adds jobs, expertise, and professions that are tied to content creation roles
- Support focused buffs
- Includes personal research
- Horde Overhaul
- Adds 10 hordes to each tier
- Double the enemy count
- Increased variant types
- Boss spawns
These would require 0 prototypes, 0 interaction with normal systems. All you need is:
- A JSON string, either via file or RCON or however you get it.
- A function call to our importer.
The string just needs to follow the proper structure. Below is a code examples, our source code contains others, and we've provided a json schema to follow. This schema is subject to change, and at times may be out of date. Feel free to contact us if there is an issue!
Code
An example of some career data:
--[[################################
# datamap.lua
#
# ---- DESCRIPTION:
# Basic datamap containing career info.
################################--]]
return [=[
"name":"career",
"data":{
"profession":[
{
"name" : "video_editor",
"group" : "health",
"type" : "health",
"tier" : 1,
"description": "",
"requirements": {
"expertise": {}
},
"attributes":{
"intelligence": 3
}
},
{
"name" : "content_creator",
"group" : "health",
"type" : "health",
"tier" : 3,
"description": "",
"requirements": {
"level": 10
},
"attributes":{
"intelligence": 5,
"free_will": 5
}
}
],
"job":[
{
"name" : "tiktok_poster",
"group" : "health",
"type" : "health",
"tier" : 1,
"description": "",
"requirements": {
"profession":[
"video_editor"
]
},
"talents": {
"sturdy": 2,
"long_lasting": 2,
"fast_acting": 2
}
},
{
"name" : "social_media_celeb",
"group" : "health",
"type" : "health",
"tier" : 3,
"description": "",
"requirements": {
"profession":[
"content_creator",
]
},
"talents":{
"long_lasting": 5,
"fast_acting": 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)
If you had a mod with 10+ weapons already set up, you could build a datamap with their cevo info and import it. All of our systems would integrate with said weapons. The main restriction would be attachments, supplies, and icon data. Those rely on our factories to make changes before extending.
Mod Extension
Within your own mod, or through a full mod, you can fully implement most of our systems...
What can be done
- Anything found in the core mod...
- Enemies
- Bosses
- Shrines
- Attachments
- Supplies
- etc...
This can be done with the support of json strings for items, or via the datamap object. Importers exist at both stages of the game to support and directly implement new content. You can create items, and pass their cevo data along for runtime as well.
Code
Json schema applies exactly to the datamap object imports, they are the same structure for the same thing. Objects could be imported using our factories and tools, or you can build your own. As long as the cevo-data you import and the name on it matches up, it will work.
From "extension-example"
--[[################################
# data.lua
#
# ---- DESCRIPTION:
# Here we will define some weapon prototype and cevo data.
# Our factory will handle runtime data from this item. So you
# do not need a separate datamap file. Icons should be defined
# here, so cevo can use them. Otherwise the game will not run.
################################--]]
local weapon_builder = cevo.interface.weapon() # This provides provides weapon with some default tooling
local function build_weapon()
local weapon = weapon_builder()
--[[################################
# Defaults and Initialization
################################--]]
weapon.parameters = {}
local range = 45
--############### Item ##############
function weapon.parameters.item()return{
name = "am-rifle",
attack_parameters = weapon.parameters.attack(),
}end
--############### attack ##############
function weapon.parameters.attack()return{
type = "projectile",
ammo_category = "bullet",
cooldown = 45,
movement_slow_down_factor = 0.25,
damage_modifier = 1.25,
shell_particle =
{
name = "shell-particle",
direction_deviation = 0.1,
speed = 0.1,
speed_deviation = 0.03,
center = {0, 0.1},
creation_distance = -0.5,
starting_frame_speed = 0.4,
starting_frame_speed_deviation = 0.1
},
projectile_creation_distance = 1.125,
projectile_center = {0, 0},
range = range,
gun_barrel_length = 1,
# Examples of using our tools to create a new item
sound = weapon.sounds.rifle_heavy(),
ammo_type = weapon.projectile.bullet.high_caliber(range, 1, 1, "anti-material-projectile")
}end
--############### Recipe ##############
weapon.parameters.recipe = {
type = "recipe",
enabled = false,
ingredients =
{
{type="item", name="intelligent-bio-material", amount=150},
{type="item", name="advanced-circuit", amount=125},
{type="item", name="piercing-rounds-magazine", amount=250},
{type="item", name="electronic-circuit", amount=200}
},
}
--############### Technology ##############
# Technology parameters are used for matching up recipes -> tech unlock
weapon.parameters.technology = {name="tinkering", tier=4}
--############### Cevo ##############
--# This follows the same format as json files. Localized to a single item.
--# Import happens when create_weapon is called.
weapon.parameters.cevo = {
type = "pierce",
tier = 4,
requirements = {
dexterity = 200,
},
attachments = {
barrel = 3,
scope = 4,
stock = 2,
magazine = 1,
}
}
--[[################################
# Create
################################--]]
function weapon:create()
local weaponParams = {
item = self.parameters.item(),
recipe = self.parameters.recipe,
tech = self.parameters.technology,
cevo = self.parameters.cevo
}
cevo.interface.create_weapon(weaponParams)
end
return weapon
end
build_weapon():create()