Public and 3rd Party Interfaces


Info

Interfaces are fairly limited. If theres a particular function/tool you want access too, contact us

Prototype Interface

"Interfaces" for prototypes is simply access to the global functions we've provided. Currently all provided functions are access points to our data factories. Pass along the entity/item/cevo data, and we will integrate it directly, as if we added it ourselves.

interface["create_..."] (params)


cevo.interface.create_armor(params)

Core access to our factories. Pass along a single table, containing entity/item/etc... data as needed.

params Table Groups of data used for creation
entity Table Entity data used for creation companions, boss, minions, hives, shrine, ambush, treasure
item Table Item data, if used armor, consumable, inter_item, artifact, equipment, weapon, attachment, supply, ambush, shrine, treasure, companion
equipment Table Equipment specific data equipment
recipe Table Recipe info armor, consumable, inter_item, artifact, equipment, weapon, attachment, supply, ambush, shrine, treasure, companion
tech Table Technology automated set-ups TODO: More details, look at sourcecode in meantime
cevo Table Cevo specific data, follow schema for the particular item/entity Varies
reward Table Reward data for that specific entity. minion, boss, hive... To be expanded

The exact formats will depend heavily on the specific things you're trying to create. We recommend you take a look at our source-code for reference, and json schemas for cevo data of that particular thing.


interface["Object Type"] (params)


local WeaponBuilder = cevo.interface.weapon()
WeaponBuilder.parameters = {}
WeaponBuilder.parameters.item = {
    name = "test"
    attack_parameters = {
        ammo_type = {
            target_type = "direction"
            action = {
                WeaponBuilder.projectile.test()
                WeaponBuilder.projectile.test2()
            }
        }
    }
}

tools and resources used to create our objects. Not required to create an item, but gives you access to things like projectiles, or sounds. Each one has slightly different content. We recommend looking at the source code for more info, until this is filled out with details.

Script Interface

The runtime script interface is through the normal remote call system. The interface itself is "cevo" and the function calls are listed below.

https://lua-api.factorio.com/latest/classes/LuaRemote.html

import_data(data, isOverride)


Imports datamap into cevo_db modules. Datamap structure follows the datamap json schema. See | User Guides | for examples. This should allow you to implement 90% of our functionality.

data Table Table of data following our format. Json strings should be converted before passed along.
isOverride Boolean Boolean value that tells the importer to overwrite existing data when coming across duplicates.

Overwrites only apply to:

Overwrites are useful for handling migrations, or for overwriting our default values for items. An overhaul mod would use isOverride to overwrite our wave data or item data.


start_dialogue{source="", dialogue="", player_index=0, prev={}, next={}, final={}}


Opens a dialogue window with the given data. Useful for showing text, tutorials, or new information. Dialogues are built in chains, as a linked list. Each individual dialogue should contain the table that holds the next dialogue, and previous dialogue, if applicable.

source String The name at the top of the dialogue window, a dialogue title.
dialogue Localized String The name of a localized string, containing the core dialogue text for this window.
player_index Int The player index to open this table for.
prev Table Table of the previous dialogue window in our chain.
next Table Table of the next dialogue window in our chain
final Bool Indicator to our window that this is the last dialogue in the chain, showing a close button.
local function template(source, dialogue, player_index, prev, final)return{
    source   = source,
    dialogue = {"dialogue." .. dialogue},
    player_index = player_index,
    prev  = prev,
    final = final
}end

local intro     = template("WELCOME", "welcome",  event.player_index, nil)
intro.next      = template("WELCOME", "welcome2", event.player_index, intro)
intro.next.next = template("WELCOME", "welcome3", event.player_index, intro.next, true)


Note

Waves and hordes are spawned based on the evolution tier, and wave data within the mod. Horde and wave calls will randomly pick a group of enemies to spawn.

spawn_wave(player)


Will attempt to force spawn a wave, using the player given for location. Will play the warning sound and call internal "on_enemy_wave_generated" dispatch if successful.

player Factorio LuaObject Controller object used for location reference


spawn_horde(player, opt)


Will attempt to force spawn a horde, using the player given for location. Does not play a warning sound or call internal events.

player Factorio LuaObject Controller object used for location reference
opt Table Optional data, as seen below
Optional Parameters:
- opt.dual_x
    - Spawns 2 waves near the player, along the x axis
- opt.dual_y
    - Same as dual_x, for the y axis
- opt.trio
    - Spawns 3 waves near the player, adjust by both axis
- opt.quad
    - Spawns 4 waves near the player, adjust by both axis