Jump to content

Photo
- - - - -

What To Call A Vehicle when using BIS Spawn Vehicle


  • Please log in to reply
No replies to this topic

#1 Bigpickle

Bigpickle

    Sergeant Major

  • Members
  • 1516 posts

Posted 09 July 2011 - 01:42 PM

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";
_ontarget=0;
_c130time=0;
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;};				
_c130time=_c130time+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;};				
_c130time=_c130time+1;

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

Edited by Bigpickle, 09 July 2011 - 08:56 PM.