Thread: Setting up "Survival Mode" for a map

Results 1 to 6 of 6
  1. #1
    Administrator JPolito's Avatar  
    Manager
    Join Date
    Apr 2004
    Posts
    7,525

    Setting up "Survival Mode" for a map

    Introduction

    Survival mode offers an interesting alternative to the typical spawn-die-respawn-repeat gameplay of many Sven Co-op maps. About 30 seconds after the map starts it disables spawn points, and any 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.

    Everything that a mapper or server operator needs to enable survival mode comes packaged with Sven Co-op by default. You can add survival mode to any map, regardless of whether or not you are an experienced level designer. This guide explains the process.

    Setting up survival mode in a map involves two steps:
    1. Enabling the survival mode script
    2. Placing respawn checkpoints






    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:
    Code:
    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:

    Code:
    @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. This is the method that was utilized to place checkpoints in sc_another and YABMA, as the map source files are not available.

    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".

    Code:
    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 X-Y-Z coordinates of your position on the 'map' line. Scroll down to the bottom of the ENT file and add the following:

    Code:
    {
    "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".

    Code:
    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.



    Map Configuration File CVARs

    As of Sven Co-op 5.11, several CVARs are available for map configuration files that can be used to control the behavior of Survival Mode when a map starts or ends.

    • mp_survival_supported - If set to '1', this tells the game that Survival Mode is supported by the map. This enables Survival Mode voting and toggling capabilities.
    • mp_survival_starton - If set to '1', Survival Mode will auto-start after the map loads. If set to '0', Survival Mode will be 'off' when the map starts. This is useful for maps that want to turn Survival Mode on at a later point in the map.
    • mp_survival_startdelay - Delay (in seconds) before survival mode starts.
    • mp_survival_nextmap - Specifies the name of the next survival map in a series. This is useful if you have multiple maps in a series where Survival Mode settings should be carried across level changes.
    Last edited by JPolito; 08-04-2017 at 12:49 AM.

  2. #2
    Mapper, Novice Modder Merz's Avatar
    Join Date
    Feb 2015
    Posts
    42

    Re: Setting up "Survival Mode" for a map

    Oh my god. I didn't think it'd be this simple.

    Thank you so much.

  3. #3
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,466

    Re: Setting up "Survival Mode" for a map

    Stickied, 'cause we want more survival maps.

  4. #4
    Server Owner Enrory's Avatar
    Join Date
    Dec 2016
    Location
    Austria
    Posts
    111

    Re: Setting up "Survival Mode" for a map

    Hy i try the secound version.

    So i switch the bsp file in the bat file.
    I become not a ent file!
    In console write this.

    \sven\svencoop\maps>Ripent.exe -export 1
    bspfile '1.bsp' does not exist
    ripent v3.4-VL34-SC5.0 32-bit (Jan 2 2016)
    Zoner's Half-Life Compilation Tools -- Custom build for Sven Co-op 5.0
    Based on code modifications by Vluzacn (VL34)
    Based on code modifications by Sean 'Zoner' Cavanaugh (3.4)
    Based on Valve's version, modified with permission.
    Submit detailed bug reports to http://forums.svencoop.com

    -= ripent Options =-

    -console # : Set to 0 to turn off the pop-up console (default is 1)
    -lang file : localization file
    -export : Export entity data
    -import : Import entity data

    -parse : Parse and format entity data

    -textureexport : Export texture data
    -textureimport : Import texture data
    -textureparse : Parse and format texture data

    -writeextentfile : Create extent file for the map
    -deleteembeddedlightmaps : Delete textures created by hlrad
    -texdata # : Alter maximum texture memory limit (in kb)
    -lightdata # : Alter maximum lighting memory limit (in kb)
    -chart : Display bsp statitics
    -noinfo : Do not show tool configuration information

    -pause : Pause before exit

    mapfile : The mapfile to process


    C:\server\sven\svencoop\maps>Pause
    Drücken Sie eine beliebige Taste . . .

    help pls
    Last edited by Enrory; 15-02-2017 at 06:48 AM.

  5. #5
    Registered User
    Join Date
    Nov 2014
    Location
    around.
    Posts
    392

    Re: Setting up "Survival Mode" for a map

    Quote Originally Posted by Enrory View Post
    Hy i try the secound version.

    So i switch the bsp file in the bat file.
    I become not a ent file!
    In console write this.

    \sven\svencoop\maps>Ripent.exe -export 1
    bspfile '1.bsp' does not exist
    Ripent is telling you what the problem is right there, it can't process your map because you didn't specify your map name in the arguments.

    The correct syntax is:

    ripent -export mapname.bsp

    So for what you entered, it was looking for the map named "1" and of course, it couldn't find it. If you are using the technique detailed in the post above, leave the contents of the .bat file exactly as they are written above, then select your map.bsp and drag and drop it onto your batch file which should then process it. Pretty sure that's what the %1 does, passes the name of the dropped file as an argument to the ripent command.

    If you prefer the standard way, without batch files, you can create a new folder in C:/ then put your map and a copy of ripent into it, open a command prompt (from your Start Menu), navigate into your new folder using DOS commands (e.g. cd.. then cd c:\newfolder where newfolder is the name of the folder you created) and then run ripent, passing it the mapname and either -export or -import, e.g. ripent -export mapname.bsp where mapname is the name of your map. Finally close the command prompt window by entering the command exit.
    Last edited by BlueSpark; 15-02-2017 at 12:41 PM. Reason: addendum.

  6. #6
    Server Owner Enrory's Avatar
    Join Date
    Dec 2016
    Location
    Austria
    Posts
    111

    Re: Setting up "Survival Mode" for a map

    ok thanks! But the next problem is that send no coordinates.

    show me that

    ] status
    hostname: Cosmoline[HALF-LIFE/BLUE SHIFT/OPP FORCE][SURVIVAL ANTI RUSH]
    version : 48/5.0.0.0 7385 secure (225840)
    tcp/ip : 10.0.0.140:27033
    map : of2a1b at: 0 x, 0 y, 0 z
    players : 1 active (8 max)

    Edit: I found another way!
    Last edited by Enrory; 15-02-2017 at 05:41 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •