Game_Entity Tutorial Part 1 W A V E L E N G T H
by HellBringer April 15, 1999
Foreword:
This tutorial assumes that you have both Half-Life and Worldcraft 2.x, and are fairly proficient in the use of Worldcraft, in that you have completed the previous tutorials in this series.

  These entities are TOTALLY NEW for version 1.0.0.9 of Half-Life (and above, if future versions are released). Jay Stelly at Valve polled a few webmasters and community folks; and decided that some entities were needed to allow mod-like alterations in a game WITHOUT programming tons of stuff, or dealing with TFC's very complex entities. These entities are the result of his work; and are very interesting indeed! As we will see today, its now pretty simple to make mini-mod's with just maps; and this tutorial only scratches the surface of the possibilities. Jay claims that a "Rocket Arena"-like mod could probably be made with JUST these new entities (for those not familiar, Rocket Arena was a highly successful mod for Quake2).

BLUE statements are the specific actions you should be doing.

This article covers:
- How to set up a map with specific team starting points
- The game_team_master entity
- The game_zone_player entity
- The game_player_hurt entity
- The game_score entity
- The new teamplay WorldSpawn keys (under "Map Properties")
- The multi_manager entity
- How to make the "Crossfire" airstrike effect
- Miscellaneous entities such as ambient_generic, env_fade, and env_shake

     Welcome to the Game_entity tutorial, part 1! Why part 1? Well, basically because there is SO MUCH you can do with these new entities, its best that you learn the basics with this one; and then we'll expand on this map in the next tutorial! This tutorial deals almost entirely with entities; so there are almost NO screenshots. I STRONGLY advise you to print this out; and have it handy to work off of while WorldCraft is running. First, let's get some information to you:

  1. These entities are meant for Teamplay Half-Life ONLY - so no combining them with TFC or non-teamplay deathmatch.

  2. While simpler than TFC entities, these are NOT for beginner mappers! If you're in doubt, download the initial map and compile and test it. If you are POSITIVE that you know how I created everything; and you could do the same things on your own - then you should have the skills needed to complete this tutorial.

  3. If you DO get confused during the tutorial; there's a link at the end to my version of the "final product". Try downloading and looking at it BEFORE contacting me - maybe seeing it done correctly will tip you off to what's giving you troubles.

  4. IMPORTANT NOTE: Since you must run in Teamplay mode to get the affects of the special entities, compiling and testing a map should be done as follows:
    • Run a full compile in WorldCraft WITHOUT running Half-Life.
    • Exit or minimize WorldCraft (exiting is recommended; especially if you don't have a high-end system).
    • Run Half-Life in -dev -console mode. This is done easily by making a shortcut to "hl.exe" on your desktop. Then, edit the properties of the shortcut and add "-dev -console" (without the quotes) to the command line.
    • When Half-Life starts up, go to "Multiplayer", then "LAN Game", then "Create Game", and choose "tutor9.bsp". Click on "Advanced Options". In this screen, select "Teamplay". Then click "Done" and "OK". The game will load up and begin.
    • When done, escape out and quit as normal. After the first time, you can skip the "Advanced Options" section.

  5. The maps I have made for this tutorial are NOT perfect! I made a reasonable effort to align textures, etc. - but ONLY on the surfaces that absolutely needed them. There may be visual errors and annoyances; but they shouldn't affect gameplay.

  6. The maps I have made for this tutorial are NOT for distribution! They are for instructional purposes ONLY! DO NOT submit this map to any public download sites, and you may NOT distribute this map in ANY way without my expressed written consent.

  7. The maps I have made for this tutorial are NOT for you to be a Vulture with. Learn from them, but PLEASE do NOT simply cut and paste or copy directly any parts of this map into your own.

  8. SECOND IMPORTANT NOTE: In entity keys and values, I ALWAYS use lower case letters. So "0" is the number ZERO; NOT a capital "o"

       Okay, first on the list is to GRAB THE STARTING MAP HERE. I've done the grunt-work and made us a very simple team-play-ready map. It works as a single player map right now; so why don't you compile and run it in SINGLE PLAYER mode right now to get a feel for the map. If ANY part of that map confuses you (other than the fact that the doors and window-coverings aren't triggered by anything), you need to STOP. Go back and read earlier tutorials at Wavelength, and they will explain everything that is in this map. Here are some notables to clear things up if you look at the map in WorldCraft:

     Let's get started, shall we? Load up WorldCraft and open up the map. The first thing we need to do, to make this a teamplay map, is to make the team-controlling entities. These are done with "game_team_master" entities. Go ahead and switch to entity mode. Place an entity somewhere in the map's playing field area.

     NOTE: Exact placement doesn't matter with most of the entities we'll be dealing with (I'll tell you when it does); just make sure that they don't overlap each other, OR any solid brushes. It also usually helps to group the entities together. Click here to see a shot of how I arranged things when I made the map (this is a shot of the "completed" project, so there are new objects and entities that are NOT yet in the map that you have).

     Once you've aligned your entity in both the XY views and the YZ or XZ views, hit ENTER to create the entity. Now switch to selection mode. Select the new entity and bring up the properties window. Change the entity class to "game_team_master". Set the following properties:

KEY
VALUE
TeamIndex
0
Name
teammaster0

(Teams are numbered starting at 0 and working up, so the second team is #1, the third team is #2, etc).

     Now switch back to Selection mode. Select this entity and copy it. Paste it nearby. Bring up the entity properties again, and set them to the following:

KEY
VALUE
TeamIndex
1
Name
teammaster1

     Next, let's go make sure that the map is going to use our teams the way we want. Select "Map" from the menu, then "Map Properties". Make sure that there are two models listed under "Map Team List", and that "Default Team" says "Fewest Players". This will ensure that unless a server operator manually overrides our map, this will be a two-team map; and new players will automatically be put on the team with the least number of players. Once we're sure that our teams are going to work, its time to place some team-specific starting points. Switch back to entity placement mode. Place an "info_player_deathmatch" entity into the map, and move it into the bunker on the LEFT in the XY view. Make sure that the starting point is COMPLETELY inside the bunker, and isn't touching or overlapping the walls, floor, or ceiling of the bunker. Change to selection mode and bring up the entity properties box for this entity; and set the following:

KEY
VALUE
Master
teammaster0

     This forces the info_player_deathmatch entity to use the "teammaster0" entity as its "Master" - a Master can be thought of as a "controlling" entity. It sets the conditions for when the "slave" entity can and cannot work (or be triggered). In this case, we've mastered the starting point with the Team 0 "game_team_master" - so ONLY people on Team 0 can start or respawn here. Of course, having only one respawn point would be silly in a real team game, so let's make sure you're in Selection mode, and then copy and paste this entity a few times around inside the bunker. BE SURE to check every one's alignment, so that none are overlapping each other or the bunker!

     So now we have one team's starting points - but we can't leave out the other team's! Move your XY view over to the "right-hand" bunker, and paste again just ONCE. Now, select this info_player_deathmatch entity and align it inside of the bunker so that it doesn't overlap anything. Bring up the entity properties, and set the following (note: This is close, but not the same as the previous deathmatch entities):

KEY
VALUE
Master
teammaster1

     Once again, copy and paste this new entity a few times inside of this bunker. BE SURE to check every one's alignment, so that none are overlapping each other or the bunker! Save, compile, and test this map in TEAMPLAY MODE (see the note at the beginning of the tutorial about how to do this). When on the "hgrunt" team you should spawn in one bunker, and if you switch to the "scientist" team, you will spawn in the other bunker. To switch teams, simply bring down the console and type in "model modelname" (without the quotes) - where "modelname" is the name of the model to switch to, i.e. "model hgrunt" (without the quotes of course).

Click here to continue...