-
Notifications
You must be signed in to change notification settings - Fork 13
Authoring maps for SourceCoop
Are you looking to create a multiplayer map or campaign, which is more exciting than deathmatch?
Add any NPC, unlock missing mechanics from singleplayer and more?
Perhaps you'd like to have your levels hosted on a server, so you don't have to play them alone.
We've got you covered.
In this guide, we show examples using Compile Pal. It's an indispensable tool with modern user interface that can compile your maps, pack in custom content and much much more.
The steps are identical to a typical installation on a server. The only difference is, you'll be using your game instead.
- Download required archives as written in the guide.
- Extract all downloaded archives under "Black Mesa/bms".
Tip: to uninstall, just delete the Black Mesa/bms/addons folder.
This will let the mod know, that it's a co-op map.
- It's easiest to start with the provided sample. Save it as "Black mesa/bms/maps/your_map_name.edt".
- Edit "chapter" with the name you want your map to be displayed as. If you're making a multi-chapter campaign, you may also edit "campaign".
- You can keep adding to it during the development of your map, or leave it as is. EDT reference
SourceCoop requires running in multiplayer mode. To do this, open the console and execute following:
-
disconnect
- will stop any background maps so we're allowed to change maxplayers -
maxplayers 2
- tells the game to start maps in multiplayer mode -
sv_lan 1
- tells the game to start maps in LAN only, VAC-less mode -
map <your_map_name>
- starts the map
If your map has started and you see SourceCoop messages in chat or console, everything is fine. Otherwise, you might have done something incorrectly.
You may also automate this:
- In launch options / Hammer / CompilePal configs:
- With old UI:
-oldgameui -dev +maxplayers 2 +sv_lan 1
- With new UI:
-dev +maxplayers 2 +sv_lan 1
- With old UI:
While we haven't had any issues, and many people have used this method before, technically Sourcemod/Metamod do add custom DLLs to your game. By launching with
-insecure
, you can be sure you won't ever get a VAC Ban if Valve changes their mind. This will prevent you from playing on secured servers though. In any case, you can always stop the mod from loading by renaming the addons folder.
Adding
-dev
to launch options prevents background maps from loading, which, in multiplayer, can lead to unforseen consequences, er bugs.
Compile Pal has a useful parameter called Hijack, which automatically restarts the map in game after it's done compiling.
As you can see above, many parameters are already predefined, so we add the remaining manually.
There is a variable length player wait timer at the beginning of each map. Once all players fully connect or the timer runs out, the coop map starts. You can trigger entity outputs on this event by using the delay_output
edt function.
What players see or can do during the timer is configured by the intro_type
edt parameter.
Players will spawn at info_player_start if use_map_spawnpoint
is set in edt. Otherwise, define first checkpoint to be the spawn point.
It is recommended to manually define checkpoints in edt. Many additional features can be used this way.
However, simple checkpoints can be entity based if use_map_autosave
is set. This way, all trigger_autosave entities are imported as checkpoints. When first touched by player, the location and angles are saved and the checkpoint is activated.
Transitioning to new maps is similar to singleplayer - by trigger_changelevel
with some differences.
Entities and player location are not currently transitioned. Only the player state (health, suit, items) is, if enabled.
Using the ChangeLevel
input changes level instantly, however if using as a touch trigger, a variable length timer is displayed that reacts to the number of players that touched it.
To end the current map / map series and allow new one to start, use game_end
entity.
New input EnableAll has been added.
If no activator is found with input Enable, all players will be affected.
Disable input targets all players.
New input ZoomAll has been added.
If no activator is found with input Zoom/UnZoom, all players will be affected.
New input ModifySpeedAll has been added.
New input CommandAll has been added.
Input CommandAll with give
command has special handling. All players will be equipped with the item and the item is saved for subsequent spawns.
This entity will kill the activating player and fade their screen.
This entity may be used to trigger respawning dead players in survival mode (as long as respawns are enabled).
Any model can be used for NPCs by specifying the custommodel
property on the entity. Keep in mind the default NPC models carry a lot of information, like sounds, animation events that are used by game code, etc. The overriding model's activity names should correspond as well.
- env_screenoverlay shows to all players once activated
- player_speedmod with suppress HUD flag breaks the HUD
- Do not set GameEndAlly on NPCs
- Some entities with "loop move sound" set never stop playing the sound
- Anything else listed under Issues.
Once you are ready to publish the map, pack the .edt file in.
Below is a guide for packing an .edt file to a .bsp file using Compile Pal:
- Select a config on the left side that you want to use.
- Click "ADD" button at the process selector and choose "PACK" by double-clicking it.
- Now choose "PACK" at the process selector and click "Add" button at parameters box.
- Choose "Include" by double-clicking it.
- Click "..." button at "VALUE" column. Choose your .edt file. It must be under the game's maps folder in order for Compile Pal to fixup the path.
- Click the compile button. Your map will be packed with found custom content and the config file. You can customize this further by adding more parameters.
Remove or move the .edt file from "Black Mesa\bms\maps" and start the map normally.
The workshop support for servers in Black Mesa is limited. It is possible for the server to automatically download and update its workshop items. However, it can't force players to subscribe to them. They would, if at all, attempt to very slowly download the map directly from the server, if not already subscribed. This creates an issue if the player has previously downloaded a map from the server and it has been updated on the workshop in meantime. They would be unable to play. There are 3 possible solutions to this:
- 🛑 Discouraged!
Rely on the slow downloads directly from the server. You must version your map with each workshop update. Any content you pack inside .vpk will be lost, since only .bsp is downloaded to players. To use this method, add
"allow_server_download" "1"
to the config section in your edt. - ✔️ Rely on the workshop kicker addon we include with SourceCoop. This detects players who are missing the map and kicks them even before they begin downloading it with a custom message that server operators can customize. This allows them to point to a collection they're running that the player has to manually subscribe to.
- ✔️ Do not host your map on the Workshop. This brings us to the next section...
Advantages: download speed, saved server bandwidth, ease of use server side, automatic updates and ability to pack custom content in .VPKs.
Publish your map on any website, for example Gamebanana. Server operators can then easily download the map, manually update it and host it on their own fast-download server. You must version your map for all updates you publish. You can't pack custom content inside .vpk. You must pack it inside .bsp, since only it is downloaded to players.
Advantages: players automatically download the map and don't have to subscribe to workshop items before connecting.