TF2/Modifying the Respawn Time

From Valve Developer Community
Jump to navigation Jump to search

By default, there is a delay of up to 20 seconds between death and respawn in Team Fortress 2. However, the level designer can designate a custom respawn time for a map, and can even set different respawn times for each team.

Tutorial - Simple Instant Respawn

Solution from joe at joe.to forums

logic_auto

  • Create / edit a logic_auto entity on the map.
  • In the outputs tab of the entity's properties, duplicate the following:
  • OnMultiNewRound, tf_gamerules, setblueteamrespawnwavetime, 0
  • OnMultiNewRound, tf_gamerules, setredteamrespawnwavetime, 0
  • OnMultiNewMap, tf_gamerules, setblueteamrespawnwavetime, 0
  • OnMultiNewMap, tf_gamerules, setredteamrespawnwavetime, 0
  • OnMapSpawn, tf_gamerules, setblueteamrespawnwavetime, 0
  • OnMapSpawn, tf_gamerules, setredteamrespawnwavetime, 0
Rustiznotch-logic auto-instantspawn.jpg
  • Done, unless the map is multi-phase.
  • If the map is multi-phase, create / edit a team_round_timer entity on the map.
  • In the outputs tab of the entity's properties, duplicate the following:
  • On4MinRemain, tf_gamerules, addblueteamrespawnwavetime, 0
  • On3MinRemain, tf_gamerules, addblueteamrespawnwavetime, 0
  • On2MinRemain, tf_gamerules, addblueteamrespawnwavetime, 0
  • On4MinRemain, tf_gamerules, addredteamrespawnwavetime, 0
  • On3MinRemain, tf_gamerules, addredteamrespawnwavetime, 0
  • On2MinRemain, tf_gamerules, addredteamrespawnwavetime, 0
  • OnRoundStart, tf_gamerules, setredteamrespawnwavetime, 0
  • OnRoundStart, tf_gamerules, setblueteamrespawnwavetime, 0
Rustiznotch-team round timer-instantspawn.jpg


Tutorial - Capture Point Instant Spawn

trigger_capture_area

  • Set the 'Name' and not-yet-created 'Control point' values arbitrarily.
  • Set 'Can BLUE Cap?' to 'No'.
  • Set both 'Red Spawn Adjust' and 'Blue Spawn Adjust' to '-20'.
  • Set 'Time to cap (sec)' to '.1'.
  • Make sure the area covers the entire spawn zone, or it is large enough where a player from that team will be forced to capture the area when spawned.
An example trigger_capture_area for the red team.
The trigger_capture_area properties.


team_control_point

  • Set the 'Name' to the arbitrary 'Control point' name you set in the previous step.
  • Set the 'Print Name' to something cool like 'Instant respawn capture point'
  • Set the 'Index' to a unique number, in this case '1' will do.
An example team_control_point for the red team.
The team_control_point properties.


Duplicate

  • Make the same setup for the other team.
  • Note: Copy / Pasting might result in some problems (Red team spawning in blue area)
  • Be sure to change the 'Name' attribute where appropriate. Also, the 'Index' of the team_control_point must be changed to a unique value ('2' would do nicely). A few other attributes must be set to align with the team (see above).
The duplicated respawn.


team_control_point_round

  • Set the 'Name' to something arbitrary.
  • Set 'Priority' to '1'.
  • Set 'Control points in this round' to a space-delimited list of the arbitrary team_control_points 'Names' you defined. For example: 'red_control_point blue_control_point'.
An example team_control_point_round.
The team_control_point_round properties.


team_control_point_master

  • Set the 'Name' to something arbitrary.
An example team_control_point_master.
The team_control_point_master_properties.



Design Theory