How to Add Mods to Your Soldat 2 Server ​
Soldat 2 has no workshop and no mod package format. Instead, practically everything that makes up the game exists as an individual file inside the server directory – maps, game modes, modifiers, map cycles and scripts. You upload them via SFTP and hook them up through the configuration or the console.
Warning
Whether custom maps, modifiers and scripts are transferred to your players automatically is not documented. To be safe, also hand the files you upload to the server directly to your players – that way everyone is on the same state.
The folder structure ​
All folders are located in the main directory of your server:
| Folder | Contents |
|---|---|
Levels/ | Maps as JSON files, each inside its own subfolder |
Modifiers/Custom/ | Modifiers – change objects, weapon values and gameplay parameters |
Rules/Custom/ | Game modes and round rules |
Scripts/Custom/ | Custom C# scripts |
Cycles/Custom/ | Map cycles |
Note
Maps in Soldat 2 are .json files – not .pms files like in the first Soldat. Files from the predecessor do not work here.
Add custom maps ​
Download the map
Download the map you want. A large collection can be found attms2.jrgp.org.Stop the server
Stop your server via the dashboard.Upload the map
Upload the map into a subfolder ofLevels/via SFTP, keeping the structure it ships with:Levels/<folder>/<mapname>.jsonStart the server
Start your server.Load the map
Open the console in the game and load the map with a game mode – the game mode is named exactly like the matching file inRules/:rcon loadmap dm_epitaph Deathmatch
Warning
The map name is given without a path and without the .json extension. The spelling is case sensitive – on your Linux server that matters. rcon listmaps shows which maps the server knows about.
Add modifiers ​
Modifiers are the quickest way to change the gameplay: they override the values of objects, weapons and gameplay parameters.
Stop the server
Stop your server via the dashboard.Look at the reference file
Open the fileModifiers/_default.jsonvia SFTP. It contains all default values and serves as a reference – do not edit it.Create your own modifier
Create a new file:Modifiers/Custom/MyModifier.jsonEnter your values
Only enter the values you want to change. The parameters live in the"Objects"section. Everything you leave out keeps its default value.Start the server
Save the file and start your server.Enable the modifier
Open the console and enable the modifier by its file name without.json:rcon addmodifier MyModifier rcon restart
Extend lists instead of replacing them
For values that contain a list you can add or remove single entries instead of rewriting the whole list: a leading + adds an entry, a - removes it.
Warning
rcon addmodifier only takes effect after a rcon restart of the round. Use rcon removemodifier <name> to turn a modifier off again.
Custom game modes through rule files ​
Game modes and round rules are JSON files inside Rules/Custom/. They control, for example, how long a round lasts and how many points are needed to win:
| Key | Meaning |
|---|---|
Match.MatchSecs | Round duration in seconds |
Match.ScoreLimit | Score limit at which the round ends |
GameScript | Name of the C# script loaded for this game mode |
Stop the server
Stop your server via the dashboard.Create a rule file
Copy an existing file fromRules/as a template and save it under a new name:Rules/Custom/MyMode.jsonAdjust the values
Change the values you want.Reference the mode
For your mode to be played, enter its file name without.jsonunder"Rules"in your map rotation – see Set up a map rotation.Start the server
Save the file and start your server.
Tip
You can also test individual rule values while the server is running, without stopping it:
rcon set Match.MinimumPlayers 4Such changes only apply to the running session.
Add custom scripts ​
For custom game logic, Soldat 2 ships a C# scripting system.
Stop the server
Stop your server via the dashboard.Upload the script
Upload your.csfile via SFTP:Scripts/Custom/MyScript.csHook up the script
Reference the script through theGameScriptkey in a rule file insideRules/Custom/. Alternatively you can load it through a modifier.Start the server
Start your server and check the server console in the dashboard to see whether the script compiled without errors.
Tip
When you change a script you do not have to restart the server. The following command recompiles all scripts:
rcon reloadImportant
Scripts run with the permissions of your server. Only install scripts from sources you trust.
Set up a map rotation ​
A map rotation is defined in a cycle file. The server works through the rounds listed in it one after another.
Stop the server
Stop your server via the dashboard.Create a cycle file
Copy an existing file fromCycles/as a template and save it under a new name:Cycles/Custom/MyRotation.jsonAdd the rounds
Every round consists of a game mode ("Rules") and a map ("Level") – both without a file extension:[{ "Rules": "Deathmatch", "Level": "dm_epitaph" }]Enable the rotation
Enter the following values into theautoconfig.ini:GamesCycleFile=Cycles/Custom/MyRotation.json UseLobby=False AllowVoting=FalseStart the server
Save the file and start your server.
Warning
Without UseLobby=False and AllowVoting=False the lobby and player voting override your rotation – the server then jumps to maps other than the ones in your cycle file.
Tip
A rotation can also be loaded while the server is running:
rcon loadcycle Cycles/Custom/MyRotation.jsonCommands while the server is running ​
| Command | Description |
|---|---|
rcon listmaps | Show available maps |
rcon loadmap <mapname> <gamemode> | Load a map with a game mode |
rcon nextmap | Switch to the next map |
rcon addmodifier <name> | Enable a modifier |
rcon removemodifier <name> | Disable a modifier |
rcon restart | Restart the round – required for a modifier to take effect |
rcon loadcycle <file> | Load a map cycle |
rcon reload | Recompile the scripts |
Editing the autoconfig.ini ​
Important
The autoconfig.ini is completely rewritten when the server stops. Any change you write into the file while the server is running is lost in the process. Only edit the file while the server is stopped.
Warning
The values Name, Port, WebSocketsPort, WebSocketsRconPort, RconPassword, MaxPlayers, GreetMessage, AdminPlayfabId and ServerPassword are written from the dashboard into the autoconfig.ini on every server start. These values therefore belong in the dashboard, not in the file.
Tip
Back up your configuration and your custom content before making larger changes: Create Backup.