TF2/Creating a Single Flag Keep-Away map

From Valve Developer Community
< TF2
Revision as of 09:38, 16 March 2008 by GreaseMonkey (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: This tutorial has been made with the assumption that you already know some basic mapping techniques for Team Fortress 2. Things such as making a spawn room, working doors, creating brushes, etc.

What should I know?

I assume you know the basics so I'm just showing you the concept and creation of this type of gameplay. Here you will learn how to make a one flag map where you play a simple game of keep-away. I will assume you know what that is. In case you don't, it's where either everyone tries to keep an object (such as a ball) away from everyone else, or where there are teams involved. I think you get the idea.

After several painstaking days of tinkering with I/O connections (Input/Output), I have finally put together a tutorial for making a one flag map where you play keep-away.

What do I need for this?

Here, we will be using the following entities.

  • item_teamflag
  • team_round_timer
  • game_forcerespawn
  • func_capturezone

If you have made a CTF map before, you will have used at least half of these. This will be set up like any regular CFT map except for a few major differences in entity placement and properties.

Here we will start with a map that I'm sure you can take care of by yourself. All that I'll be showing you is the entity arrangement so you can put this in your map.

Where do I start?

I would start by putting your item_teamflag where you want it. Double click on it in 3D view and the properties of it will open up. You will not need to name it, but you can if you want (depending how your map is set up).

Here is a reference picture from my latest map using this style. Tut9.JPG

  • The "Game Type" field should be set to "CTF" as a default. Leave it like that.
  • Under "Team" put "Any" if it isn't there already. It should be by default though.
  • "Start Disabled" should be "No" by default as well. Leave it that way.

This part of the process isn't very hard since it is basically like this already.

Next you will put your team_round_timer entity in the map. Put it anywhere you want. Go into the properties and set the following fields.

Here is another reference picture from the same map. Tut10.JPG

  • Name it something like "game_timer" or anything that you want.
  • "Start Disabled" should be "No" by default.
  • "Timer length (in seconds)" should be set to something like 600 for now. That is ten minutes.
  • "Setup timer length (in seconds)" should be 0. I recommend this because for some reason, the game can't distinguish between the two types of timers in some cases with I/O connections. Don't ask why because I don't know. It must be some glitch that hasn't been worked out yet.
  • "Reset time on round restart" should be "Yes".
  • Set "Use countdown sounds" to "Yes".
  • Set "Show timer on HUD" to "Yes" as well.

Okay, we have our timer set up. Now what? How about we make our next entity on the list.

Place a game_forcerespawn entity wherever you want. Name it something like "respawn_01". No there will not be a "respawn_02", just name it whatever you want.

Yet another reference picture. Tut11.JPG

We're getting close! Now make your func_capturezone fit around the whole map (or wherever any player can go with the flag). This will be one huge brush. Texture it with either nodraw, or the trigger texture. I prefer trigger because it's partly transparent in hammer.

Here's my last picture in 3D view. Tut12.JPG

  • Name it "capzone" or something. Listen carefully here!
  • Set the "Start Disabled" field to "Yes" and "Team" to "Any".
  • Ignore "Capture Point" because it isn't needed.

When do we get this to work?

Right now!

Now we can get into the meat of this. Almost all of this is activated within the team_round_timer because time is what determines the way the game plays out. The way this will work is that when the ten minutes are up, the team holding the flag gains the point. Simple right? Lets find out!

Go into the team_round_timer properties and click on the Outputs tab at the top of the properties window.


You need to fill all of those in. If you have half a brain, you should be able to know what all of that means and fill it out accordingly. If you have a quarter of a brain, the I will explain it for you.

First click "Add" at the bottom of your properties window. Several blank spaces should appear and you will need to fill them in as follows.

This enables the capture zone when one second remains so that it counts the point just before the round ends.


Now tell the game to force players to respawn so they don't stay outside of their spawn rooms after time runs out. This simulates a round restart.


Now at the same time, we tell the capture zone to disable so it doesn't stay on for the next round until time runs out again.


Now assuming the door to your red team spawn room is named "door_red_1", this will lock the door so players can't instantly go for the flag.


Same will be done with the blue door (assuming that it is named "door_blue_1").


Now we put in the same stuff, except have the "Via this input" be "Unlock". Enter 3 under "After a delay in seconds of". Do this for both "door_red_1" and "door_blue_1".

Now we have the timer restart itself, but after a delay of 3 seconds also. This means, the players will respawn and the timer won't start for another 3 seconds. This gives them some time to get a feeling of how this works and prepare for the round.


Finally, we disable the Capture zone so people can't capture as soon as they pick the flag up during the next round. We already made an output like this but we are doing this just to be safe in case something else in the map is affecting the timer.


How will this work out?

Now it should work like this:

  • The game starts.
  • Somebody holds the intelligence for ten minutes and gets the point for holding onto it.
  • Everybody respawns and has to wait 3 seconds before the doors open and then the timer starts again.
  • This gets repeated until either team has 3 points total.

I have tested this and I know it works.

Any bugs?

Known bugs:

  • Occasionally, the intelligence will stay where it is if it is dropped right before the round starts. Then it will be somewhere where it shouldn't be when the round starts over.
  • Also, after the first round, the countdown sounds won't play. So, after the first round, the sounds won't play again. I am trying to get this to work.

Other than that, it works great! People have liked my maps in this style because I may be the first to have done it. It's a new style of gameplay and is unique to TF2 at the moment. I hope this tutorial can help others introduce this to the rest of the community so we can all have fun playing keep-away!

I hope everyone finds this helpful!

P.S. I plan on editing this tutorial as soon as I perfect this system.