FANDOM


General structure of a modEdit

A mod should have the following directory structure.

The parts inside the modId folder are described below.

mod.hjsonEdit

A mod, at the very least, consists of one file the mod.hjson file.

This file contains basic information about your mod and will be the starting point for describing the changes your mod makes to the game.

The most basic example for this file would contain this:

{
  modInfo:
  {
    id: your-mods-id
    name: Your mods name
    authors: You
    version: 1.0
    enabled: true
  },
  imageData:[
  ],
  modEntries:[
  ]
}

There will be some warnings in your console, but you will see an entry in the mod menu that you can enable and disable.

modInfoEdit

This section describes basic information and parameters of the mod.

The properties that you can modify are described below.

Property Description
id The mod's ID. This has to be the same as the directory name that it's in.
name The mod's name. You are free to name your mod however you please.
authors

The name(s) of the author(s)

Example: You, Someone else

version The version of the mod. Should consist of numbers separated by dots.

enabled

Whether or not the mod should show up in the mod menu. Set to true or false
defaultLang A language code like defined here. This is the language your mod will load by default before applying potential language dependent translations
logLevel A value between 0 and 10. At 10 you will see every warning there is about your mod. At 0 you will only see critical errors.

imageDataEdit

This section describes the images that you want the game to load for you.

An example of it would look like this:

  imageData:[
    {
      id: it_test.png
      file: mod-test/it_test.png
    },
  ],

You can optionally define a type for any image you want to load into the game.

Type Description Outputs
img The default type A single image with the id specified

tileBorders

If you are using the tile border template you want to set this type Six images, their ids being the specified id with the suffixes _n, _ne, _se, _s, _sw, _nw respectively for each direction.
miniSprite If you are using the minisprite template you want to use this type It creates 8 images named {id}_0 to {id_7} for each picture in the sprite.

spriteSheetsEdit

You can also load images using sprite sheets. These are single png files which contain multiple sprites. We use a tool called TexturePacker ([1]) to create ours, but you can also do it by hand. You can see an example sprite sheet from the game data at [2].

An example of it would look like this:

  spriteSheets:[
    {
      file: mod-test/hud.json
      hasTinted: false
    },
  ],

If you set hasTinted to true, the game will also look for a corresponding png file with the prefix '_sil'. This is used to create corresponding "tinted" sprites for each sprite in the spriteSheet. This is mainly used by the tile rendering.

modEntriesEdit

This section is where most of the actual modding happens and where most of the documentation in this wiki applies.

For example

  modEntries:[
    {
        id: it-test-Item
        name: txt-it-test-Item-Name
        description: txt-it-test-Item
        sprite: it_test.png
        value: {base: 1234, village: 20, karma: 1}
        maxStack: 3
        bonus: viewDist: +0.8
        debugCategory: modding
    }
  ]

This example would add a new item to the game.

The general structure of an entry looks like this:

   {
        targetId: {operation}{targetRegEx}::{subTarget}
        data: anything
        id: {prefix}{id}
        #more entries depending on what you are adding
   }

targetIdEdit

If you don't specify a targetID your entry will be added to the game. You only need to specify it if you want to modify already existing things.

The targetId consists of three parts two of which are optional.

operation

Value Description
nothing If no operation is explicitly written down the assumed operation is adding
+ The target has to be an array. The entry will be appended to the array.
- The target can be anything, this operation removes the target from the game.
/ The target can be anything, this operation replaces the target with its entry.
* The target has to be an object, this operation merges the entry with the target. That means it replaces all of the specified entries and leaves the rest untouched.

targetRegEx

A regular expression that will be matched against all currently known ids in the game. The engine will try to apply your changes to anything with an id that matches the regex.

subTarget

The sub target allows you to specify if you want to modify a specific aspect of an entity. so if you only want to change the events of something in the game and leave the rest untouched you can specify "events" as a sub target.

Examples

Entry Explanation
{
  targetId: -wd-world-.*::pockets
},

This entry will remove all pockets from all wd-world entities in the game.

{
  targetId: *wd-world-.*
  pockets: ["pck-candy"]
}

The operation here is *.

This will replace all of the wd-world entries pockets to just be ["pck-candy"]

The special data tagEdit

Because of the structure of a modEntry it is usually an object, which is fine in most cases. The data tag allows you to specify the data you want to use for the operation directly.

Example

   {
       targetId: +evt-village-actions-night::actions
       data: [
          "evt-village-actions-night-train", 
          "evt-village-actions-night-test"]
   }

This would add two new strings to the action entries in evt-village-actions-night.


idEdit

The important thing about an id is that it will always have a prefix that determines what type of thing you want to modify or add to the game.

Prefixes

Prefix Type
tl- Tile
evt- Event
fxt- Fixture
act- Action
gol- Goal
grp- Group
pck- Pocket
bio- Biome
it- Item
zn- Zone
cl- Chat Line
tg- Tribe Gen
tgl- Tribe Gen Layer
il- Item List
spr- Sprawl
df- Dice Face
dp- Dice Pattern
pt-

Particle

dc- Dice
buf- Buff
wd- World
cfg- Config
na- Names
np- NamePool
ch-, sp-, anm-, npc-, pl-, emy- Character
st-, pk-, os- Status Effect

Examples

Entry Explanation
{
  id: "dc-attack-enemy-trex"
  sprite: "hud_dice_bg_emy_1.png"
  faces: "claw_3 claw_3 teeth teeth stomp stomp"
}
Adds a new dice to the game.
{
   id: it-test-Item
   name: txt-it-test-Item-Name
   description: txt-it-test-Item
   [...]
}
Adds a new Item to the game.

Import entryEdit

A special kind of entry that doesn't use any kind of id is an import entry. This type of entry loads all entries from another file and replaces the import entry with all of those entries.

Example

   {
     import: myMod/myMod-importTest.hjson
   }

configSettingsEdit

The config settings section allows you to modify the games config. In it you can override almost all of the games settings to change things up quite a bit. This section is completely optional.

langsEdit

The langs folder contains files of the form lang_{lang_id}.csv . These files work exactly the same as the other language files the game uses.

The game will load your language specific texts from these files. The lang_id has to be the corresponding Language Code.

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