Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
joejoe87577

UAV should fly always at the same heigt

Recommended Posts

Hello,

I got a little Problem with the UAV in ArmA 2 CO. I want it to fly always in the same heigt above the sea level and not the terrain level. One of the guys of the german hx3 forums gave me this syntax:

temp = [VehicleName,200] spawn {private ["_u","_h"];_u=_this select 0;_h=_this select 1; while {alive _u}do{_u setPosASL [getPosASL _u select 0, getPosASL _u select 1, _h];sleep 0.01}}

With this syntax the UAV is locked to 200m above the sea, but the AI tries to fly just 100m above the terrain. The result is, that the nose of the UAV is not horizontal but a little bit tilted forward.

So my Idea was to make a script witch gives the heigt of the UAV above the ground as value and then give this heigt to the AI piot of the UAV as flyInHeigt command. And here the problems begun.

while { alive mq9 } do
{
   mq9 flyInHeigt (getPosATL mq9 select 2);
   sleep 0.25;
};

This is the script that I made as solution. But ArmA 2 gives me an Error Message:

while { alive mq9 } do
{
   mq9 |#|flyInHeigt (getPosATL mq9 select 2);
   sleep 0.25;
};
Error missing ;

This is my problem at the moment. How can I make this little script work?

JoeJoe

edit: I already searched trough the forums and also googled the problem. But I found no solution.

Edited by JoeJoe87577

Share this post


Link to post
Share on other sites

Thanks, now it works as it should. The next time I should have a closer look to the letters :D.

Share this post


Link to post
Share on other sites

Joe, Do you have a demo mission that your using that in would love to see how that works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×