Map Configuration Creation (Outdated) - Mantibro/SlashCo GitHub Wiki
Preface
This serves as the documentation for all valid fields within a SlashCo config file for any map. All fields should be assumed to be required unless explicitly stated otherwise. If you attempt to load into a map and it kicks you back to the spawn room map, please check your console, where any errors with your config will be printed. All map configs should be placed in lua/slashco/configs/maps
as .lua
files, either in gmod's lua folder or as a filesystem addon in the addons folder. These should be compatible as workshop items as well, if you choose to upload them.
Starting A Map In Debug Mode
After you have created your config file it is advised to load it in debug mode to ensure all positions and angles are correct for each entry. You can do this by following these steps:
- Load the sc_lobby map in the SlashCo gamemode
- Execute
slashco_debug_datatest_makedummy
. This will make a dummy SQL database so that the map will not kick you back to the lobby upon loading in. - Execute
changelevel
to the map you wish to test for - Once you have loaded in, execute
debug_config
This will spawn every item in every available spot so you can visually confirm that nothing has gone wrong and that there are no duplicate spawns or physics "funnies". As a Spectator you can left click on a spawned entity to print its Spawnpoint ID in chat.
Configuration Entries
Each section will be listed as a subsection when needed, and represents the nesting in the json file itself. An example of this would be the Spawnpoints section, under which are two subsections: Survivor and Slasher. This would indicate that the correct entry statement for these is like so:
{
"Spawnpoints": {
"Survivor": {},
"Slasher": {}
}
}
-
Manifest
"Manifest": {
"Name": "Example",
"Author": "Author of the Map",
"Default": true,
"Size": 1,
"MinimumPlayers": 1,
"Levels": {
"1": 0,
"2": 250
}
}
-
Name - The display name of your map.
-
Author - Name of the map's author.
-
Default - If set to
false
, the map will only be playable with the commandslashco_map_default
set to 1. -
Size - An
integer
value ranging from 1 to 4, which affects gameplay elements such as extra Fuel Can spawns, and certain slasher powers. -
MinimumPlayers - The minimum amount of Survivors required for the map to be randomly selected (Map Guarantee will bypass this).
-
Levels - A list of Z coordinate values which will be used for calculating random, but accessible positions around the map. They should be roughly 50-100 units above a walkable floor, or higher if you wish to account for terrain displacement. Setting them too high may result in players or entities appearing on rooftops if your map has those.
You will need multiple of them if, for example, your map has underground areas. It should be a level with as little out of bounds space as you can find.
WARNING! Setting Levels incorrectly may cause the game to crash due to infinite loops.
-
Spawnpoints
- Survivor
- This contains ordered sub-tables of a position vector,
pos
, and a yaw angle,ang
, that acts as potential spawns for survivors. Make sure to make excess spawnpoints to future-proof the config. - Example usage:
"Spawnpoints": { "Survivor": { "1": { "pos": [0, 0, 0], "ang": 0 }, "2": { "pos": [20, 20, 0], "ang": 45 } } }
- This contains ordered sub-tables of a position vector,
- Slasher
- This is the same as the survivor spawnpoints but with
Slasher
in place ofSurvivor
, and it is encouraged to create multiple spawnpoints to increase variety in map rollouts, as well as account for the possibility of multiple slashers.
- This is the same as the survivor spawnpoints but with
- Survivor
-
Generators
- Count [int]
- This tells the gamemode how many generators to spawn per match and is a simple
integer
value.
- This tells the gamemode how many generators to spawn per match and is a simple
- Spawnpoints
- This contains ordered sub-tables of a position vector,
pos
, and an angle vector,ang
, that acts as potential spawns for generators. There must be as many spawns as the value ofCount
, but it is highly encouraged to have at least 5 to 8 generator spawnpoints on the map in order to increase variety in replays. - Example Usage:
"Generators": { "Count": 2, "Spawnpoints": { "1": { "pos": [0, 0, 0], "ang": [0, 0, 0] }, "2": { "pos": [200, 200, 0], "ang": [0, 90, 0] } } }
- This contains ordered sub-tables of a position vector,
- Count [int]
-
Batteries
- Spawnpoints
- This contains ordered sub-tables, which in themselves have sub-tables. Each index of the first layer corresponds to the generator spawnpoints made in the last section. The inner layer is a table consisting of a position vector,
pos
, and a yaw angle,ang
, that acts as potential spawns for the batteries around that generator. This must be done for every generator spawnpoint that is defined. This essentially defines all the hiding spots near a generator's spawnpoint that the battery can be in. - Example usage (using the generator example from above):
"Batteries": { "Spawnpoints": { "1": { "1": { "pos": [10, 0, 0], "ang": [0, 45, 0] }, "2": { "pos": [0, 10, 0], "ang": [0, 0, 0] }, "3": { "pos": [10, 10, 0], "ang": [0, 90, 0] } }, "2": { "1": { "pos": [210, 200, 0], "ang": [0, 45, 0] }, "2": { "pos": [200, 210, 0], "ang": [0, 0, 0] }, "3": { "pos": [210, 210, 0], "ang": [0, 90, 0] } } } }
- This contains ordered sub-tables, which in themselves have sub-tables. Each index of the first layer corresponds to the generator spawnpoints made in the last section. The inner layer is a table consisting of a position vector,
- Spawnpoints
-
Helicopter
- IntroLocation
- This contains a position vector,
pos
, and an angle vector,ang
, that determines where the helicopter lands to drop off the survivors. This should be nearby the survivor spawnpoints defined earlier to maintain continuity.
- This contains a position vector,
- StartLocation
- This contains a position vector,
pos
, that determines where the helicopter flies to and from at the beginning and end of a round, before promply despawning. Should be in the sky and near the border of the map, if possible.
- This contains a position vector,
- Spawnpoints
- This contains ordered sub-tables containing a position vector,
pos
, and an angle vector,ang
, that determines where the helicopter can appear at the end of a game when the survivors need to escape. Should be easily accessible and in an area that makes sense for a helicopter to land.
- This contains ordered sub-tables containing a position vector,
- Example Usage for the
Helicopter
table fromsc_hospital
:"Helicopter": { "IntroLocation": { "pos": [-2207, -1098, 68.85408782959], "ang": [0, -180, 0] }, "StartLocation": { "pos": [850, -4442, 2349] }, "Spawnpoints": { "1": { "pos": [-2305, -563, 2.6505670547485], "ang": [-1, 179, -1] }, "2": { "pos": [-2333, 566, 1344.4990234375], "ang": [-1, 48, 0] } } }
- IntroLocation
-
GasCans
- Count [int]
- This is a simple
integer
value that tells the map how many gas cans to spawn. This should be AT LEAST4 * Generator Count
or the config will fail to load.
- This is a simple
- Spawnpoints
- This contains ordered sub-tables of a position vector,
pos
, and an angle vector,ang
, that acts as potential spawns for gas cans. - There are typically ~100 spawnpoints defined in official maps if you need a benchmark.
- Example Usage:
"GasCans": { "Count": 8, "Spawnpoints": { "1": { "pos": [0, 0, 0], "ang": [0, 0, 0] }, "2": { "pos": [20, 20, 0], "ang": [0, 45, 0] } } }
- This contains ordered sub-tables of a position vector,
- Count [int]
-
Items
- IncludeGasCanSpawns [bool]
- This is a simple
boolean
value. It determines whether or not Items can spawn in the same spawnpoints as gas cans do (assuming the spot isn't already taken)
- This is a simple
- Spawnpoints
- This contains ordered sub-tables of a position vector,
pos
, and an angle vector,ang
, that acts as potential spawns for items. - There are typically ~100 spawnpoints defined in official maps if you need a benchmark.
- Example Usage:
"Items": { "Spawnpoints": { "1": { "pos": [0, 0, 0], "ang": [0, 0, 0] }, "2": { "pos": [20, 20, 0], "ang": [0, 45, 0] } } }
- This contains ordered sub-tables of a position vector,
- IncludeGasCanSpawns [bool]
-
Offerings
- Exposure (Optional)
- Spawnpoints
- This contains ordered sub-tables of a position vector,
pos
, and an angle vector,ang
, that acts as potential spawns for gas cans if the Exposure offering is active. This is optional, but without it, the Exposure offering will do nothing. These spawnpoints are exclusive to the Exposure offering. - Example Usage:
"Offerings": { "Exposure": { "Spawnpoints": { "1": { "pos": [0, 0, 0], "ang": [0, 0, 0] }, "2": { "pos": [20, 20, 0], "ang": [0, 0, 0] } } } }
- This contains ordered sub-tables of a position vector,
- Spawnpoints
- Exposure (Optional)
Example Configs
Please review the configs shipped with SlashCo to resolve any confusion, as they list all these entries. lua/slashco/configs/maps If, even after all of this, you are still confused, please contact a member of the development team in the SlashCo discord in the appropriate channel.