Difference between revisions of "Custom Modes"

From Zero-K
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Custom modes are mods, maps, or just a set of Adv Options that can be selected when hosting the game or in the battle room via 'Select Custom Mode' in Adv Options. Each custom mode is defined by a file in <code>Zero-K/CustomModes</code>. The game deploys a few of these files, but players can also create their own and share them around to act as presets.
+
Custom modes are mods, maps, or just a set of Adv Options that can be selected when hosting the game or in the battle room via 'Select Custom Mode' in Adv Options. Each custom mode is defined by a file in <samp>Zero-K/CustomModes</samp>. The game deploys a few of these files, but players can also create their own and share them around to act as presets.
  
 
This system can be used to save and share disabled lists and [[Quick Stat Tweaks]] to create new game modes without going through the work of full modding.
 
This system can be used to save and share disabled lists and [[Quick Stat Tweaks]] to create new game modes without going through the work of full modding.
 +
 +
== Sharing Custom Modes ==
 +
 +
Upload your custom modes via the "Upload new game mode" button here: http://zero-k.info/Mods
  
 
== Specification ==
 
== Specification ==
Custom modes are json files and may have the following parameters.
+
Custom modes are <abbr title="JavaScript Object Notation">JSON</abbr> files that may have the following parameters.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 10: Line 14:
 
! Key !! Usage
 
! Key !! Usage
 
|-
 
|-
| shortName || A unique name identifying the custom mode. Do not be change it when making an update, or else duplicate files for old versions will be created. Must match the file name of the mode when uploaded.
+
| shortName || A unique name identifying the custom mode. '''Do not change it when making an update''', or else duplicate files for old versions will be created. Must match the file name of the mode when uploaded.
 
|-
 
|-
 
| name || This is required to display the mode in the mode list. Bad things will happen if there is a clash. Add a version number to the end of this name and increment it upon each update.
 
| name || This is required to display the mode in the mode list. Bad things will happen if there is a clash. Add a version number to the end of this name and increment it upon each update.
Line 16: Line 20:
 
| description || The tooltip for the mode in the 'Select Custom Mode' menu.
 
| description || The tooltip for the mode in the 'Select Custom Mode' menu.
 
|-
 
|-
| roomType || Optional. Can be Custom, 1v1, Team, FFA, Chicken.
+
| roomType || Optional. Can be Custom, 1v1, Team, <abbr title="free for all">FFA</abbr>, Chicken.
 
|-
 
|-
| map || Optional. Use this to set the map. The text must match exactly, as is written below the minimap in the battleroom.
+
| map || Optional. Use this to set the map. The text must match exactly, as is written below the minimap in the battle room.
 
|-
 
|-
 
| game || Optional. Set a mutator or game. It should match game name exactly, as is shown left of the map when the game is selected.
 
| game || Optional. Set a mutator or game. It should match game name exactly, as is shown left of the map when the game is selected.
Line 26: Line 30:
 
| hideFromHostMenu || Optional boolean. This is used to hide a mode from the Game Type menu while hosting.
 
| hideFromHostMenu || Optional boolean. This is used to hide a mode from the Game Type menu while hosting.
 
|-
 
|-
| options || Optional table of Adv Option values. All the keys can be found [https://github.com/ZeroK-RTS/Zero-K/blob/master/ModOptions.lua here].
+
| options || Optional table of Adv Option values. All the keys can be found in the file [https://github.com/ZeroK-RTS/Zero-K/blob/master/ModOptions.lua ModOptions.lua].
 
|}
 
|}
  
 
== Example ==
 
== Example ==
Here is an example that would run Zero Wars with a 2x health multiplier.
+
Here is an example that would run Zero Wars with a health multiplier.
<nowiki>{
+
<syntaxhighlight>{
     "shortName": "zw_hp_tweak"
+
     "shortName": "zw_hp_tweak",
 
     "name" : "Zero Wars with Tweaks v1.0",
 
     "name" : "Zero Wars with Tweaks v1.0",
 
     "description" : "Send waves of units across the map to destroy the enemy nexus",
 
     "description" : "Send waves of units across the map to destroy the enemy nexus",
Line 41: Line 45:
 
         "hpmult" : 2
 
         "hpmult" : 2
 
     }
 
     }
}</nowiki>
+
}</syntaxhighlight>
  
Be careful with the commas in json, as they need to be placed after all but the last item in the set.
+
Be careful with the commas in JSON, as they need to be placed after all but the last item in the set.
  
 
[[Category:Development]]{{Navbox manual}}
 
[[Category:Development]]{{Navbox manual}}

Latest revision as of 01:55, 3 July 2023

Custom modes are mods, maps, or just a set of Adv Options that can be selected when hosting the game or in the battle room via 'Select Custom Mode' in Adv Options. Each custom mode is defined by a file in Zero-K/CustomModes. The game deploys a few of these files, but players can also create their own and share them around to act as presets.

This system can be used to save and share disabled lists and Quick Stat Tweaks to create new game modes without going through the work of full modding.

Sharing Custom Modes

Upload your custom modes via the "Upload new game mode" button here: http://zero-k.info/Mods

Specification

Custom modes are JSON files that may have the following parameters.

Key Usage
shortName A unique name identifying the custom mode. Do not change it when making an update, or else duplicate files for old versions will be created. Must match the file name of the mode when uploaded.
name This is required to display the mode in the mode list. Bad things will happen if there is a clash. Add a version number to the end of this name and increment it upon each update.
description The tooltip for the mode in the 'Select Custom Mode' menu.
roomType Optional. Can be Custom, 1v1, Team, FFA, Chicken.
map Optional. Use this to set the map. The text must match exactly, as is written below the minimap in the battle room.
game Optional. Set a mutator or game. It should match game name exactly, as is shown left of the map when the game is selected.
rapidTag Optional. Set a rapid tag. Modes that use base Zero-K should set this to "zk:stable".
hideFromHostMenu Optional boolean. This is used to hide a mode from the Game Type menu while hosting.
options Optional table of Adv Option values. All the keys can be found in the file ModOptions.lua.

Example

Here is an example that would run Zero Wars with a 2× health multiplier.

{
    "shortName": "zw_hp_tweak",
    "name" : "Zero Wars with Tweaks v1.0",
    "description" : "Send waves of units across the map to destroy the enemy nexus",
    "roomType" : "Team",
    "map" : "ZeroWars v2.0.7",
    "rapidTag" : "zk:stable",
    "options" : {
        "hpmult" : 2
    }
}

Be careful with the commas in JSON, as they need to be placed after all but the last item in the set.