"King of the Flag" logic problem

Anreol

L2: Junior Member
Feb 21, 2015
60
273
So as some people know, my 72HR map is a "King of the flag" that is basically grab the flag and hold it in the control point to win.
(Big thanks to Cherry for the original logic)

So I feedback saying that you should be able to block the point and that each team should have their own flag at spawn and carry it to the point.
And I tried to make my own version of the logic.
This version uses the control point trigger as base, so there is that timer to capture the point that normal control points have, and flag detectors to allow the teams to cap.

The flag detectors are this simple:

Code:
OnStartTouchFlag > trigger_capture_area > SetTeamCanCap 2 1  (This allows team RED capture the point)
OnEndTouchFlag > trigger_capture_area > SetTeamCanCap 2 0  (This should block RED from capturing the point)

Same goes for BLU team.

Code:
OnStartTouchFlag > trigger_capture_area > SetTeamCanCap 3 1
OnEndTouchFlag > trigger_capture_area > SetTeamCanCap 3 0

Both triggers start disabled and enables after 30 seconds.

At the start, you cant capture the point or block it if the flag of your team didn't touch the zone, once your team got the flag at the point you can cap and block.
The thing is that once the flag enters the area (It allows block and capture) it can leave and players are allowed to capture and block it anyway (Its supposed that if the flag leaves the area the point should block X team from capturing/blocking)

I have no idea why this happens and how to fix it.
Here is the .vmf if someone wants to help https://www.dropbox.com/s/bysrooomik07bk5/King of the flag V2 prefab.vmf?dl=0
 

Powerlord

L3: Member
May 8, 2010
127
60
When you say "leave" do you mean players carrying it outside the flagdetectionzone or when the flag resets?

If it's just the latter, you may be able to fix it using the item_teamflag's OnReturn to call the trigger_capture_area's SetTeamCanCap for that team.
 

chemelia

yndersn't
aa
May 11, 2014
406
619
I'm not sure I entirely understand the problem, but when I was setting up somewhat similar logic for another map I just used two separate trigger_capture_area's, one for each team, but tied to the same control point of course. I then enabled and disabled them with the flag detection zone rather than using setteamcancap inputs. I don't remember whether or not it worked as intended, but it's certainly worth a shot.