[TUTORIAL] Respawn Timers

Discussion in 'Tutorials & Resources' started by Kernel, Jan 18, 2008.

  1. Kernel

    Kernel L1: Registered

    Messages:
    35
    Positive Ratings:
    2
    Respawn Wave timers are coded within the logic_auto entity on stock maps. You can set both teams evenly, or
    make the attackers have a slightly less respawn time, or only the defenders. Just make sure you think about
    it alot, before adding this to your map. The following is a brief description on how to add them to a stock
    map, or to be used within your custom maps.

    Part One: Modifying a stock or custom.bsp
    --------------------------------------------------------------

    // cp_dustbowl is used in this example:

    First you will need: Ented

    All you need to do is place your map over Ented and unclick, as shown:

    [​IMG]

    Click edit, find [ctrl+F] in Ented and search for: logic_auto, you'll have this as an entry:

    "classname" "logic_auto"
    "hammerid" "4877117"
    "OnMapSpawn" "tonemap_global,SetAutoExposureMin,.7,0,-1"
    "OnMapSpawn" "tonemap_global,SetAutoExposureMax,1.1,0,-1"
    "OnMapSpawn" "tonemap_global,SetBloomScale,.3,0,-1"
    "OnMapSpawn" "tf_gamerules,SetBlueTeamGoalString,#Dustbowl_blue_setup_goal,0,-1"
    "OnMapSpawn" "tf_gamerules,SetRedTeamGoalString,#Dustbowl_red_setup_goal,0,-1"
    "OnMapSpawn" "tf_gamerules,SetRedTeamRole,1,0,-1"
    "OnMapSpawn" "tf_gamerules,SetBlueTeamRole,2,0,-1"
    }
    {

    The added code has to be used before the closed bracket, and after the "logic_auto"

    // here is cp_dustbowl with a 6-second respawn:

    "classname" "logic_auto"
    "hammerid" "4877117"
    "OnMapSpawn" "tonemap_global,SetAutoExposureMin,.7,0,-1"
    "OnMapSpawn" "tonemap_global,SetAutoExposureMax,1.1,0,-1"
    "OnMapSpawn" "tonemap_global,SetBloomScale,.3,0,-1"
    "OnMultiNewRound" "tf_gamerules,setblueteamrespawnwavetime,3,0,-1"
    "OnMultiNewRound" "tf_gamerules,setredteamrespawnwavetime,3,0,-1"
    "OnMultiNewMap" "tf_gamerules,setblueteamrespawnwavetime,3,0,-1"
    "OnMultiNewMap" "tf_gamerules,setredteamrespawnwavetime,3,0,-1"
    "OnMapSpawn" "tf_gamerules,setblueteamrespawnwavetime,3,0,-1"
    "OnMapSpawn" "tf_gamerules,setredteamrespawnwavetime,3,0,-1"
    "OnMapSpawn" "tf_gamerules,SetBlueTeamGoalString,#Dustbowl_blue_setup_goal,0,-1"
    "OnMapSpawn" "tf_gamerules,SetRedTeamGoalString,#Dustbowl_red_setup_goal,0,-1"
    "OnMapSpawn" "tf_gamerules,SetRedTeamRole,1,0,-1"
    "OnMapSpawn" "tf_gamerules,SetBlueTeamRole,2,0,-1"
    }
    {

    Here is what you should have in ented:

    [​IMG]

    // The lines that have been added and or replaced:

    Now for the respawn conversion, you'll notice the three variables at the end of each command.

    3,0,-1 // in this example will give a 6 second respawn, as the time is doubled in-game.
    0,0,-1 // would give you instant-respawn

    This is all that's needed for a standard map, but for dustbowl, and any other multi-round maps,
    you will also need to add a few extra lines under the team_round_timer entity.

    Here is what you should have in ented:

    [​IMG]

    "classname" "team_round_timer"
    "hammerid" "2037128"
    "OnFinished" "end_of_game,RoundWin,,0,-1"
    "OnSetupFinished" "relay_stage1_gates,Trigger,,0,-1"
    "OnSetupFinished" "relay_stage2_gates,Trigger,,0,-1"
    "OnSetupFinished" "relay_stage3_gates,Trigger,,0,-1"
    "On5MinRemain" "5minutes_warning,PlaySound,,0,-1"
    "On4MinRemain" "tf_gamerules,addblueteamrespawnwavetime,-1,0,-1"
    "On3MinRemain" "tf_gamerules,addblueteamrespawnwavetime,-2,0,-1"
    "On2MinRemain" "tf_gamerules,addblueteamrespawnwavetime,-3,0,-1"
    "On4MinRemain" "tf_gamerules,addredteamrespawnwavetime,-1,0,-1"
    "On3MinRemain" "tf_gamerules,addredteamrespawnwavetime,-2,0,-1"
    "On2MinRemain" "tf_gamerules,addredteamrespawnwavetime,-3,0,-1"
    "OnRoundStart" "tf_gamerules,setredteamrespawnwavetime,4,0,-1"
    "OnRoundStart" "tf_gamerules,setblueteamrespawnwavetime,4,0,-1"
    }
    {

    [​IMG]

    // The lines that have been added and or replaced:

    That's all the modifications that the map needs, now all you need to do is save
    through Ented and update the server, with the new .bsp!


    Final Notes:

    1. Use caution when modifying maps this way, always have a backup before making any modifications.
    2. If you are modifying stock maps, you'll need to remodify after any map specific updates by valve.
    3. If you plan on doing this on a remote server, create an "oem" folder under: tf2/maps on the server.

    Drag your oem maps to the oem folder, upload to the modified maps to the standard "maps" directory.

    4. This will not effect clients with standard maps, they will not have to dl the modified.bsp's [this is server side, and will force the respawn timer, no need to have any plugins or mods installed.

    5. This will work on windows and linux servers. To see this in use:

    66.55.131.26 [8-second respawn] linux server
     
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,517
    I don't like people who modify the gameplay of an existing map... whoever made it made it the way they want it to be.
     
    • Thanks Thanks x 1
  3. Kernel

    Kernel L1: Registered

    Messages:
    35
    Positive Ratings:
    2
    that's why i wrote...think about doing it, before actually doing it. I agree, but i have been asked several times on this subject, now i only need type in one url.
     
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,517
    I'd just ignore them and say they shouldn't be doing it :D
     
  5. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,739
    for the stock maps is this a server thing or a client thing. If I remove respawn time on the stock maps saved on my pc will I respawn instantly on servers running stock maps? If so this is a hack and should not be publisised?
     
  6. Kernel

    Kernel L1: Registered

    Messages:
    35
    Positive Ratings:
    2
    This is a server side mod, that does not effect the client files in anyway. If you do this on a server the client can use his standard file, and you can force a change in the respawn to all clients. This way the client does not need to dl a modified map. You can also use this to force respawn in a custom map prior to release. I present this info based on differences in maps. For example in the toysoldiers mod, it takes 10 sec. just to get out of the spawn areas, so a standard respawn time does not do justice, you could have instant respawn on that type of map, because it still takes time to get to a fighting area.

    It's not a hack, because you can't use a modified .bsp and go into a standard server, it's just a way of customizing your own server, without the need for additional plugins.
     
  7. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,739
    The last sentence is what I was looking for, I was worried this would be a blit like that "replace the textures with see though ones" hack