Mod

Mod is aggregate of scripts and assets which alters the game for some way. Each mod is represented by a directory. The game can activate multiple mods simultaneously.

Mod creation
To create mod follow this guide and select Modification type when it will be requested. Examine content of mod folder. It contains at least these files: Besides this, you can place here any other assets or scripts that should be included in the mod. Note, that all files with «lua» extension will be executed during mod loading. For instance, you can create barn.lua with following content to increase barns capacity in the game: fv.core.Barn.config.capacity = 15000
 * icon.png — 256 x 256 default image of mod. Please feel free to change it to your own;
 * localization.csv — comma-separated localization dictionary that already contains english text for «title» and «description» keys. Again, you can edit it or add new keys as you like;
 * version.txt — version information about mod. It’s updated automatically and there are no need to edit it manually.

Testing
To test mods go to Modifications from main menu, select your mods of interest, click ok and start new game. You can also change order of mod's loading by arrow buttons.



Mod options
Users can not only turn on/off mods but also set some options for mod from GUI.

< read more about mod options >

Access ForestVillage core and other mods
You can access all global variables and functions of core fv scipts from any mod. But you can use fv.core prefix for variables. For instance "fv.core.config.arrowSpeed" instead of "config.arrowSpeed". Most of global functions available from mods without prefix. You are free to define any new global variables or function without risk to harm fv.core scripts.

Moreover, it is possible to access and alter your global data from another mod via fv.yourModName prefix.

Save/load mod data
Read about Forest Village save/load mechanism in SaveManager article.