Blitzen88 18 Posted June 4, 2019 Greetings, Im using a trigger which is activated whenever Blufor are present. Due to the spawn script that I am using, the trigger needs to be a “Blufor Present” type of trigger. Is there a way to delete all units of a particular side whenever Blufor units leave the trigger area? I looked into using the Deactivation part of the trigger but, per the wiki, it seems like you cant use the “this list” command on trigger deactivation. Does any one know how to do this? Thanks Share this post Link to post Share on other sites
pierremgi 4822 Posted June 4, 2019 in deact field: {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == THESIDEYOUWANT}) 1 Share this post Link to post Share on other sites
Blitzen88 18 Posted June 5, 2019 8 hours ago, pierremgi said: in deact field: {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == THESIDEYOUWANT}) This worked like a charm, thank you! I was unaware of the inArea command! Share this post Link to post Share on other sites
Rocketrolls 0 Posted July 29, 2022 How do I put a delay on this? Share this post Link to post Share on other sites
pierremgi 4822 Posted July 29, 2022 1 hour ago, Rocketrolls said: How do I put a delay on this? More than 3 years? Share this post Link to post Share on other sites
Rocketrolls 0 Posted July 30, 2022 Ha, just trying to build a mission but completely new to it. Came across this post on how to remove them. I just wondered if a delay can be added for say 15 minutes. 😄 Share this post Link to post Share on other sites
pierremgi 4822 Posted July 30, 2022 Not sure what you're asking for... What delay? If you want to add a delay: - on activation : just set the timer type countdown in the trigger. (in seconds) . So the activation code will run after that. See also timeOut which needs the condition stays true during the whole delay. - on deactivation: if you want to run some code after a delay, just spawn and sleep the deactivation code: [] spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == THESIDEYOUWANT}) }; // example for 1 minute thisTrigger spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea _this && side _x == Blufor}) }; - now, if you want to stop the repetition for act/deact because you don't need to re-activate the trigger at once after a deactivation, you need to add a variable like this: on condition: <your condition> && isnil "myDelay" on act: <your code>; myDelay = TRUE; // so the condtion is no more OK on deact: [] spawn {<your code if any>; sleep 60; myDelay = nil}; // so the condition could be OK (depending on the former condition) as myDelay is nil after 1 minute. EDITED Share this post Link to post Share on other sites
Rocketrolls 0 Posted July 31, 2022 I am trying to use in the deact trigger box [] spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == Blufor}) }; It just brings up error invalid number in expression... So what I am trying to do is when I leave the trigger zone the units will be deleted after around 10 minutes. lets say 60 seconds as your example. Appreciate the help 🙂 Share this post Link to post Share on other sites
Harzach 2516 Posted July 31, 2022 1 hour ago, Rocketrolls said: invalid number in expression... Always use code blocks when pasting code to the forums. Hidden/corrupt characters will appear as red dots. To clean your code: open a code block paste your code delete red dots re-copy code Share this post Link to post Share on other sites
Rocketrolls 0 Posted July 31, 2022 [] spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == Blufor}) }; Says undefined variable in thisTrigger when it tries to run the code. I don't see any red dots in the code. Cheers Share this post Link to post Share on other sites
pierremgi 4822 Posted July 31, 2022 oups! sorry thisTrigger spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea _this && side _x == Blufor}) }; 1 Share this post Link to post Share on other sites
Rocketrolls 0 Posted July 31, 2022 @pierremgi That worked a treat! Thanks a lot Share this post Link to post Share on other sites