CTF Invade and other modes

Dec 25, 2007
566
439
There's a very good summary of the different builtin CTF gamemodes over at the Valve wiki, so check that out if you're uncertain about what the item_teamflag can do for you.

I also want to announce loudly that anyone who is making a single-neutral-flag-take-it-to-enemy-cap-point (i.e. Invade mode), to turn on the Invade mode on the flag. This fixes the "HUD doesn't show who's carrying the flag" problem. Note that invade mode also limits the flag to the team who first picked it up, until it either is captured or returns to the start.

If you wish to manually return the flag to neutral, use:

My output named OnDrop
Target entities named item_teamflag
Via this input Skin
With a parameter override of 2

and

My output named OnDrop
Target entities named item_teamflag
Via this input SetTeam
With a parameter override of 0

To set it back to grey, neutral. Skins 1 and 2 and teams 2 and 3 can also be used if you want to set it to be Red or Blu.

I'm really happy to discover this, as it means that sometime in the past, Valve fixed the previously broken invade flag type, and likely others also.

Edit:
Summary of results from testing
CTF mode single neutral flag
  • Teams can only pick up enemy flag or neutral flag.
  • While being carried: the HUD non-carriers see will remain neutral. Firing SetTeam 2 (red) on the flag will cause their HUDs to show red; SetTeam 3 (blu) will cause it to show Blue; SetTeam 0 (neutral) returns it to neutral; the appearance of the flag does not change.
  • While being carried: the carrier's HUD will show an enemy-coloured briefcase regardless of the flag's team.
  • When dropped: The timer above the flag shows in the team colour as above. Teams cannot pick up their own colour flag.
  • Anytime: Skin 0 give the briefcase the red "dropped/home" skin; Skin 1 for blue; Skin 2 for neutral; Skin 3 give is the red "carried by blu" skin; Skin 4 the blu "carried by red" skin, and Skin 5 the neutral "carried" skin.
  • Capturing: The team's capture score will be incremented, but not the round score.
  • Disabling the flag will cause the HUD to switch to two-flag mode and not point to the flag anymore.

Invade mode single neutral flag
  • Teams can only pick up own flag or neutral flag.
  • While being carried: the carrier's HUD will show their coloured briefcase regardless of the flag's team.
  • Capturing: The team's capture score will not be incremented, but the round score will. So with the OnCaptureTeam1/OnCaptureTeam2 inputs, fire AddRedTeamScore/AddBlueTeamScore on tf_gamerules with override -1 to undo the round score bump. Capture score cannot be modified at present, so Invade mode will not currently work for contest maps which are required to be scored with capture credits.
  • Disabling the flag will cause the HUD to switch to two-flag mode and not point to the flag anymore.
  • Announcer sound files are missing for invade mode; so no sounds are played on flag events, and a console error message is displayed.
 
Last edited:

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
My output named OnDrop
Target entities named item_teamflag
Via this input SetTeam
With a parameter override of 0

does that inadvertantly return the flag to "base"? Or just set it to neutral where it was dropped? This should be very useful.. Although i'm not sure which mechanic i prefer more. I had assumed it was possible for either team to pick the flag up, but i'm starting to like the idea that the first team to grab the intel has "first dibs" on attacking.
 

Nutomic

L11: Posh Member
Feb 7, 2009
888
177
I have a neutral intel, that can always be picked up by any team when dropped.

Playtest must show how it works, but this will sure make a faster gameplay, less sentries and stuff.
 
Dec 25, 2007
566
439
does that inadvertantly return the flag to "base"? Or just set it to neutral where it was dropped?
It just sets it to neutral where it was dropped.

I have a neutral intel, that can always be picked up by any team when dropped.
Yeah, so you'll want to use Invade mode, and set the appropriate OnDrop outputs as above. If you use the CTF mode, then the HUD doesn't show which team is carrying the flag, which is pretty vital to know.

I have found a bug with the invade mode: sending the Disable input to the flag will cause the HUD to revert to two-flag mode, from which it doesn't recover. So if you don't want the flag to instantly respawn ready for pickup, make an inaccessible room with a point_teleport in it to teleport the flag to on capture (and/or on return); then after the appropriate delay, teleport it to another point_teleport where you want the flag to be picked up from.
 
Last edited:
Dec 25, 2007
566
439
Damn :cursing:

There's a game-breaking bug in Invade mode: when a player caps, the team doesn't get a capture point credit (which is what the CTF hud shows), they get a round win point (which is what you see at the top of the scoreboard).

As far as I know, there's no way to manually increment team cap points, and fiddling with round win points is just dodgy.

:(

I guess I need to write to Valve to see if they can fix it.
 

Nutomic

L11: Posh Member
Feb 7, 2009
888
177
Yeah, so you'll want to use Invade mode, and set the appropriate OnDrop outputs as above. If you use the CTF mode, then the HUD doesn't show which team is carrying the flag, which is pretty vital to know.

I didnt mean i dont want it how it is :D

(Though playtest must show whether it works this way)

That bug is really bad, i hope they will fix it soon.
 
Dec 25, 2007
566
439
Hopefully they will indeed:

Robin Walker said:
Thanks for the reports, Andy. We'll try and get 'em fixed soon.

Robin.

-----Original Message-----
From: Andy "Velvet Fist, Iron Glove" Durdin [mailto:mail@velvetfistironglove.com]
Sent: Tuesday, January 12, 2010 3:40 PM
To: Robin Walker
Subject: TF2Maps.net contest, and serious bugs in alternate CTF modes.

Hello Robin,

As you might have heard, TF2Maps.net is currently running a contest to produce CTF maps that are intended to be suitable for competitive play (as well as pub play). As a result, myself and several other mappers are building maps with the Invade flag mode (GameType 3/Invade on item_teamflag), where each team fights to take a single neutral flag to a capture point in their enemy's territory. However there are some significant bugs with the way this gamemode works at the moment, in order of worst to least:


1. When a player captures the flag, their team does not receive a capture point (i.e. the score shown on the CTF HUD); instead they receive a round point (i.e. the score shown at the top of the scoreboard). This is a game-breaker for this mode, since the game win is triggered based on the teams' total capture points. What should happen is that the team receives a capture point, and not a round point.

2. When dropped, the flag returns to neutral 30 seconds later. This is regardless of the ReturnTime set on the flag (the flag does correctly return to neutral when the flag is capped or returned). What should happen is that the flag does not return to neutral merely by being dropped; since a mapper can cause it to return to neutral whenever desired by firing SetTeam and Skin inputs.

3. If the ReturnTime on the flag is less than 30 seconds, the visual timer displayed above the dropped flag doesn't animate, so there's no indication to players how soon it will return. What should happen is that the timer animates to 'drain' completely in the whatever ReturnTime is set.

4. When working with a single flag, if the Disable input is fired on the flag, everyone's HUD changes to the 2-flag HUD, and doesn't change back when the flag is enabled again. What should happen is that the HUD should remain the single-flag HUD. This one can be worked around by teleporting the flag to an unreachable area of the map instead of disabling it, so we can live with this. It'd be nice to have though.
 

Pseudo

L6: Sharp Member
Jan 26, 2008
319
150
You could just use the "CTF" flag gametype and have the OnPickupTeam_ outputs change the flag with SetTeam.

None of the non-CTF flag gametypes will correctly count a capture. They should not be used for the CTF contest.
 
Dec 25, 2007
566
439
You could just use the "CTF" flag gametype and have the OnPickupTeam_ outputs change the flag with SetTeam.
The biggest issue with the "CTF" gametype for a single neutral flag gamemode is that if someone is carrying the flag, the HUD doesn't show which team is holding it Edit: You can work around this; see edit in top post. There are a couple of other quirks as well, for example the HUD shows the wrong flag colour when you pick up the neutral flag. The announcer messages are also not fully appropriate, but that's not a biggie.

None of the non-CTF flag gametypes will correctly count a capture. They should not be used for the CTF contest.
Yeah, if they don't get fixed, I'm going to have to stick with the CTF gametype, and horrible game_text_tf to show which team has the flag.
 
Last edited:

Pseudo

L6: Sharp Member
Jan 26, 2008
319
150
I may be wrong here, but I thought that changing the non-CTF gamemodes to count captures would potentially break A/D CTF maps, which take advantage of this behavior to use their own scoring method.

The biggest issue with the "CTF" gametype for a single neutral flag gamemode is that if someone is carrying the flag, the HUD doesn't show which team is holding it.
Even if you change the flag's color with SetTeam?
 
Dec 25, 2007
566
439
I may be wrong here, but I thought that changing the non-CTF gamemodes to count captures would potentially break A/D CTF maps, which take advantage of this behavior to use their own scoring method.
Ooh, that's a really good point -- although most of the A/D CTF maps were using A/D mode flags, but I'm sure there are Invade maps out there that it will break. I guess altering the way scoring is currently done is a bad idea then. I'll send a retraction on that point to Robin.

So what's the solution? Ask for new inputs on tf_gamerules to add capture score to teams? (since we can already adjust the team scores that are shown on the scoreboard down with Add*TeamScore).

Even if you change the flag's color with SetTeam?
OK, I've just tested this now, and indeed it works. The flag shown on the flag carrier's HUD is still the enemy team's colour, and doesn't change regardless of SetTeam, but other players' HUDs will show red or blue for 2 or 3 respectively. (It'll have to be changed again on drop of course, so the team can pick it up again!)

I've updated the first post to detail the output of all this.
 
Last edited:

Nutomic

L11: Posh Member
Feb 7, 2009
888
177
Ooh, that's a really good point. I guess altering the way scoring is currently done is a bad idea then, given the number of A/D ctf maps out there. Especiallly as they were mentioned on the TF2 blog recently. I'll send a retraction on that point to Robin.

I f valve has good programmers, they will make different scoring methods for different game modes.
 

megawac

L4: Comfortable Member
Oct 2, 2009
180
29
To change the colour of the flag on pickup enter these outputs (from your flag to the flag)

tcQ1o.png

The outputs appear broken in hammer because there isnt an fgd file, but they work in game.
 
Dec 25, 2007
566
439
BoyLee: yes, but somehow in that post I wrote "point_template" when I meant "point_teleport" (I've edited it to fix it now).
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814