Quick Start & Modding Basics
Types of mods
Nebuchadnezzar supports three type of mods:
All mods types have the same data structure and provides the same functionality. They only differ in the way how to obtain them and where are stored.
Local mods
- These mods can be downloaded from any sources.
- These mods are supported on all distributions platforms builds (Steam, Gog and any future platforms).
Steam Workshop mods
- These mods can be downloaded through the Steam Workshop system.
- For Steam builds only.
Developer mods
- Special variant of local mods.
- Used to develop and upload your mods.
What is moddable?
Everything except the tutorial, guide, UI and fonts. That means, you can create or edit goods, production chains, buildings, monuments, maps, missions or even ther whole campaigns and more.
Mod files structure
Each mod is single folder.
- Name of the folder determines the name of the mod.
- This name is then used reference this mods from other mods.
- You should ensure that your mod name will be unique
Each mod has two types of files. These are:
- Definition files - They contains information about new entities or changes in the current entities.
- Data files - Data which are referenced by the definition files. Typically sprite images.
Definition files
Definition files, in short def files, are written in Lua language.
- It means you can use most of Lua language features. Such like variable, aritmetic operations or functions.
Atoms
The basic unit of the game is Atom.
- Each entity in the game is defined as a atom. For example single atom is building, walker, employee, mission, city, goods etc.
- Each atom has properties from which some are obligatory and some are optional. Depending on a type of the atom.
Atom name
- Atom name is the most imporatant property of each atom.
- It has form
mod_name::raw_name
mod_name
part is important because it allows us to unequivocally reference atoms from other modsraw_name
is then name identifying atom within the mod
Atoms functions
There are four functions for creating or editing atoms.
Create atom
To create new atom, use function atom (name, data)
Example
atom ('surface.desert.soil.1', { grid = 'grid.desert', neighbor_grid = 'grid.soil', neighbor_transition = 1, masque = {{"images/surface/desert_soil/desert_soil_1.png"}}, grass = grass, grass_ending = grass_ending })
name parameter
- Name of the created atom.
- Notice that it does not have the
mod_name
part. - It's because you don't have to use it when creating atom, because it's provided automaticaly based on the mod.
data parameter
- Contains all properties of the atom.
- Has form of Lua table, where key is name of a property and value is the value of the property.
parent data parameter
atom
function may also take up to two parent data tablesatom(name, [pd1], [pd2], data)
- Example
caravan_leader_base = { masque = {{"images/walker/caravan/leader/leader_#.png", 32}}, offsets = {{24, 55}, {24, 55}, {24, 55}, {24, 55}}, speed = caravan_speed, slave_offsets = {7, 16}, } atom ('walker.caravan.wine', caravan_leader_base, { info_goods = 'goods.wine', slave_walkers = {'walker.donkey.wine', 'walker.donkey.wine'}, })
- Then the created atom takes properties from the parent data and add (or override by) properties defined in the data table.
Replace atom
To replace existing atom in other mod use function arom_entire (name, data)
Example
atom_entire ('base::walker.donkey.grapes', { masque = {{"images/walker/caravan/donkey_grapes/donkey_grapes_#.png", 32}}, offsets = {{27, 53}, {27, 53}, {27, 53}, {27, 53}}, })
name parameter
- In this case the name is the name of atom we want to replace.
- So here we have to use the whole name including the mod part, because we are replacing atom from other mod.
data parameter
- All data of the original atom are replace by these data.
Replace atom property
To replace property existing atom in other mod use function arom_property (name, data)
Example
atom_property ('base::walker.transport.full.clay', { masque = {{"images/walker/transport/clay/full/full_transport_clay_#.png", 64}}, offsets = {{17, 35}, {15, 36}, {29, 40}, {29, 36}}, })
name parameter
- Name of atom we want to replace property in.
- Here we also have to use the whole name including the mod part.
data parameter
- All properties stated in the data are used in the original atom.
- Rest of the properties stay the same.