Comrades in Arms Discussion Board
Problem spawning chopper in and keeping flyInHeight - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: Problem spawning chopper in and keeping flyInHeight (/showthread.php?tid=3363)



Problem spawning chopper in and keeping flyInHeight - treendy - 05-09-2016

Hello,

Any help would be great here... trying to get a chopper to spawn in at bottom left of map and fly to destination keeping its height at 40.

However, using the code below, the chopper spawns in as expected, moves to the waypoints as expected, however it slowly increases its height along the way, and by the time its at the destination its too high to even be seen!

this is the code I am using (I have tried a few variations, and hoping now its just something wrong or missing):

Code:
_airSup1Array = [[100,100], 45, "O_Heli_Attack_02_F", _groupp1] call Bis_fnc_spawnvehicle;
airSup1 = _airSup1Array select 0;
airSup1 flyInHeight 40;

_v1wp1 =_groupp1 addWaypoint [[110,110], 0];
[_groupp1, 0] setWaypointStatements ["true", "airSup1 flyInHeight 40;"];
[_groupp1, 0] setWaypointSpeed "FULL";
[_groupp1, 0] setWaypointBehaviour "COMBAT";
         
_v1wp2 =_groupp1 addWaypoint [getMarkerPos "mrkFirstLocation", 0];
[_groupp1, 1] setWaypointType "LOITER";
[_groupp1, 1] setWaypointLoiterType "CIRCLE";



Re: Problem spawning chopper in and keeping flyInHeight - Varanon - 05-09-2016

If memory serves, you need to put the flyinheight in the waypoint statments (via setWaypointStatments)


Re: Problem spawning chopper in and keeping flyInHeight - treendy - 05-10-2016

Thanks, that is in the code above:

Code:
[_groupp1, 0] setWaypointStatements ["true", "airSup1 flyInHeight 40;"];

However... after playing the mission, it seemed to be fine, it was only running in editor seemed to have this issue.  Im not 100% sure though.  I may have changed something, but didnt think I did.

Thank you.


Re: Problem spawning chopper in and keeping flyInHeight - Varanon - 05-10-2016

(05-10-2016, 09:00 AM)treendy link Wrote: Thanks, that is in the code above:

Yeah, for the first waypoint. AFAIK, it has to be for all waypoints, because for the currently active waypoint, it always assumes a default height


Re: Problem spawning chopper in and keeping flyInHeight - treendy - 05-10-2016

ah haa! thank you, I will try that out later : )