What To Call A Vehicle when using BIS Spawn Vehicle

1 post in this topic

This comes from a larger script im working with but i've run into this problem.

I have used BIS function to create a vehicle with the following conditions as below:

_c130Grp = createGroup (west);
_pos1 = [(_bpos select 0)+3000 -(random 2000),(_bpos select 1)+3000 -(random 2000),(_bpos select 2)+1000 ];
[_pos1, 180, "PRACS_C130", _c130Grp] call bis_fnc_spawnvehicle;
_postarg = [(_bpos select 0),(_bpos select 1),(_bpos select 2)+ 200];
_wp1 = _c130Grp addWaypoint [_postarg, 0];
_wp2 = _c130Grp addWaypoint [_pos1, 0];
[_c130Grp, 2] setWaypointType "CYCLE";
_c130Grp setBehaviour "CARELESS";
_c130Grp setSpeedMode "LIMITED";
if ((date select 3) < 4 or (date select 3) > 20) then
vehicle ( _c130Grp select 0) action ["lightOn",vehicle (_c130Grp select 0)];

But the problem is when i come to set the waypoint loop criteria below i'm not sure how to do it. If I use this a C130 turns up but the script never spawns the crate.

 for [{_loop=0}, {_loop<1}, {_loop=_loop}] do  
if ([color="Red"]_c130 [/color]distance _wp1 < 50) then {ontarget=1;_Loop=1;};
if (!alive (driver [color="Red"]_c130[/color]) OR _c130time > 600 OR !canmove [color="Red"]_c130[/color]) then {ontarget=2;_Loop=1;};				

If I change it to suit the group name i get lots of errors that i dont know how to solve

for [{_loop=0}, {_loop<1}, {_loop=_loop}] do  
if ([color="RoyalBlue"]_c130Grp[/color] distance _wp1 < 50) then {ontarget=1;_Loop=1;};
if (!alive (driver [color="RoyalBlue"]_c130Grp[/color]) OR _c130time > 600 OR !canmove [color="RoyalBlue"]_c130Grp[/color]) then {ontarget=2;_Loop=1;};				

Could someone help me with what I need to name my aircraft in the loop?

Edited by Bigpickle

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