Avorion Wiki
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
This mod adds new chat commands to the game: <code>/mods</code> and <code>/outdatedmods</code>, represented by 2 files in <code>data/scripts/commands/</code>. It also shows how to use the <code>main.lua</code> file to have mod-specific update calls.
+
This example adds new chat commands to the game and shows how to register regular updates specific to mods on the server.
   
  +
== About ==
* <code>/mods</code> lists all mods that are currently running on the server.
 
  +
This mod adds new chat commands to the game: '''/mods''' and '''/outdatedmods''', represented by 2 files in <code>data/scripts/commands/</code>. It also shows how to use the <code>main.lua</code> file to have mod-specific update calls.
* <code>/outdatedmods</code> lists all mods that are outdated, ie. a newer version is available in the steam workshop.
 
  +
 
* '''/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 <code>main.lua</code> file, it regularly prints a message to the chat when mods are outdated on the server.
 
In the <code>main.lua</code> file, it regularly prints a message to the chat when mods are outdated on the server.
  +
  +
=== modinfo.lua ===
  +
* <code>serverSideOnly = false</code> This mod would be server-only, if it wasn't for some localization files that have to be present on the client to translate.
  +
* <code>clientSideOnly = false</code> Client side only is impossible, since it uses chat commands that must run on the server.
  +
* <code>saveGameAltering = false</code> 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 ===
 
=== Localization ===

Latest revision as of 11:37, 10 April 2019

This example adds new chat commands to the game and shows how to register regular updates specific to mods on the server.

About[ | ]

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[ | ]

  • 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[ | ]

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

Workshop Link[ | ]

See Also[ | ]