Difference between revisions of "Quick Start & Modding Basics"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
Line 48: Line 48:
 
atom ('surface.desert.soil.1',
 
atom ('surface.desert.soil.1',
 
{
 
{
grid = 'grid.desert',
+
    grid = 'grid.desert',
neighbor_grid = 'grid.soil',
+
    neighbor_grid = 'grid.soil',
neighbor_transition = 1,
+
    neighbor_transition = 1,
  
masque = {{"images/surface/desert_soil/desert_soil_1.png"}},
+
    masque = {{"images/surface/desert_soil/desert_soil_1.png"}},
grass = grass,
+
    grass = grass,
grass_ending = grass_ending
+
    grass_ending = grass_ending
 
})
 
})
 
</pre>
 
</pre>
 +
*First parameter is name of the new atom.
 +
**Notice that it missing the <code>mod_name</code> part.
 +
**It's because you don't have to use it when creating atom, because it provided automaticaly based on the mod.

Revision as of 23:23, 3 February 2021

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 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 mods
    • raw_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
})
  • First parameter is name of the new atom.
    • Notice that it missing the mod_name part.
    • It's because you don't have to use it when creating atom, because it provided automaticaly based on the mod.