Mod Example: Chat Command

From Avorion Wiki
Jump to: navigation, search

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.

In the main.lua file, it regularly prints a message to the chat when mods are outdated on the server.

modinfo.lua[edit | edit source]

  • serverSideOnly = false This mod would be server-only, if it wasn't for some localization files that have to be present on the client to translate.
  • clientSideOnly = false Client side only is impossible, since it uses chat commands that must run on the server.
  • saveGameAltering = false The 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]

In the data/localization/ folder you can find an example for a German localization of texts that appear in the mod.

Workshop Link[edit | edit source]

See Also[edit | edit source]