OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Zombie 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?
-
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:
; 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
-
Thanks, that did the trick! Been pulling my hair out over this one and didn't even think of that alive flagowner exit line