Jump to content
Sign in to follow this  
avibird 1

can you set a specific number of units to set off a trigger condition ie > 5 blufor u

Recommended Posts

Is there a way to only allow a trigger to work only if 5 or more blufor units enter the trigger area. I know how to set a trigger for but can you specify a set number blufor units for a trigger. Thanks Avibird.

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites

this && {alive _x} count thisList >= 5

{alive _x && {side _x == west}} count thisList >= 5

---------- Post added at 10:13 ---------- Previous post was at 10:08 ----------

Oops, syntax error. Re-posted.

Edited by Iceman77

Share this post


Link to post
Share on other sites

Hey iceman so the trigger will only fire if blue has > then 5 units! I am still looking for a good way to reset mission areas for this side mission pack that I am working on as a template Using a few of the most popular Unit spawning scripts to populate The mission AO. I want the missions to be replayable during the session if the session is on a 24 hr dedicated server.

Share this post


Link to post
Share on other sites
this && {alive _x} count thisList >= 5

{alive _x && {side _x == west}} count thisList >= 5

---------- Post added at 10:13 ---------- Previous post was at 10:08 ----------

Oops, syntax error. Re-posted.

Do you even need the alive check, isn't a unit automatically assigned to civ once it dies.

Share this post


Link to post
Share on other sites

Alive check is there so you have something to count. There's nothing else you can count besides alive BLUFOR units that'd make sense as trigger condition.

Share this post


Link to post
Share on other sites

Ok so you can set a number of units to fire the trigger and I know how to set a time period to allow the trigger to be activated Again Following the initial activation. But what i really want is a way to allow the trigger to activate Again only if the AO has not had Blufor units inside the trigger area for a set time for example 1 hour 3600 seconds. So each side mission can only be played again after 1 hr of non blufor units in the area. Can this be done!!! Thank you guys.

Share this post


Link to post
Share on other sites

You could have a small script run on the activation of the trigger, have it with a sleep of 3600, and then basically reset the trigger with these commands after the sleep is done:

https://community.bistudio.com/wiki/setTriggerActivation

https://community.bistudio.com/wiki/setTriggerStatements

So to walk through it, you name your trigger whatever (i.e. "trigger1"), set it to run only once, do all the condition statements and such in the editor, put a call to the trigger reset sqf in the onAct field, in that sqf there is a sleep command (being your 3600 seconds, or whatever) then after that you essentially reset the trigger1's activation and condition codes with the two commands above, and it should be "reset" and waiting for the next triggerable event, being when 5+ Blufor enter the area.

Share this post


Link to post
Share on other sites

Thank you Jshock I will give that a go but what else would be in the recall SQF? and how would it look in the onact field of the trigger to be called to reset the trigger from the SQF. This scripting still makes my head hurt at times lol

Share this post


Link to post
Share on other sites

The onAct call would be something like this:

nul = [] execVM "resetTrigger.sqf";

The sqf would look something like this:

sleep 3600;

trigger1 setTriggerActivation ["WEST", "PRESENT", false];
trigger1 setTriggerStatements ["{alive _x && {side _x == west}} count thisList >= 5", "nul = [] execVM 'resetTrigger.sqf';", ""];

Share this post


Link to post
Share on other sites

Watching some football will check it out later and let you know if it works (: thank you for the help!

Share this post


Link to post
Share on other sites

@Jshock & Iceman77 ): not working I guess the trigger is not getting called back once the time comes up and I move in with the correct number of blufor units!!! What else can I try gentleman. Avibird

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×