VoidExpanse/installing mods

From AtomicTorchWiki
Revision as of 04:21, 5 April 2014 by Damonwall (talk | contribs) (Created page with "== Mod files == There are two kinds of mod files: *.CPK and *.MPK. '''CPK''' - stands for Core Package. It contains essential game functionality, and without it game won't w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Mod files

There are two kinds of mod files: *.CPK and *.MPK.

CPK - stands for Core Package. It contains essential game functionality, and without it game won't work. There shouldn't be multiple CPK files loaded into one game, it can cause galaxy-scale disasters.

MPK - stands for Mod Package. It contains additional files, that'll be added to game's virtual file system and overwrite files with the same name and path, contained in CPK and previous MPK files.

For example, if we have CPK with file /content/readme.txt and MPK with file /content/readme.txt, then the second one will be loaded, and first one ignored. This mechanism is created to make overriding core functionality easy, without recompiling whole CPK.

MPK structure

Each mod must have header.xml, or it won't be loaded. Structure of header.xml is in standart XML format:

<?xml version="1.0" encoding="utf-8"?>
<root>
	<id>devmod</id>
	<title>Dev Mod</title>
	<author>AtomicTorch Studio</author>
	<description>Dev. mod for easier debugging for VoidExpanse.</description>
	<version>0.1.0</version>
	<updated>17.01.2014</updated>
	<modtype>2</modtype> <!-- 1 - server, 2 - client-server, 3 - client -->
</root>

For every mod, there's a unique ID formed: [id]_[version]. For instance, unique ID of this mod is devmod_0.1.0.

To add/remove mods from game, there's a file ModsConfig.xml. All mods, that should be loaded, should be listed in this file. To add "devmod" mod, just add this line into "mods" tag:

<mod>devmod_0.1.1</mod>

Modtype is a special parameter, defines whether mod should be loaded on server, on client, or both. For example, if we want to create a mod, which just replaces some icons, this is a typical client mod. Client-side mods will be ignored by server, if listed in ModsConfig.xml. Mods, that contains only server-side alterations, like new topics or scriptis, are typical server mod. If they are listed in ModsConfig.xml, server will load them, but it won't demand one of players. It means, that if server has server-side mod, and client is not - it's okay. Third type is client-server mod, complex type of mod, which is needed on both client and server. If server was created with specific server-side mod, and client doesn't have the same one, server won't let client connect and will give a warning.

Virtual file system concepts

  • All mods are loaded into one virtual file system, with overwrite rule (see in "mod files" section above).
  • Mods can use each other files, so don't hesitate to use original game resources in your mods.
  • If two MPK files have the same file (path+name), the last one (by order in ModsConfig.xml) will be taken.
  • All file names are not case-sensitive. QwEr.xml and qwer.xml are considered the same.