FANDOM


The Mod MenuEdit

The mod menu can be reached from the main menu of the game.

On the left is a list of all mods you have currently downloaded. On the right is a small menu to help you debug your mod(s).

Debug optionsEdit

If you make your own mod you will want to test it, so there are some options to make debugging easier for you.
DebugOptions

The debug options

  • Show Debug Bar - enables a handy debug bar at the top of the game to test things quickly
  • Enable Debug Keys - enables a set of hotkeys

Script ExtensionsEdit

To help with modding, it can be useful to install a script extension for your editor of choice. The Modding Script Extensions page has more information about extensions for popular editors.

Setting up a new modEdit

In order to create a new mod you first have to create a new directory inside the games "mods" folder just inside the games root directory (where the electron executable is).

You can name this directory anything you like, but it will be the id for your mod, so it's probably a good idea to pick a name that fits well with your mod. For this article I will pick the id myMod.

Important! The id and the directory are case sensitive 

Inside our new directory we have to create a file called mod.hjson. It will contain some basic information about our mod. Here is an example of that might look like.

{
  modInfo:
  {
    id: myMod
    name: My very own TCE mod
    authors: Cedric
    version: "1.0"
    enabled: true
    language: chs
  },
  imageData:[
  ],
  modEntries:[
  ]
}
MyMod 1

A freshly created mod in the menu

If you run the game now, you should see this mod show up in your mod menu already. Much like in this picture:





MyMod 2

Error from missing language file

But when you enable the mod and close the menu

you will see something like this in your console:




This error occurs because we told the game to load the english language for our mod, but there is no such language file yet.

Adding a language fileEdit

In order for a mod to work in multiple language we need to have language files for each language the mod is supposed to be translated to.

First we create a subdirectory called "langs" in the "myMod" folder.

MyMod 3

Basic mod file structure

Then we add a "lang_en.csv" file to it. The file can be empty, it just has to exist in order for the game to not cause an error. Your mods structure should look something like the picture on the right now. If we add something to the file it should follow the guidelines for Language Files

MyMod 4

Succesfully loading a language file

Now our mod should load just fine, your console should just show this now:

Changing the gameEdit

So far we have set up our mod to work properly. But it doesn't really mod(ify) anything yet, so we should probably change that.

So, we will have to create a new mod entry.

As an example let us change the starting items of Darwin. Let's say we personally think Darwin should start with a lot more torches.

For reference here is what Darwins normal description looks like.
MyMod 5

Charles Darwin with an insufficient amount of torches

{
    id: 'sp-darwin',
    [...]
    items: {
      'it-whisky':4,
      'it-torch':3,
      'it-shotgun':1,
      'it-machete':10
    },
    [...]
  },

I'm not showing parts of it here, but what we need to know is the following:

  • Darwins id is sp-darwin
  • His items are listed inside his items property

Now we want to modify the 'it-torch' entry inside that events items but none of the other entries, which means we want to merge, so our targetId will be:

targetId: *sp-darwin::items

And the thing we want to change is that it-torch should have a higher value. So we need to set that as well.

it-torch: 20
So our mod should look like this now.
MyMod 6

Charles Darwin with enough torches

{
  modInfo:
  {
    id: myMod
    name: My very own TCE mod
    authors: Your_Name_Here
    version: "1.0"
    enabled: true
    defaultLang: en
  },
  imageData:[
  ],
  modEntries:[
    {
        targetId: *sp-darwin::items
        it-torch: 20
    }
  ]
}

And Darwin finally has enough torches.

Community content is available under CC-BY-SA unless otherwise noted.