Jump to content
Sign in to follow this  
_qor

create BIS vehicle with waypoints

Recommended Posts

Hey,

so far I can spawn a BIS vehicle but cant give them waypoints.

I tried with this:

HDef1 = [getmarkerPos "heavyDefSB1", 0, "M2A2_EP1", West] call Bis_fnc_spawnvehicle;

{_x setskill ["general",0.99];} foreach units HDef1;


sleep 4;



wp1 = HDef1 addWaypoint [getMarkerPos "hdSB1", 10];
wp1 setWaypointType "SAD";
wp1 setWaypointBehaviour "AWARE";
wp1 setWaypointFormation "VEE";
wp1 setWaypointSpeed "FULL";
wp1 setWaypointCombatMode "YELLOW";

Share this post


Link to post
Share on other sites

take a look again at BIS_fnc_spawnvehicle...

Return Value:

Array - 0: created vehicle (Object), 1: all crew (Array of Objects), 2: vehicle's group (Group)

Waypoints are assigned to groups. You need to use HDef1 select 2

HDef1grp = Hdef1 select 2;

waypoint stuff here...

And your setskill should also be on the units of the crew/group, not the returned array

Share this post


Link to post
Share on other sites

So I defined the return values:

HDef1 = [getmarkerPos "heavyDefSB1", 300, "M2A2_EP1", West] call Bis_fnc_spawnvehicle;

HDef1veh = HDef1 select 0;
HDef1crw = HDef1 select 1;
HDef1grp = HDef1 select 2;

{_x setskill ["general",0.99];} foreach units HDef1crw;


sleep 4;



wp1 = HDef1grp addWaypoint [getMarkerPos "hdSB1", 10];
wp1 setWaypointType "SAD";
wp1 setWaypointBehaviour "AWARE";
wp1 setWaypointFormation "VEE";
wp1 setWaypointSpeed "FULL";
wp1 setWaypointCombatMode "YELLOW";

So it is working without having the setskill part. Cant find out whats wrong at that...

Edited by _qoR

Share this post


Link to post
Share on other sites

units is a group or object command.

either use:

{_x setskill ["general",0.99];} foreach HDef1crw; - return is an array with the units

or

{_x setskill ["general",0.99];} foreach units HDef1grp; - return is a group reference

Edited by panther42

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  

×