Sven Co-op

Sven Co-op

75 ratings
How to set up 'Survival Mode' with 'Respawn Checkpoints' in any map
By JPolito
This guide describes how to enable and set up "Survival Mode" with respawn checkpoints in any map. You can use this guide to set up survival mode in a map that already exists, or to set it up in a totally new map that you are making from scratch.
   
Award
Favorite
Favorited
Unfavorite
Enabling the "Survival Mode" script for a map
Find the map's CFG file in the svencoop/maps folder. It should have the same name as the BSP file. If the file doesn't exist, just make a new TXT file with the name of the BSP and rename the extension to 'cfg'.

In the CFG file, add the line:
map_script survival_generic



This tells the map to load scripts/maps/survival_generic.as on startup.

This script also runs Survival.as, which lays down gameplay rules for survival mode, and point_checkpoint.as, which gives checkpoint entities their functionality.

With these scripts enabled, about 30 seconds after the map starts, respawning will be disabled and all players who die will be placed into 'observer mode' until a checkpoint is reached or all players are dead, at which point a vote will be called to either restart the map or change the level.
Adding checkpoints with Hammer (for custom maps)
If you're making a map and you have all of the source files, it is obviously a better idea to add checkpoint entities in the RMF file and compile the map with them than it would be to add checkpoints with Ripent after the map is already compiled.

You really don't need to load a special FGD to add a checkpoint to a map. However, if you'd like to be able to select the entity from the dropdown list of entities, or to see a model preview of the entity in Hammer's 3D view window, you'll need to make an FGD or add an entry to the Sven Co-op FGD.

The FGD entry that I use is as follows:

@PointClass base(Targetname) studio("models/common/lambda.mdl") size(-8 -8 -8, 8 8 8) = point_checkpoint : "A respawn checkpoint" []

If you don't do this step, it will show up as a pink box in Hammer's 3D view, and you'll just have to manually type "point_checkpoint" into the "Class" text entry box when creating the entity. No big deal. It will work the same.



All of the checkpoint entities in Sven Co-op's Half-Life maps are 48 units off of the ground, and will hover in the air at any height that you place them.

Now compile the map, and you're good to go.
Adding checkpoints with Ripent (for already-compiled maps)
Ripent is a very powerful tool that allows server operators to customize a map without forcing players to redownload the bsp, and will not result in "Map differs from server" errors when a player who already has the unmodified version of the map tries to connect to the server.

Ripent allows you to export a map's entity data, modify it, and put it back into the map. Sven Co-op includes Ripent.exe in the svencoop/maps folder.

Because it requires a command prompt to operate, I prefer to use batch files to export/import the entity data. Setting this up allows you to drag and drop a BSP or ENT file onto the batch file and convert the files without typing a bunch of stuff into a command prompt.

It is also a good idea to make a separate 'ripent' folder, containing ripent.exe, your batch files, and whatever ENT or modified BSP files you're working on. Otherwise they just get mixed up in the maps folder.

In the same folder as ripent.exe, make a batch (.BAT) file to export the map's entity data to a .ENT file. Below is an example of my 'export' batch file, named "BSP_2_ENT.bat".

ripent.exe -export %1 pause

Drag and drop the desired BSP file onto this batch file to export it to an ENT file. In this case, I'm adding checkpoints to svencoop1.bsp.



Next, open the ENT file in a text editor.



The ENT file is literally a text list of every single entity in the map and all of their keyvalues. You can change any existing entity or add new ones. The only restriction is that you cannot add new brush models to a map that has already been compiled. You can only re-use brush models that are already in the map. But, since we're only adding checkpoints, that doesn't matter to us.

All you need to do now is insert "point_checkpoint" entities. First, though, you need to find coordinates where you'd like to add a checkpoint. Play through the map and find events where a lot of players might typically die. It is generally a good idea to place checkpoints after these events. When you reach a good checkpoint position, enter "status" into the console to get the coordinates where you're going to place the checkpoint.



You can see the XYZ coordinates of your position on the 'map' line. Scroll down to the bottom of the ENT file and add the following:

{ "origin" "<X> <Y> <Z>" "classname" "point_checkpoint" }

Where <X> <Y> <Z> are the coordinates, without the <> brackets.

Example:


Once you're done adding checkpoints, make a batch file to import the map's entity data from the .ENT file back into the .BSP. Below is an example of my 'import' batch file, named "ENT_2_BSP.bat".

ripent.exe -import %1 pause

Make sure the BSP is in the same folder as the ENT file, then drag and drop the ENT file into the import batch file.



The BSP file should now have a checkpoint entity at the coordinates specified in the ENT file. Load it up in-game to check.



And there it is. Easy.
24 Comments
Sexual Assault Jan 3, 2023 @ 3:47am 
Does OF and BS have checkpoints?
ChangedMyName Aug 3, 2021 @ 12:55pm 
How do you spawn a "point_checkpoint" via a trigger so it can't be used from the start?
Real BOY May 14, 2021 @ 4:36am 
how to disable survival mod?
PsxMicha Dec 1, 2020 @ 2:14am 
can I change stuff like number of lives? number of retries?
JPolito  [author] Sep 1, 2018 @ 3:21pm 
Survival mode makes it so that if all players die, the map is over and they must restart. Checkpoints are respawn points that allow dead players to respawn at their position, but only if a living player touches it.
maxine64 Aug 27, 2018 @ 4:00pm 
After applying this mod, what are its effects?
JPolito  [author] Aug 26, 2018 @ 3:06pm 
No, checkpoints do not save or load anything. I don't understand what you're asking.
maxine64 Aug 26, 2018 @ 1:45pm 
Yes I know, but I'm asking after using this tutorial, if it does?
JPolito  [author] Aug 25, 2018 @ 1:26pm 
Checkpoints do not currently have any save/load functionality. They only function as respawn points for people who are dead at the time of gameplay.
maxine64 Aug 19, 2018 @ 12:12pm 
Does it reset the map to the checkpoint resetting all enemies? Or does it just respawn players?