[Tutorial] Flag Indicators on a Push map

Discussion in 'Tutorials & Resources' started by Logo, Jan 20, 2008.

  1. Logo

    Logo L3: Member

    Messages:
    115
    Positive Ratings:
    25
    I see a few 1 flag CTF Maps in the works and thought I'd share a trick to make the flag indicators work (allowing for much better gameplay on these maps).

    The setup:

    You'll first need the two team filters (RedFilter for things that red team can trigger and BlueFilter for things that the blue team can trigger).

    Now place your flag down with a team of any, give it a name (Flag). Set the following outputs up for Flag1:
    MyOutput - Target - Via This Input - Parameter
    OnCapture - Flag - SetTeam - 0
    OnDrop - Flag - SetTeam - 0
    OnReturn - Flag - SetTeam - 0

    In the same spot on the X and Y plane but below your map create 2 more flags both called TmpFlag with one set to blue team and one set to red team.

    Now create a trigger brush that contains your flag (so the flag is inside the trigger brush), The brush should be about the same size as the flag but slightly bigger (1-2 units larger than the flag itself on either side). Make this brush a trigger multiple. Do the same for 2 more brushes.

    You should now have 3 Trigger multiple brushes. They need to be setup in the following way:

    ALL:
    Parent = Flag
    Delay before Reset = 0

    Trigger 1 "NuetralFlagControl" (you don't actually need to name the trigger_multiple but it's easier to explain it like this):
    Filtername: None
    Output:
    MyOutput - Target - Via This Input - Parameter
    OnStartTouching - TmpFlag - kill
    OnEndTouchingAll - Flag - SetTeam - 0

    Trigger 2 "RedFlagControl" (you don't actually need to name the trigger_multiple but it's easier to explain it like this):
    Filtername: RedFilter
    Output:
    MyOutput - Target - Via This Input - Parameter
    OnStartTouchingAll - Flag - SetTeam - 3


    Trigger 2 "BlueFlagControl" (you don't actually need to name the trigger_multiple but it's easier to explain it like this):
    Filtername: BlueFilter
    Output:
    MyOutput - Target - Via This Input - Parameter
    OnStartTouchingAll - Flag - SetTeam - 2

    How this works out:
    What ends up happening is at the start of the game you will have 2 indicators pointing to the temp flags. They'll in effect look like they're pointing to the neutral flag though. When you
    run over the flag to pick it up these TmpFlags are killed preventing the indicators from pointing to them anymore. Now since you quickly set the team of the flag before its picked up when it is picked up the indicator for that team will 'initialize' to that flag and forever more be properly pointing to that flag wherever it is. When the flag it dropped, captured, returned, etc. the flag will return to the neutral team so anyone can pick it up. You now have working indicators for your neutral flag map.

    Issues:
    A few issues with the system:
    -Once a team touches the flag the dual indicators will disable and an indicator will only display on the side for the team holding the flag (which all players in game can still see). Once the other team touches and 'initializes' the flag as their own by picking it up the dual homing locations will be activated. Functionally there's no issue here as you can always tell where the flag is regardless of if both teams have touched it.
    -The Home/Dropped icons for the flag isn't always accurate especially if a side hasn't 'initialized' their homing circle yet.

    If there's any bugs in my system or setup let me know. I'm fairly sure the setup and the included map will work but I didn't get to test it with multiple people as it is currently setup (but it's just ripped from my jinxed map with stripped out game_text entities som I'm almost positive it will work).
     
    • Thanks Thanks x 1
  2. Armadillo of Doom

    aa Armadillo of Doom Group Founder, Lover of Pie

    Messages:
    949
    Positive Ratings:
    614
    Oh badass. And a zip file too. I tell ya, we're one step closer to having multiple gametype maps.
     
  3. TotalMark

    TotalMark L6: Sharp Member

    Messages:
    331
    Positive Ratings:
    40
    I ran across this and with a few complaints about the indicators in CTF_thelimit (rather lack there of...), I will be using a system like this in the next beta.
     
  4. Pseudo

    Pseudo L6: Sharp Member

    Messages:
    319
    Positive Ratings:
    149
    I think I have a way that solves some of the issues. Have one neutral flag and a logic_auto. OnMultiNewRound, tell the flag "SetTeam 2" to initialize the Red indicator. After a short delay, "SetTeam 3" to initialize the Blu indicator. Then another short delay and "SetTeam 0" to turn the indicators to the gray color and make the flag neutral again.

    You would still want to use the RedFlagControl and BlueFlagControl method so that the indicators change color based on who has the flag, but you wouldn't need the two TmpFlags or the brush that Kills them. I haven't tested this very throughly but it should take care of the issues you noted.
     
    Last edited: Mar 21, 2008
  5. TotalMark

    TotalMark L6: Sharp Member

    Messages:
    331
    Positive Ratings:
    40
    I'll try to ent_fire those and see what happens...
     
  6. TotalMark

    TotalMark L6: Sharp Member

    Messages:
    331
    Positive Ratings:
    40
    Okie dokie, I tried the method you described Pseudo, and it works pretty well. I also made three trigger brushes (although you only really need two) parented to the flag, they change the flag's team depending who picks it up. The third one displays a message to the flag carrier and the flag carrier only!:thumbup:

    I got it to work very well so far, and I will make a prefab for this.

    EDIT: Prefab: http://forums.tf2maps.net/downloads.php?do=file&id=227
     
    Last edited: Mar 22, 2008