Half-Life Re-imagined competition results on their way...
Check out Skewing textures in Hammer, our newest tutorial!
Welcome, thatguymalone, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

9

Cobalt

20

Turquoise

5

Cyan

8

Royal

3

Teal

3

Onliners

5 mins

Admer456

7 mins

Dr. Orange

21 mins

Solokiller

23 mins

DocRock

40 mins

Windawz

42 mins

zeeba-G

1 hours

Jessie

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Half-Life Teamplay

By Chris 'autolycus' Bokitch

Between normal Half-Life deathmatch and TFC, there exists a buffer zone... a team-based style of play with very little rules... it's know as... er... well, Half-Life Teamplay. This style of play is based upon the set of game_* entities implemented in after Half-Life was released. Not all of the game_ entities are specifically aimed at multiplayer teamplay maps. Below are a few of the basics.

Note: In order to play a Half-Life Teamplay deathmatch game, you either need to set both the "deathmatch" and "mp_teamplay" console variables to 1, or, if you create a game using the menus, go into the Advanced options and put an x next to Teamplay.

The Basics

The basics of a Half-Life Teamplay map are quite basic indeed. All that is really needed is a couple worlddpawn settings and the game_team_master and info_player_deathmatch entities.

worldspawn (map properties)
The worldspawn entity contains two properties that exert a bit of control over a Teamplay game. To access it, select Map Properties from the Map menu in Worldcraft.

  • Map Team List (mapteams) - This will be copied into the mp_teamlist while your map is running if the server allows maps to override the team list (it does by default).
  • Default Team (defaultteam) - If this is set to 1, then players are forced on to the first team (team index 0) when they join. Otherwise, they are forced to join the team with fewest players. If they are forced to join the first team by the map (defaultteam 1), then players are not allowed to change teams during that map (unless the map changes their team for them).

The first property allows you to setup which models will define the teams. For example, if you wanted to have two teams, one for scientists and one for the human grunts, you'd specify scientist;hgrunt here. The models you have available by default are: gina, gordon, helmet, hgrunt, and scientist. Later Half-Life patches also add barney, robo, and zombie player models.

The second property lets you decide how teams will be picked. It's quite simple, you can either be automatically placed on the first team (1) or you can be automatically placed on the team with the least players (0).

game_team_master
The game_team_master is the key to the whole thing. This is the entity that allows you to actually implement teamplay in a map. It's quite easy to setup. Below are the required properties.

  • Name (targetname) - set this to a descriptive name of the team, for example, scientists.
  • Team Index (-1 = no team) (teamindex) - set this to the index value of the team. For example, if the Map Team List in the worldspawn was set as shown above, to scientist;hgrunt, then index value 0 would be the scientist team, and index value 1 would be the human grunts.

Each team in the map needs a game_team_master defined for it. Going with the scientist/grunt theme, you'd want one game_team_master named scientists with a team index of 0, and one game_team_master named grunts with a team index of 1.

info_player_deathmatch (team spawns)
What good is a Teamplay game if you can't define where specific teams will spawn? Well, this is actually quite easy once you have the game_team_masters defined (above). As long as you have a fairly current version of the Half-Life game data file, the info_player_deathmatch entity will have a Master property. Set the value of the Master property to the name of one of the game_team_masters.

Using the the previous examples, to make a spawn point for the scientist's team, you'd place an info_player_deathmatch entity and set its Master value to scientists. Likewise, to make spawn points for the human grunts, you'd set the info_player_deathmatch entity's Master value to grunts.

What now?

Ok, so, we've decided who's going to be on what team, we've setup the team masters, and we've defined the team spawn points. These are the absolute basics of a Half-Life Teamplay map. There are a number of other things that you can do, however.

  • Almost any entity that can have a Master value can also use a game_team_master to make the entity usable by only a single team. For example, if you give a func_door's Master property a value of grunts, only people on the human grunts team (using our previous examples) could use the door.
  • Different teams can start with different weapons and equipement, just use the game_player_equip entity.

Keeping Players Informed

With a Teamplay game, its very important that players keep informed of their mission so that they can properly work together to defeat the opposing team. This can be accomplished by using the game_text entity in conjunction with the special Teamplay entity naming convention - the following five names can be used as names of entities, and they'll be triggered automatically.

  • game_playerdie - entities with this name will be triggered when a player dies
  • game_playerkill - entities with this name will be triggered when a player is killed
  • game_playerjoin - entities with this name will be triggered when a player joins the server
  • game_playerspawn - entities with this name will be triggered when a player spawns
  • game_playerleave - entities with this name will be triggered when a player leaves the game

For example, if you create a game_text and give it a Name of game_playerspawn, the game_text output will be displayed to the player each time he spawns. Note that you can have a number of game_text's with the game_playerspawn name, but also using different game_team_masters for their Master values. This lets you display different text to each team.

More?

There's lots more you can do with the game entities in a Half-Life Teamplay map, but the above outlines all the required basics. It is definitely recommended that you read through the Game_ Entities descriptions and let your mind wander to cool applications of their use. Some things to look into -

  • the game_zone_player entity allows you to cause every player to trigger a specific event depending on their location (either inside or outside the zone). There's an "inside" target and an "outside" target. Interesting, no?
  • the game_score entity allows you to increase or decrease a team's score
  • players can switch to a different team using the game_player_team entity
  • the game_team_set entity allows you to set a game_team_master's team index to the team of the player who activates it
  • the game_player_hurt entity can hurt (or heal) players of a specific team
  • the game_end entity can force the game to end, useful for time limited missions