Team: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Changing team: kinda duh, but still worth noting)
 
(11 intermediate revisions by 2 users not shown)
Line 7: Line 7:
{{toc-right}}
{{toc-right}}


The [[contents flags]] {{code|CONTENTS_TEAM1}} and {{code|CONTENTS_TEAM2}} can be used by game code to filter whether brushes should be solid to different teams. This is usually done via entity code, but can also be applied using {{cmd|%CompileTeam}} {{since|{{l4d}}}} (which can be applied for older games using a modified [[VBSP]]).


== Changing team ==
== Changing team ==
Line 13: Line 14:
* '''TeamNum''' input/keyvalue - sets so called "initial" team, not the team itself, which sets the entity's actual team when the entity is spawned (even when loading from save file)
* '''TeamNum''' input/keyvalue - sets so called "initial" team, not the team itself, which sets the entity's actual team when the entity is spawned (even when loading from save file)
{{note|All these Inputs/Keyvalues use integers}}
{{note|All these Inputs/Keyvalues use integers}}
:{{note|If an entity doesn't use {{code|m_iTeamNum}} to dictate team, then {{mono|SetTeam}} cannot be used to set the team, unless it overrides the input. Examples of where this occurs include {{ent|filter_activator_team}} and {{ent|func_team_wall}}.}}


== Team values ==
== Team values ==
=== Counter-Strike titles ===
=== Counter-Strike titles ===
{| class="standard-table"
{| class="standard-table"
Line 38: Line 41:
|}
|}
{{Tip|You can change it using <code>ent_fire</code> in {{Csgo mode|Coop}} and play for the Terrorist team}}
{{Tip|You can change it using <code>ent_fire</code> in {{Csgo mode|Coop}} and play for the Terrorist team}}
=== Half-Life 2: Deathmatch ===
{| class="standard-table" 
! Decimal !! Description
|-
|<code>0</code>
|Unassigned
|-
|<code>1</code>
|Spectators
|-
|<code>2</code>
|Combine
|-
|<code>3</code>
|Rebels
|}
=== Day of Defeat: Source ===
{| class="standard-table" 
!Decimal
!Description
|-
|<code>0</code>
| <span style="color:#ddd">{{dods team|Neutral|1}}</span>, or Unassigned
|-
|<code>1</code>
|Spectators
|-
|<code>2</code>
|<span style="color:#080">{{dods team|Allies|1}}</span>
|-
|<code>3</code>
|<span style="color:#d00">{{dods team|Axis|1}}</span>
|}


=== Team Fortress 2 ===
=== Team Fortress 2 ===

Latest revision as of 11:17, 5 May 2025

Stub

This article or section is a stub. You can help by expanding it.

Every entity has a team property but it's mostly relevant for players and NPCs. It can affect appearances or other behaviors of players. Material proxies can be used to render a texture only for some teams. (List of material proxies)

Below are examples of other entities where team alignment affects their behaviour:

The contents flags CONTENTS_TEAM1 and CONTENTS_TEAM2 can be used by game code to filter whether brushes should be solid to different teams. This is usually done via entity code, but can also be applied using %CompileTeam (in all games since Left 4 Dead) (which can be applied for older games using a modified VBSP).

Changing team

  • SetTeam input - available to all entities
  • teamnumber keyvalue (in all games since Alien Swarm Alien Swarm) and (also in Team Fortress 2 branch Team Fortress 2 branch)
  • TeamNum input/keyvalue - sets so called "initial" team, not the team itself, which sets the entity's actual team when the entity is spawned (even when loading from save file)
Note.pngNote:All these Inputs/Keyvalues use integers
Note.pngNote:If an entity doesn't use m_iTeamNum to dictate team, then SetTeam cannot be used to set the team, unless it overrides the input. Examples of where this occurs include filter_activator_team and func_team_wall.

Team values

Counter-Strike titles

Decimal Description Player Model
1 Spectator Invisible
2 Terrorists Terrorist map default, or chosen agent
3 Counter-Terrorists Counter-Terrorist map default, or chosen agent
Other Undefined Terrorist map default
Tip.pngTip:You can change it using ent_fire in CS:GO Co-op Strike Co-op Strike and play for the Terrorist team

Half-Life 2: Deathmatch

Decimal Description
0 Unassigned
1 Spectators
2 Combine
3 Rebels

Day of Defeat: Source

Decimal Description
0 Neutral Neutral, or Unassigned
1 Spectators
2 Allies Allies
3 Axis Axis

Team Fortress 2

Warning.pngWarning:Setting this keyvalue to below 0 or above 3 will crash the game.
Decimal Description Player Model and Texture
0 Unassigned Invisible or RED style if a class was selected then teamnumber changed through addoutput
1 Spectators Invisible or RED style without cosmetics if a class was selected then teamnumber changed through addoutput
2 RED RED style
3 BLU BLU style

Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series

Decimal Description Player Model and Texture
0 Unassigned
1 Spectators
2 Survivor
3 Infected
4 L4D1_Survivor (only in Left 4 Dead 2) Survivors spawned using info_l4d1_survivor_spawn

See also