Jump to content
Sign in to follow this  
Toasticuss

Tricky Waypoint Conditions

Recommended Posts

Hey guys, I have made a convoy and I have made some waypoints for it, currently I need it to stop at one waypoint and wait for all players to be inside 1 of 3 vehicles before moving on again

I am currently stumped on how I should do this, should I make conditions for each unit like

((!alive player1) OR (player1 in veh1))

and make that for every single unit and vehicle? Or is there a simpler way to do that?

If a unit were to get out id like the vehicles to stop and wait for them to get back in too.

Thanks for anyone that can help me.

Share this post


Link to post
Share on other sites

Hi there.

Yes you can use that way or if the units are all in the same group you can do the following:

waitUntil

{

({(group _x == my_grp)&&((_x in my_vehicle1)||(_x in my_vehicle2)||(_x in my_vehicle3)}count allUnits == {group _x == my_grp}count allUnits)

};

Where my_grp is the group you want to check.

_neo_

Share this post


Link to post
Share on other sites
Hi there.

Yes you can use that way or if the units are all in the same group you can do the following:

Where my_grp is the group you want to check.

_neo_

Jeez, how can you guys remember all of this?

Where could I put that code? All the units are in the same group, its giving me a blank error in the condition of the waypoint....

Edited by Toasticuss

Share this post


Link to post
Share on other sites
Jeez, how can you guys remember all of this?

Where do I put that code? Its giving me a blank error in the condition....

Remember you need to put the waitUntil statement in a script, but you can try to put in the waypoint condition:

({(group _x == my_grp)&&((_x in my_vehicle1)||(_x in my_vehicle2)||(_x in my_vehicle3)}count allUnits == {group _x == my_grp}count allUnits)

Not sure how it will react.

_neo_

Share this post


Link to post
Share on other sites
Remember you need to put the waitUntil statement in a script, but you can try to put in the waypoint condition:

({(group _x == my_grp)&&((_x in my_vehicle1)||(_x in my_vehicle2)||(_x in my_vehicle3)}count allUnits == {group _x == my_grp}count allUnits) 

Not sure how it will react.

_neo_

({(group _x == my_grp)&&((_x in my_vehicle1)||(_x in my_vehicle2)||(_x in my_vehicle3)}count allUnits == {group _x == my_grp}count allUnits) 

This is giving errors in the condition

I still dont understand how I should be doing this...

Share this post


Link to post
Share on other sites

Yes probably it wont work in the condition of a waypoint, try putting it in a script.

_neo_

Share this post


Link to post
Share on other sites
Yes probably it wont work in the condition of a waypoint, try putting it in a script.

_neo_

What all should I put into the script?

Should the waypoint activation read as

null = [] execVM "moveout.sqf";?

Share this post


Link to post
Share on other sites

You can try the following. (BTW, I would advise you to use waypoints in script so you can have a bigger control over them)

On the Condition of the waypoint put:

all_are_in

OnAct:

nul = [] execVM "all_in.sqf";

all_in.sqf

waitUntil

{

({(group _x == my_grp)&&((_x in my_vehicle1)||(_x in my_vehicle2)||(_x in my_vehicle3)}count allUnits == {group _x == my_grp}count allUnits)

};

all_are_in = true;

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

Are all of the players in a single group? If so, the easiest solution would be to put the following in the condition field of the lead vehicle's "moving on" waypoint:

({vehicle _x in [veh1,veh2,veh3]} count units groupName) == ({alive _x} count units groupName)

This line will compare the number of units in correct vehicles to the number of units that are alive. If all alive units are also in correct vehicles, it will return true. Simply replace "veh1," etc., and "groupName" with the proper names in your mission, and you should be good to go.

If the players are not all in the same group, then replace "units groupName" with an array of all the units for whom you'd like to check, e.g., [fred,tom,bob,timmy].

Share this post


Link to post
Share on other sites
Are all of the players in a single group? If so, the easiest solution would be to put the following in the condition field of the lead vehicle's "moving on" waypoint:

({vehicle _x in [veh1,veh2,veh3]} count units groupName) == ({alive _x} count units groupName)

This line will compare the number of units in correct vehicles to the number of units that are alive. If all alive units are also in correct vehicles, it will return true. Simply replace "veh1," etc., and "groupName" with the proper names in your mission, and you should be good to go.

If the players are not all in the same group, then replace "units groupName" with an array of all the units for whom you'd like to check, e.g., [fred,tom,bob,timmy].

Wow that works thank you!!!

So if i wanted an array it would be

({vehicle _x in [veh1,veh2,veh3]} count [fred,tom,bob,timmy]) == ({alive _x} count [fred,tom,bob,timmy])

Share this post


Link to post
Share on other sites
So if i wanted an array it would be (code)

That is correct.

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  

×