Difference between revisions of "Mod Creation"

From Zero-K
Jump to navigation Jump to search
(add local colors)
Line 14: Line 14:
  
 
== Mechanics changes ==
 
== Mechanics changes ==
Changing animations, unit behaviour, game mechanics or statistics is a little trickier than cosmetic changes. These changes are also incompatible with the base game. There are two ways to make these changes.
+
Changing animations, unit behaviour, game mechanics or statistics is a little trickier than cosmetic changes. These types of changes affect everyone in a multiplayer game (as opposed to local interface changes) so require the creation and distribution of a game archive.
  
 
=== Mutator ===
 
=== Mutator ===
The relatively simple way is to make a mutator, this is a game package that depends on the base game. Here is an example mutator [[:File:Zk.sdd.zip|zk.sdd.zip]] to get you started. Unzip it in games, and yes, the folder should be named with the extension ".sdd". Your file stucture should look like this.
+
The relatively simple way to mod Zero-K is to make a mutator, this is a game package that includes modified files but otherwise uses the files of the base game. Here is an example mutator [[:File:Zk.sdd.zip|zk.sdd.zip]] to get you started. Unzip it in Zero-K/games, and yes, the folder should be named with the extension ".sdd". Your file stucture should look like this.
  
 
[[File:Capture1.PNG]]
 
[[File:Capture1.PNG]]
  
Overwrite any files to make edits.
+
Any file found in the mutator and the base game will be overridden by the version found in the mutator. New files can be added too.
  
 
=== Full repository ===
 
=== Full repository ===
Fork and clone the game repository as seen on the [[Developing]] page. This gives you a standalone version of the game that depends on nothing. Be warned, you will need to pull changes via git in order to receive updates. The advantages of this method are version control, a locally searchable repository, and the ability to eventually open pull requests and push content to be included in the base game (if you're keen).
+
Downloading the full Zero-K repository can be useful for many types of modding. Fork and clone the game repository as seen on the [[Developing]] page. Be warned, you will need to pull changes via git in order to receive updates. With a local repository you can eventually open pull requests and push content to be included in the base game (if you're keen).
  
 
=== Running your mod ===
 
=== Running your mod ===
 +
(outdated, use the game selection in adv options. TODO: Update the example mutator to not be Zero-K $VERSION)
 +
 
Start a Custom battle lobby, with a password, on the multiplayer server. Type <code>!game zk:dev</code> to switch to your mod, make sure you have a green tick. Other players can join and play your mod if they have the exact same mod files. If you made a mod with the full repository method then they can clone your fork on GitHub.
 
Start a Custom battle lobby, with a password, on the multiplayer server. Type <code>!game zk:dev</code> to switch to your mod, make sure you have a green tick. Other players can join and play your mod if they have the exact same mod files. If you made a mod with the full repository method then they can clone your fork on GitHub.
  

Revision as of 20:56, 18 August 2020

Zero-K runs on the Spring engine, which supports a lot of modification of game files. The most advanced mods may amount to creating an entire new game. The Spring engine wiki is a valuable resource for game and mod development using the engine, especially the gamedev page.

Familiarity with the game repository or main menu repository is important for modding and downloading a searchable version is advised. See Developing#Getting_Sources for how to download a local version of the repository.

Cosmetic and UI changes

Some changes can be made just by adding files to your install directory. The following subfolders of the game repository should support this (feel free to attempt more): unitpics, sounds, unittextures, bitmaps, anims, icons and LuaUI. Replace a file by perfectly matching its name and path.

Here's an example config replacement for team colour config that you can place in LuaUI/Configs/LocalColors.lua.

Everything in the main menu repository can be overridden.

Widgets

For LuaUI changes you will need to enabled local widgets and load local widgets first through the advanced settings in Settings/Interface/Misc. Completely new widgets can also be added and loaded.

Mechanics changes

Changing animations, unit behaviour, game mechanics or statistics is a little trickier than cosmetic changes. These types of changes affect everyone in a multiplayer game (as opposed to local interface changes) so require the creation and distribution of a game archive.

Mutator

The relatively simple way to mod Zero-K is to make a mutator, this is a game package that includes modified files but otherwise uses the files of the base game. Here is an example mutator zk.sdd.zip to get you started. Unzip it in Zero-K/games, and yes, the folder should be named with the extension ".sdd". Your file stucture should look like this.

Capture1.PNG

Any file found in the mutator and the base game will be overridden by the version found in the mutator. New files can be added too.

Full repository

Downloading the full Zero-K repository can be useful for many types of modding. Fork and clone the game repository as seen on the Developing page. Be warned, you will need to pull changes via git in order to receive updates. With a local repository you can eventually open pull requests and push content to be included in the base game (if you're keen).

Running your mod

(outdated, use the game selection in adv options. TODO: Update the example mutator to not be Zero-K $VERSION)

Start a Custom battle lobby, with a password, on the multiplayer server. Type !game zk:dev to switch to your mod, make sure you have a green tick. Other players can join and play your mod if they have the exact same mod files. If you made a mod with the full repository method then they can clone your fork on GitHub.

Running your mod, singleplayer

  • Enable developer mode. Do this by creating an empty text document "devmode.txt" in the same directory as Zero-K.exe. You may need to restart the lobby.
  • In the Settings menu a new tab appears: Developer. Edit the Singleplayer setting to be Zero-K Dev.
  • Your skirmish/campaign games should now use your modified local copy of zk.sdd. In this mod, the Lotus has 10 times its normal range.

Advanced mutator creation (offline only?)