Adding Constructions

Let's learn how to add brand-new constructions like new houses, roads or even trains!

3D Model

Let's first make an appearance for our building, for that you'll require to first create a 3D model via MagicaVoxel, for that you just need to follow this simple guide:

File Structure

You'll need to create a text file starting by newBuildings at the end it's going to look like that: newBuilding_someName.txt.

The file is in a format named JSON, it's a common file format to store data in files, it may be easier if you have a JSON editor to avoid mistakes and make it easier to read.

The file start with a main attribute called construs which will contain every construction we wish to add.

An empty template would look like this:

{
    "construs": []
}

Our First Building

Let's add the minimum needed to make a building

{
    "construs": [
        {
            "name": "Potato Farm",
            "codeName": "potatofarm",
            "category": "campo",
            "models": ["potato farm,1,1"]
        }
    ]
}

Let's review what's written there:

Name: The name of the building

Code Name: The unique ID of our building, it cannot be the same as another one.

Category: The building's category, it defines in which building tab we'll be able to find it.

Models: The visual model of our building, in this case we are selecting the model named potato farm and it's sized 1 x 1 tiles. But a same building could have multiples models for more variety or for specifics edges, for example (multi-tile buildings).

More information about the model's format can be found there:

Adding Functionality

For now, our building is just pure decoration and does nothing, but we can add plenty of characteristics.

Production

Let's define so our building will produce some food:

{
    "construs": [
        {
            "name": "Potato Farm",
            "codeName": "potatofarm",
            "category": "campo",
            "models": ["potato farm,1,1"], // do not forget the ',' !
            // New lines starting there
            "produces": [
                {
                    "rec": "comida",
                    "q": 2
                }
            ]
            // New lines ending there
        }
    ]
}

Last updated