[TUTORIAL] Respawn Timers

Kernel

L1: Registered
Nov 7, 2007
35
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:

tut_01.png


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:

tut_02.png


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

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

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:

tut_03.png


"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"
}
{

tut_04.png


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

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

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
 

Kernel

L1: Registered
Nov 7, 2007
35
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.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
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?
 

Kernel

L1: Registered
Nov 7, 2007
35
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.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
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