Forcing a flag to be dropped

Discussion in 'Mapping Questions & Discussion' started by ScrappyD2o, May 2, 2009.

  1. ScrappyD2o

    ScrappyD2o L1: Registered

    Messages:
    18
    Positive Ratings:
    2
    Is this possible to do, using a trigger event? For example, if someone's carrying the flag, and a capture zone changes owner, is it possible to have the flag dropped (not reset) if it's being carried?
     
  2. -gr-

    -gr- L1: Registered

    Messages:
    17
    Positive Ratings:
    12
    I haven't tried this, but a possibility that comes to mind is a client command to force a "dropitem" (default keybind for the L key) to the player carrying the flag.

    Problems with this idea: May require cheats to be enabled for the client command to work, and you'll have to uniquely identify/name the flag carrier ahead of time, ideally while they're picking up the flag.

    Otherwise, no way that I know of to force a real legitimate drop... aside from kililng the player. :)

    Other crazy ideas:
    • Change the team of the flag while it's being carried. Might do nothing, might do something?
    • Re-parent the flag to another non-solid invisible entity that is spawned at the players location, it might break the carry. (Parent the spawner to the player first, ForceSpawn the template, then re-parent the flag?)
    • Same as above, but create the illusion of it being dropped by doing a roundactivate, killing it off, then respawning it at the players location and changing the team. To prevent it from being picked up before the team change, have it spawn disabled by default, then enable it after the team change.
     
  3. ScrappyD2o

    ScrappyD2o L1: Registered

    Messages:
    18
    Positive Ratings:
    2
    I figured out how to do it in a much simpler way. In case someone's interested in how to do it:

    - Create a triggerbrush around the intel, make sure it extends far enough to touch the player when it's on their back (so make it 8 units under and above the intel).
    - Set this to a func_respawnroom
    - Set the func_respawnroom to Start Disabled: Yes
    - Turn off SmartEdit, and add a "parentname" key, and parent your respawnroom brush to the intel to stick it in place around it.
    - Set up your triggering event to set the team of the func_respawnroom to whichever team should not be holding the intel when the trigger's set off (ie. blue captures the control point, set the func_respawnroom to team red to make them drop it if they have it)
    - Set your triggering event to enable the func_respawnroom with a 0.01 delay, then disable it again with a 0.02 delay.

    Intel dropped on trigger!

    I hope the above is clear enough, I really suck at explaining things :p
     
    • Thanks Thanks x 2
  4. -gr-

    -gr- L1: Registered

    Messages:
    17
    Positive Ratings:
    12
    Nice! It's interesting to figure out which brush entities work properly when parented & moved. I've tried parenting trigger_hurts to players in the past with no success, so this is good to know. Perhaps a tigger_hurt parented to the flag might.... :)

    Do you actually see the Drop event fire, or is there something else going on behind the scenes?
     
  5. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    Or get my FGD and it's already there. :)
     
  6. ScrappyD2o

    ScrappyD2o L1: Registered

    Messages:
    18
    Positive Ratings:
    2
    Nothing behind the scenes. It acts just as if you try to run the flag into a spawnroom.

    Thanks for the heads up Boojum! Will give that FGD a try :)
     
  7. Dr Forrester

    Dr Forrester L2: Junior Member

    Messages:
    60
    Positive Ratings:
    22
    I've seen it done before, so yeah.

    Hmmm... make the trigger_hurt big enough, tie an explosion to it, and set the flag to respawn immediately after being dropped, and you could do a CTF suicide bommer thing...
     
  8. Schmoe

    Schmoe L2: Junior Member

    Messages:
    60
    Positive Ratings:
    1
    I could maybe see why this would be a cool thing, but in my mind there has to be a benefit for the carrier... If Valve opened up the source code and allowed mappers to grant 100% crits or uber charge (while still taking damage from the trigger), then I can see this dynamic as being worth it.

    EDIT: or in the style of the 3wave CTF vampire rune.
     
  9. ScrappyD2o

    ScrappyD2o L1: Registered

    Messages:
    18
    Positive Ratings:
    2
    If you want a benefit for the carrier, you could maybe tie a regeneration zone to the flag, giving them regen as if they were healed by a dispenser or something. Then if the flag's dropped (either the carrier gets killed, or he drops the flag himself) the whole thing goes kaboom. Would be great with a custom flag model that looks like a dynamite belt or something :D

    Only downside would be that this could be used to grief, blowing up your own team and stuff.
     
  10. Dr Forrester

    Dr Forrester L2: Junior Member

    Messages:
    60
    Positive Ratings:
    22
    Ah, but see, you set it so that say, on entering a certain area, the trigger_hurt triggers on an attack/defend style map, say near a cap point. You parent one to kill the flag holder and another to kill red team members around him, clearing the point for the attackers. If the person carrying the flag dies, it immediately returns to the blue base. That way, you could have someone try to use the "bomb" to clear the way, with the risk of making himself the primary target of enemy fire... and the change that the blue team will sneak onto the point while the red team is off chasing the flag carrier for fear that he'll blow them to smithereens.
     
  11. The_Ulf

    The_Ulf L6: Sharp Member

    Messages:
    399
    Positive Ratings:
    112
    This is great - I'll be using this flag-drop system for ctf_bomb_factory.

    ...Which I am realizing now is exactly the gametype Dr Forrester is describing here:

     
  12. lopidav

    lopidav L1: Registered

    Messages:
    11
    Positive Ratings:
    4
    If someone still has this problem: item_teamflag's have ForceDrop input now.
     
    • Like Like x 3