Home   Help Search Login Register  

Author Topic: Don't Return the Flag!  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Don't Return the Flag!
« on: 03 Dec 2002, 12:47:25 »
I have been able to delay the flag returning to the pole if the enemy flagcarrier dies, but if someone from the dead flagcarrier picks up the flag, it still goes back after the delay.  I need to ensure the flag doesn't go back if someoneone else picks it up.  This is the trigger I use to return the flag if the flagcarrier dies:

condition:  (GetDammage flagowner FlagE>=1) and EFlagTaken
on activation: ownerW=ObjNull; FlagE setflagowner ObjNull; EFlagTaken = false; titletext["Time has expired to find the lost Soviet flag.\n The Soviet flag was returned!","Plain down"];

and I also have a trigger to account for the west flag.

If someone from the dead 's team picks up the flag before it goes back, it will say "newguy" has captured the "side" flag but afeter the delay the on activation script executes anyway.

Any ideas?

Pope_Zog

  • Guest
Re:Don't Return the Flag!
« Reply #1 on: 03 Dec 2002, 19:47:47 »
Put the Activation code inside a script and remove the delay from your trigger. In the script, start by pausing for the same number of seconds as your trigger originally paused, then check if the (new) flag owner is alive. If not, return the flag. Like so:
Code: [Select]
; Wait for so many seconds before returning the flag.
~20

? alive flagOwner FlagE : exit

ownerW=ObjNull;
FlagE setflagowner ObjNull;
EFlagTaken = false;
titletext["Time has expired to find the lost Soviet flag.\n The Soviet flag was returned!","Plain down"];

Pope Zog

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Don't Return the Flag!
« Reply #2 on: 04 Dec 2002, 02:51:16 »
Thanks, that did the trick!  Been pulling my hair out over this one and didn't even think of that alive flagowner exit line