Jump to content
Sign in to follow this  
craptakular

Get aircraft to spawn in flight?

Recommended Posts

I have the script below, but it doesn't set the aircraft to "flying" when it spawns, its always on the ground. Any ideas?

//////////////////////////////////////////////////////////////////

// Function file for Armed Assault

// Created by: : Craptakular

//////////////////////////////////////////////////////////////////

if (!isServer) exitwith {};

_air1 = [markerPos "AAspawn", random 360, "L39_TK_EP1", east] call BIS_fnc_spawnVehicle;

_air1 flyInHeight 450;

_wp1 = _air1 addWaypoint [(getmarkerpos "AAwp1"), 500];

_wp1 setWaypointBehaviour "AWARE";

_wp1 setwaypointtype "MOVE";

_wp1 setWaypointFormation "STAG COLUMN";

_wp1 setWaypointSpeed "FULL";

_wp1 setwaypointstatements ["True", ""];

_wp2 = _air1 addWaypoint [(getmarkerpos "AAwp2"), 500];

_wp2 setWaypointBehaviour "UNCHANGED";

_wp2 setwaypointtype "MOVE";

_wp2 setWaypointFormation "STAG COLUMN";

_wp2 setWaypointSpeed "FULL";

_wp2 setwaypointstatements ["True", ""];

_wp3 = _air1 addWaypoint [(getmarkerpos "AAwp3"), 500];

_wp3 setWaypointBehaviour "UNCHANGED";

_wp3 setwaypointtype "MOVE";

_wp3 setWaypointFormation "LINE";

_wp3 setWaypointSpeed "FULL";

_wp3 setwaypointstatements ["True", ""];

_wp4 = _air1 addWaypoint [(getmarkerpos "AAwp3"), 500];

_wp4 setWaypointBehaviour "UNCHANGED";

_wp4 setwaypointtype "MOVE";

_wp4 setWaypointFormation "LINE";

_wp4 setWaypointSpeed "FULL";

_wp4 setwaypointstatements ["True", ""];

_wp5 = _air1 addWaypoint [(getmarkerpos "AAwp3"), 500];

_wp5 setWaypointBehaviour "UNCHANGED";

_wp5 setwaypointtype "MOVE";

_wp5 setWaypointFormation "LINE";

_wp5 setWaypointSpeed "FULL";

_wp5 setwaypointstatements ["True", ""];

_wp6 = _air1 addWaypoint [(getmarkerpos "AAwp3"), 1000];

_wp6 setWaypointBehaviour "COMBAT";

_wp6 setwaypointtype "SAD";

_wp6 setWaypointFormation "LINE";

_wp6 setWaypointSpeed "FULL";

_wp6 setwaypointstatements ["True", ""];

Share this post


Link to post
Share on other sites

_air1 isn't the name of the plane but an array of the plane and crew

_air1 = [markerPos "AAspawn", random 360, "L39_TK_EP1", east] call BIS_fnc_spawnVehicle; 
_air1veh= _air1 select 0;// vehicle
_air1veh setpos  [getpos _air1veh  select 0, getpos  _air1veh select 1,450];// set height pos
_air1veh  flyInHeight 450;

_wp1 = _air1veh addWaypoint [(getmarkerpos "AAwp1"), 500];
_wp1 setWaypointBehaviour "AWARE";;

ect.

Share this post


Link to post
Share on other sites

Yeh that partially worked, the plane doesn't follow the waypoints, just flies off in the other direction. hhmm...

Share this post


Link to post
Share on other sites

Yes my fault, I think it's should be as follows.

_air1 = [markerPos "AAspawn", random 360, "L39_TK_EP1", east] call BIS_fnc_spawnVehicle; 
_air1veh= _air1 select 0;// vehicle
_air1grp = _air1 select 2 ;// group of vehicle
_air1veh setpos  [getpos _air1veh  select 0, getpos  _air1veh select 1,450];// set height pos
_air1veh  flyInHeight 450;

_wp1 = _air1grp  addWaypoint [(getmarkerpos "AAwp1"), 500];
_wp1 setWaypointBehaviour "AWARE";;

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  

×