Team control point master: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
 
(31 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{wrongtitle|title=team_control_point_master}}
{{this is a|logical entity|game=Team Fortress 2|name=team_control_point_master}}
{{stray ent|{{hl2dm}}}}


== Entity description ==
==Entity description==
Control point master. <!-- The one who plays with the puppets -->
This entity controls all the control points in a map. It is responsible for the layout of the hud icons as well as some round specific settings. [[team_control_point_round|team_control_point_round]] entities will override settings if they are used.
<br>Request: can somebody add a little more info here: what does this entity do? What is the entity used for? A: (edit, please) This entity is used to tailor the control point map style and act as a central hub to which all control points answer. For instance: If one was making a map in which the first and second red, and first and second blue control points were locked, but capturing the middle was open, then the caplayout function would be used and a hierarchy tree would be made<2, 0 1 3 4>.  Use it to switch teams, or control point styles.  Exploring this entity is essential, and even the simplest cp_ map should have one.


== Availability ==
==Keyvalues==
This point [[entity]] is exclusive to Team Fortress 2.
{{KV Targetname}}
{{KV StartDisabled}}
{{KV|Material for the RED Base icon|intn=team_base_icon_2|material|The default material used for HUD icons for control points owned by RED}}
{{KV|Material for the BLUE Base icon|intn=team_base_icon_3|material|The default material used for HUD icons for control points owned by BLU}}
{{KV|Cap Layout|intn=caplayout|string|A string that tells the HUD how to lay out the cap points. It should be a string with indexes of cap points separated by commas to denote a new line. So <code>2,0 1</code> would create a pyramid, with cap point 2 on the top and cap points 0 & 1 on the bottom.}}
{{KV|Custom cap position X|intn=custom_position_x|float|Set the cap layout custom X position [0,1]}}
{{KV|Custom cap position Y|intn=custom_position_y|float|Set the cap layout custom Y position [0,1]}}
{{KV|Restrict team from winning|intn=cpm_restrict_team_cap_win|choices|Prevent this team from winning by capping all the points. This field is ignored if you're using control_point_rounds in your map (set the corresponding field inside the rounds).}}
:* 0 : Neither
:* 1 : Both
:* 2 : Red
:* 3 : Blue
{{KV|Switch teams on map win?|intn=switch_teams|boolean|Switch the teams when one team has won the map and the game is going to be reset.}}
{{KV|Scoring style|intn=score_style|choices|Sets the style of scoring used for capture point maps.}}
:* 0 : Add team score for each round won
:* 1 : Add team score for each captured point
{{KV|Play all rounds before changelevel|intn=play_all_rounds|choices|Determines whether the server may changelevel when mp_timelimit is up before all mini-rounds have been completed (for maps like Dustbowl).}}
:* 0 : Changelevel normally
:* 1 : Only changelevel after all mini-rounds have been played to completion
{{KV|Partial cap rate|intn=partial_cap_points_rate|float|Rate at which to give partial cap points for area captures.}}


== Keyvalues ==
==Inputs==
* {{kv targetname}}
{{I Targetname}}
* {{kv enabledisable}}
{{I EnableDisable}}
* '''team_base_icon_2'''
{{I|SetWinner|Set the winner of the round to this team (0 for a stalemate).|param=integer}}
: <material> Material for the RED Base icon.
{{bug|hidetested=1|Firing this Input when a point capture is ''in progress'' will not cancel the capture, resulting in an Overtime condition.}}
* '''team_base_icon_3'''
{{I|SetWinnerAndForceCaps|Set the winner of the round to this team and give them ownership of all points.|param=integer}}
: <material> Material for the BLU Base icon.
{{bug|hidetested=1|Firing this Input when a point capture is ''in progress'' will not cancel the capture, resulting in an Overtime condition.}}
* '''caplayout'''
{{I|SetCapLayout|Set the cap layout string.|param=string}}
: <string> A string that tells the HUD how to lay out the cap points. It should be a string with indexes of cap points separated by commas to denote a new line. So <2,0 1> would create a pyramid, with cap point 2 on the top and cap points 0 & 1 on the bottom.
{{bug|hidetested=1|The layout will not work correctly if the team_control_point indeces are not consecutive starting from 0. Eg. indeces 0, 1, 3 will not work correctly.}}
* '''cpm_restrict_team_cap_win'''
: <choices> Prevent this team from winning by capping all the points. This field is ignored if you're using one or more [[team_control_point_round]] in your map (set this field inside the rounds).
:{|
! Literal Value || Description
|-
| 0 || Neither
|-
| 2 || RED
|-
| 3 || BLU
|}
* '''switch_teams'''
: <[[boolean]]> Switch the teams when one team has won the map and the game is going to be reset.
* '''play_all_rounds'''
: <choices> Control whether the game can end after any [[team_control_point_round]]. (e.g. map changing on map time expiring)
:{|
! Literal Value || Description
|-
| 0 || Game can end after any round finishes.
|-
| 1 || Game can only end after a team fully wins. (i.e. Dustbowl: either Blue caps the final point, or time expires and Red wins)
|}
* '''score_style'''
: <choices> Controls the scoring system for each team.
:{|
! Literal Value || Description
|-
| 0 || Teams earn one team point for a win.
|-
| 1 || Teams earn one team point every time that team captures a control point in addition to one team point for a win.<br>If the win is triggered by taking the last capture point, only one point is awarded. (i.e. Dustbowl: Blue earns one point per capture point taken)
|}
<!--
== Flags ==
This entity doesn't have any flags.
-->
== Inputs ==
* {{i targetname}}
* {{i enabledisable}}
* '''SetWinner'''
: <integer> Set the winner of the round to this team (0 for a stalemate, 2 for RED, 3 for BLU).
* '''SetCapLayout'''
: <string> Set the cap layout string.


== Outputs ==
==Outputs==
* {{o targetname}}
{{O Targetname}}
* '''OnWonByTeam1'''
{{O|OnWonByTeam1|Sent when RED wins the game.}}
: Sent when RED wins the game.
{{O|OnWonByTeam2|Sent when BLUE wins the game.}}
* '''OnWonByTeam2'''
: Sent when BLUE wins the game.


== See also ==
== See also ==
* [[team_control_point]]
* [[team_control_point]]
* [[team_control_point_round]]
* [[team_control_point_round]]
 
* [[:TF2/Setting_the_cap_point_layout|Setting the cap point layout]]
[[Category:Team Fortress 2 Entities]]

Latest revision as of 07:35, 4 June 2025

team_control_point_master is a logical entity available in Team Fortress 2 Team Fortress 2.

Note.pngNote:This entity is also in the code for Half-Life 2: Deathmatch. Its functionality is not guaranteed.


Entity description

This entity controls all the control points in a map. It is responsible for the layout of the hud icons as well as some round specific settings. team_control_point_round entities will override settings if they are used.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
Material for the RED Base icon (team_base_icon_2) <material>
The default material used for HUD icons for control points owned by RED
Material for the BLUE Base icon (team_base_icon_3) <material>
The default material used for HUD icons for control points owned by BLU
Cap Layout (caplayout) <string>
A string that tells the HUD how to lay out the cap points. It should be a string with indexes of cap points separated by commas to denote a new line. So 2,0 1 would create a pyramid, with cap point 2 on the top and cap points 0 & 1 on the bottom.
Custom cap position X (custom_position_x) <float>
Set the cap layout custom X position [0,1]
Custom cap position Y (custom_position_y) <float>
Set the cap layout custom Y position [0,1]
Restrict team from winning (cpm_restrict_team_cap_win) <choices>
Prevent this team from winning by capping all the points. This field is ignored if you're using control_point_rounds in your map (set the corresponding field inside the rounds).
  • 0 : Neither
  • 1 : Both
  • 2 : Red
  • 3 : Blue
Switch teams on map win? (switch_teams) <boolean>
Switch the teams when one team has won the map and the game is going to be reset.
Scoring style (score_style) <choices>
Sets the style of scoring used for capture point maps.
  • 0 : Add team score for each round won
  • 1 : Add team score for each captured point
Play all rounds before changelevel (play_all_rounds) <choices>
Determines whether the server may changelevel when mp_timelimit is up before all mini-rounds have been completed (for maps like Dustbowl).
  • 0 : Changelevel normally
  • 1 : Only changelevel after all mini-rounds have been played to completion
Partial cap rate (partial_cap_points_rate) <float>
Rate at which to give partial cap points for area captures.

Inputs

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
SetWinner <integerRedirectInput/integer>
Set the winner of the round to this team (0 for a stalemate).
Icon-Bug.pngBug:Firing this Input when a point capture is in progress will not cancel the capture, resulting in an Overtime condition.
SetWinnerAndForceCaps <integerRedirectInput/integer>
Set the winner of the round to this team and give them ownership of all points.
Icon-Bug.pngBug:Firing this Input when a point capture is in progress will not cancel the capture, resulting in an Overtime condition.
SetCapLayout <stringRedirectInput/string>
Set the cap layout string.
Icon-Bug.pngBug:The layout will not work correctly if the team_control_point indeces are not consecutive starting from 0. Eg. indeces 0, 1, 3 will not work correctly.

Outputs

OnWonByTeam1
Sent when RED wins the game.
OnWonByTeam2
Sent when BLUE wins the game.

See also