Mod Example: Chat Command
This example adds new chat commands to the game and shows how to register regular updates specific to mods on the server.
About[edit | edit source]
This mod adds new chat commands to the game: /mods and /outdatedmods, represented by 2 files in
data/scripts/commands/. It also shows how to use the
main.lua file to have mod-specific update calls.
- /mods lists all mods that are currently running on the server.
- /outdatedmods lists all mods that are outdated, ie. a newer version is available in the steam workshop.
main.lua file, it regularly prints a message to the chat when mods are outdated on the server.
modinfo.lua[edit | edit source]
serverSideOnly = falseThis mod would be server-only, if it wasn't for some localization files that have to be present on the client to translate.
clientSideOnly = falseClient side only is impossible, since it uses chat commands that must run on the server.
saveGameAltering = falseThe mod doesn't add any new scripts or assets to the game, so it doesn't alter save games in a way that they might become corrupted once the mod is no longer active.
Localization[edit | edit source]
data/localization/ folder you can find an example for a German localization of texts that appear in the mod.