Using the "TestActivator" with filter to set flag team- help!

(s2a) yahodahan

L3: Member
Apr 22, 2009
144
18
Hi all, very frustrated here, have spent entire day trying to figure this out!

Basically, I want a game where their is only one flag, and the blue team has to capture it and bring it back to their base to win.

To make things interesting, the Red team ALSO can pick up the flag and run about with it, just to make the Blue team angrier.

Lastly, if a Red team member ever drops the flag- they can NOT pick it back up until it has been picked up and dropped again by a Blue team member.

Has anyone tried this themselves, with sucess?

***
Okay, here is where I am so far, and I can't go further without help, it seems.

I have 2 triggers, one blue and one red, which are activated when the flag is picked up.

Next, there is a simple prop_dynamic.

If the trigger detects a Blue player picked up the flag, the prop_dynamic is given a Mass of 1.

If the trigger detects a Red player picked up the flag, the prop_dynamic is given a mass of 100.

Thus, a "Game State" has been created- either "Game State: Blue Controls Flag", or "Game State: Red Controls Flag".

Next, I have a Filter_Activator_Mass_Greator, with a filter of "anything over 50 passes".

When the flag is dropped, it tells the prop_dynamic to test it's mass against the Filter.

From here, the Filter can deduce the previous owner of the flag (who just died or dropped flag), and change it's color accordingly. ie, if a blue player owned it (mass <50) then change flag color to Any, if a Red player owned it (mass >50) then change flag color to Red.

Unfortunatly, it fails at the last step. As far as I can tell, this is due to the "TestActivator" function being oh-so-dumb and only working for the FIRST item in the IO chain- which will always be the Flag. And since the flag of course cannot store "mass" or any other variable other than it's own color, here enters the FailBoat (whoo-whoo, all Aboard!)

Heeeeellp! :( I'm so sad...I have tried a gajillion other schemes to accomplish this, and none worked...this was the closest and cleanest...2 days of work, and nothing to show.

Arg! Any ideas from yall??
 
Last edited:

-gr-

L1: Registered
Jul 11, 2008
17
12
Hm. How about this logic?

  • make a flag with the team set to Any.
  • parent two trigger multiples to the flag, make them slightly larger than the flag. Stack them exactly on top of each other and make them exactly the same size.
  • make the trigger_multiples team specific with filters. One for red, one for blu.
  • whichever trigger_multiple is OnTouch triggered first, disable the other trigger, set a compare/initial value in a logic compare, make one set set it to 0 and the other to 1. Then fire the logic_compare to set the team of the flag. Then the remaining enabled trigger_multiple should disable itself.
  • Use the OnDropped event to set the compare/initial value to zero or 1, and enable both trigger_multiples.
Then your "who can pickup when" logic becomes a truth table. :)

a b - flag_team
----------
0 0 - any
0 1 - any
1 0 - any
1 1 - red

or however you need it to be.

I believe there are only four relevant states (after the initial)
blu picked up the flag
red picked up the flag
blu dropped the flag
red dropped the flag

the only special state is "red dropped the flag" which would set the flag to red so they can't pick it up. The rest of the time it can be set to team ANY.

Any flaws? Been a while since I did binary logic truth tables.
 

(s2a) yahodahan

L3: Member
Apr 22, 2009
144
18
Wow, that looks like a great idea, it's a bit over my head but after a few re-reads I'm sure I'll figure it out!

Thank you very much, I'll let you know how it works!
 

BrokenTripod

L5: Dapper Member
May 11, 2009
248
65
I was thinking of something similar, but do the trigger_multiples still follow the flag after it's been picked up? I thought that picking up a flag killed the flag and it was just recreated when the person holding it dies.

Though I'm not positive, haha.

Also, there's the problem with 2 people grabbing it simultaneously? I guess one person would theoretically get the flag and the other person would be left out, though..
 
Apr 13, 2009
728
309
Isn't there a much more essential problem to this ? what if red picks up the intel and places it in a corner right by their respawn, where a few engineers build a sentry farm protected by medic-heavy pairs and demomen ? By allowing the defending team to choose the location of the objective, you are encouraging them to pick the single most inextricable place in the map and camp it to death. A little like what makes most panic events boring in left4dead.
 

ScrappyD2o

L1: Registered
Apr 7, 2009
18
2
The simplest way would be setting it to red when red picks up the flag, so when they drop it they can't pick it back up. When blue picks it up, the flag becomes neutral so both can pick it up. That's the least complex way I can think of.

But like Loc n lol said, you'll end up with a flag being camped in near their spawn with sentries all over the thing (once red figures out that bringing the intel to the capzone to cap it is a bad thing).
 

BrokenTripod

L5: Dapper Member
May 11, 2009
248
65
Yeah, I was thinking the same thing Loc_n_lol, bu I was kind of hoping yahodahan had already considered this and...hopefully would try to prevent this from happening? Like lowering the elevation for the red base or limiting areas to only one-ish ideal SG spots?

Not sure how well either of these solutions would work, but I'm pretty positive the first would encourage spawn camping though.
 

ScrappyD2o

L1: Registered
Apr 7, 2009
18
2
Well, you can force the intel to be dropped when red tries to enter a certain area using triggers (http://forums.tf2maps.net/showthread.php?t=6536 3rd post) to keep them from bringing it back to their spawn area to avoid spawn intel camping. Just set up a series of red-reacting triggers blocking off the entrances to their spawn, and any other areas you don't want them to go to.

But it'll still be tricky to balance this, though I'd be interested to see if you can pull off a balanced map this way.
 

(s2a) yahodahan

L3: Member
Apr 22, 2009
144
18
hmm, very good points...truthfully (should i admit this? haha) I somehow hadn't considered the very real possiblity of dropping the flag right in the spawn zone...

Well, the triggers to drop the flag would indeed work well- but I would worry that Red players would get frustrated while trying to drag the flag around and having no clue why it keeps dropping from them in certain areas...it would have to be visually obvious where they could go with the flag.

All that is just getting silly.

Perhaps it would just be better if ONLY blue could cap the flag? Or red could run with it for several seconds and then it would drop, maybe.

Thanks all!!
 

(s2a) yahodahan

L3: Member
Apr 22, 2009
144
18
Ok, i'm trying to put this together but really lost...ahhhg. Would anyone, especially -gr-, mind explaining a bit more in-depth about how to set up the logic compares?

Or, best of all, building the setup in hammer and uploading the file for me to look at? I'm a really visual person, not so much a programmer at all :(

I promise, after I look at the .vmf file, you can test me and if I don't fully understand it THEN, I'll give myself an F MINUS :D

thanks!!
 

-gr-

L1: Registered
Jul 11, 2008
17
12
Fantastic, glad to hear you got it working. I would have included a .vmf of the solution, but unfortunately work interfered with my free time.