Is there a way to detect flag carriers without capture zones?

Discussion in 'Mapping Questions & Discussion' started by Pocket, Feb 11, 2019.

  1. Pocket

    aa Pocket Naylte ven, naylte yen.

    Messages:
    4,577
    Positive Ratings:
    2,424
    Yes, it's me. Hi again.

    I had an idea... well, stole one, more like, but you'll see what I mean once I get a prototype together, if I can make the mechanics work. Should be pretty simple and straightforward. Anyway, is there an entity that can specifically trigger when a flag carrier walks into it, without actually triggering a capture?
     
  2. Sir Nick

    Sir Nick L1: Registered

    Messages:
    20
    Positive Ratings:
    3
    I can think of a workaround, but be warned it's possible it breaks some server mods. If you use players target name and a name filter, you can check who has a flag. I'll break it down:

    1. On the flag in question, set up an output like this: OnPickup -> !activator -> AddOutput targetname -> "flagholder" (note: this can be whatever you want)
    2. Also on the flag, set up an output like this: OnDrop -> !activator -> AddOutput targetname -> "" (make sure the parameter of this one is left blank. This resets the targetname of the player to nothing.)
    3. Create a filter_activator_name, call it "flag_check" perhaps, and set to allow activators with the name you used before. In this example, it would be flagholder
    4. Create a trigger_multiple in the area you want, and set it's filter to your filter_activator name. In this case, it would be flag_check.
    5. Set up whatever outputs you want from your trigger_multiple. These should now only fire when activated by a player with the targetname flagholder (or whatever else you made it).

    In summation, you're giving the player with the flag a name, and then checking for that name when they enter your trigger. The only issue with this method is I've heard that some server mods use player's targetname value, but I don't think it's very prevalent. It's also possible there are other ways to do this.

    Good luck!
     
  3. Pocket

    aa Pocket Naylte ven, naylte yen.

    Messages:
    4,577
    Positive Ratings:
    2,424
    Actually I just realized... you know how some A/D maps (particularly the ones made for the contest, ages ago—Vector, HAARP, etc.) sound an alert when the flag carrier is getting close to the capture zone? Is that automatic based on distance or is there actually a trigger of some sort for that?
     
  4. Da Spud Lord

    aa Da Spud Lord Occasionally I make maps

    Messages:
    1,290
    Positive Ratings:
    857
    • Thanks Thanks x 1
  5. Pocket

    aa Pocket Naylte ven, naylte yen.

    Messages:
    4,577
    Positive Ratings:
    2,424
    Hmm. For some reason, the Team parameter for func_flagdetectionzone doesn't seem to actually do anything when a neutral flag is involved, and there's no way to attach a team filter. So I've had to concoct an elaborate workaround. The good news is, the workaround does work.

    And I also remembered that A/D CTF is more complicated than just switching the cap zones, so I'll be working on this for another day at least.