start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
start [2019/12/18 17:02] – [More info on:] maxime | start [2021/08/31 10:38] – [The mod.json file] maxime | ||
---|---|---|---|
Line 9: | Line 9: | ||
* ** [[changelog|Changelog]] ** | * ** [[changelog|Changelog]] ** | ||
* ** [[migration|Migration Notes]] ** | * ** [[migration|Migration Notes]] ** | ||
+ | * ** [[guides|Community Guides]] ** | ||
===== More info on: ===== | ===== More info on: ===== | ||
+ | * [[data-types|Data types]] | ||
+ | * [[enumerations|Enumerations]] | ||
+ | * [[example-mods|Example Mods]] | ||
+ | * [[texture-usage-policy|Game texture usage policy]] | ||
+ | |||
+ | * [[foundation-library-functions|Foundation library functions]] | ||
+ | * [[mod-management-functions|Mod management functions]] | ||
+ | * [[version-library|Version library]] | ||
+ | * [[mod-io-functions|Mod IO functions]] | ||
+ | |||
+ | * [[dependencies|Mod Dependencies]] | ||
* [[components|Components]] | * [[components|Components]] | ||
+ | * [[asset-override|Game asset override]] | ||
+ | * [[behavior-trees|Behavior trees]] | ||
+ | * [[events|Events]] | ||
+ | * [[custom-classes|Custom classes]] | ||
+ | * [[building-asset-processor|Building asset processor]] | ||
+ | * [[level-of-detail|Level Of Detail (LOD)]] | ||
+ | |||
* [[workplaces|Create workplaces]] | * [[workplaces|Create workplaces]] | ||
* [[monuments|Create monuments and bridges]] | * [[monuments|Create monuments and bridges]] | ||
* [[walls|Create walls]] | * [[walls|Create walls]] | ||
* [[particle-effects|Create particle effects]] | * [[particle-effects|Create particle effects]] | ||
- | * [[asset-override|Game asset override]] | + | * [[material-sets|Material sets]] |
- | * [[building-asset-processor|Building asset processor]] | + | |
- | * [[logs|Mod individual log file]] | + | |
- | * [[mod-functions: | + | |
- | * [[dependencies|Mod Dependencies]] | + | |
- | * [[example-mods|Example Mods]] | + | |
===== Where do I start? ===== | ===== Where do I start? ===== | ||
Line 28: | Line 42: | ||
===== The mod.json file ===== | ===== The mod.json file ===== | ||
- | The json file is loaded early and give basic information on your mod, without having to load your LUA scripts: | + | The json file is loaded early and give basic information on your mod, without having to load your LUA scripts. |
- | < | + | |
+ | In addition, this file contains the list of your mod's custom maps and their info, if any. | ||
+ | |||
+ | < | ||
{ | { | ||
- | " | + | |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | |||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
} | } | ||
</ | </ | ||
- | |||
===== The mod.lua script ===== | ===== The mod.lua script ===== | ||
First, you have to create your new mod instance: | First, you have to create your new mod instance: | ||
Line 49: | Line 74: | ||
In order to include another LUA file, you can call the '' | In order to include another LUA file, you can call the '' | ||
- | <code lua> | + | < |
myMod: | myMod: | ||
</ | </ | ||
This will execute the script '' | This will execute the script '' | ||
- | <file lua anotherscript.lua> | + | <code lua anotherscript.lua> |
local myMod = ... -- retrieve arguments passed to the script | local myMod = ... -- retrieve arguments passed to the script | ||
-- do stuff with myMod | -- do stuff with myMod | ||
-- ... | -- ... | ||
- | </file> | + | </code> |
In addition, you can pass any number of variable to the called script: | In addition, you can pass any number of variable to the called script: | ||
- | <code lua> | + | < |
myMod: | myMod: | ||
</ | </ | ||
- | <file lua anotherscript.lua> | + | <code lua anotherscript.lua> |
local myMod, anInteger, aString, anArray = ... -- retrieve arguments passed to the script | local myMod, anInteger, aString, anArray = ... -- retrieve arguments passed to the script | ||
- | </file> | + | </code> |
===== Enabling / Disabling a mod ===== | ===== Enabling / Disabling a mod ===== | ||
Line 77: | Line 102: | ||
If you want to fully ignore a mod, you can either remove it from your mods folder, or rename the '' | If you want to fully ignore a mod, you can either remove it from your mods folder, or rename the '' | ||
===== Logging / Debugging ===== | ===== Logging / Debugging ===== | ||
+ | |||
+ | ==== Log ==== | ||
You can log your own logs into foundation log file: | You can log your own logs into foundation log file: | ||
+ | |||
<code lua> | <code lua> | ||
- | myMod: | + | myMod: |
- | myMod: | + | myMod: |
- | myMod: | + | myMod: |
</ | </ | ||
- | You can also open a blocking message box for debugging purpose: | + | In order to isolate mods related logs, Foundation will log most of mod related information in a specific log file located in '' |
+ | |||
+ | However, keep in mind that a mod can interact with the game in various indirect way, and some valuable information could still be hidden in the global game log in '' | ||
+ | |||
+ | ==== Message box ==== | ||
+ | |||
+ | You can also open a blocking message box for debugging purpose. This function is recommended for mod development only. | ||
<code lua> | <code lua> | ||
myMod: | myMod: | ||
</ | </ | ||
- | ===== What is this generated_ids.lua file? ===== | + | For this function to work, the user must manually set the field '' |
+ | |||
+ | ===== What is this generated_ids.lua file? ===== | ||
Internally, Foundation uses random unique IDs (GUID) to identify most objects and resources. | Internally, Foundation uses random unique IDs (GUID) to identify most objects and resources. | ||
When a new asset is added to the mod, Foundation will create a new ID for it, and will store the association between the " | When a new asset is added to the mod, Foundation will create a new ID for it, and will store the association between the " | ||
Line 97: | Line 135: | ||
===== Sharing a mod ===== | ===== Sharing a mod ===== | ||
+ | |||
Modders are encouraged to use **mod.io** to share their mods. Mods shared this way can be found and downloaded from the in-game mod browser. | Modders are encouraged to use **mod.io** to share their mods. Mods shared this way can be found and downloaded from the in-game mod browser. | ||
Line 102: | Line 141: | ||
You'll have to upload a zip of your mod. Make sure the zip contains directly the mod files ('' | You'll have to upload a zip of your mod. Make sure the zip contains directly the mod files ('' | ||
+ | |||
+ | ===== Quickly reload mods ===== | ||
+ | |||
+ | When developing and testing a mod, you can quickly reload your game by pressing '' |
start.txt · Last modified: 2022/03/30 10:53 by maxime