Custom Modifiers: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Modifiers are snippets of configuration that partially override the default game config, which makes for some nice match variation in servers. Check the default configuration file <code>Modifiers/_default.json</code> (anything not related to game modes: weapons player movement) as a reference of available parameters. Follow the '''exact''' same structure as in this file - ie. all parameters are within the "Objects" key. To customize game mode configuration, there is th...") |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Modifiers are snippets of configuration that partially override the default game config, which makes for some nice match variation in servers. | Modifiers are snippets of configuration that partially override the default game config, which makes for some nice match variation in servers. | ||
Check the default configuration file <code>Modifiers/_default.json</code> (anything not related to game modes: weapons player movement) as a reference of available parameters. | Check the default configuration file <code>Modifiers/_default.json</code> (contains anything not related to game modes: eg weapons, player movement, ...) as a reference of available parameters. | ||
Follow the '''exact''' same structure as in this file - ie. all parameters are within the "Objects" key. | Follow the '''exact''' same structure as in this file - ie. all parameters are within the "Objects" key. | ||
To customize game mode configuration, there is the special namespace "Objects.Rules". This also allows to load custom scripts, by | To customize game mode configuration, there is the special namespace "Objects.Rules". This also allows to load custom scripts, by adding an object key with the script class name. | ||
Some more hints: | Some more hints: | ||
* You only need to specify the parameter you want to change. Due to some bugs, this does not work for some objects (eg MeleeWeapon). | * You only need to specify the parameter you want to change. Due to some bugs, this does not work for some objects (eg MeleeWeapon) - there all parameters of the object need to be specified. | ||
* Its possible to add or remove elements from lists, instead of replacing the whole default list. To do this, prefix the parameter name with <code>+</code> or <code>-</code> (eg <code>"-PrimaryWeapons": ["Minigun"]</code>). This improves composability of multiple Modifiers. On non-lists, a <code>-</code>-prefix removes the whole element. | * Its possible to add or remove elements from lists, instead of replacing the whole default list. To do this, prefix the parameter name with <code>+</code> or <code>-</code> (eg <code>"-PrimaryWeapons": ["Minigun"]</code>). This improves composability of multiple Modifiers. On non-lists, a <code>-</code>-prefix removes the whole element. | ||
* Changes are applied whenever the file is saved. This works for most parameters, but not all. | * Changes are applied whenever the file is saved. This works for most parameters, but not all. | ||
Line 44: | Line 44: | ||
} | } | ||
</pre> | </pre> | ||
[[Category:Modding]] |
Latest revision as of 17:48, 10 June 2023
Modifiers are snippets of configuration that partially override the default game config, which makes for some nice match variation in servers.
Check the default configuration file Modifiers/_default.json
(contains anything not related to game modes: eg weapons, player movement, ...) as a reference of available parameters.
Follow the exact same structure as in this file - ie. all parameters are within the "Objects" key.
To customize game mode configuration, there is the special namespace "Objects.Rules". This also allows to load custom scripts, by adding an object key with the script class name.
Some more hints:
- You only need to specify the parameter you want to change. Due to some bugs, this does not work for some objects (eg MeleeWeapon) - there all parameters of the object need to be specified.
- Its possible to add or remove elements from lists, instead of replacing the whole default list. To do this, prefix the parameter name with
+
or-
(eg"-PrimaryWeapons": ["Minigun"]
). This improves composability of multiple Modifiers. On non-lists, a-
-prefix removes the whole element. - Changes are applied whenever the file is saved. This works for most parameters, but not all.
- The JSON parser understands JSON2, so trailing commas and comments are allowed.
Example
Example:
{ "Objects": { "Rules": { // customizing game rules parameters "StandardGameplay": { "DamageModifier": 2 }, "-RandomDrops": {} // loading a custom script "MyCustomScript": { "SomeScriptParameter": 1.0 } }, "Gostek": { "PhysicsObject": { "Mass": 0.65, // faster movement by making players lighter } } }, "Meta": { "Description": "this text shows up as a tooltip in the lobby", "Author": "", "Version": "1.0", "Game": "Soldat2", "GameVersion": "0.8.67" } }