Jump to content
Sign in to follow this  
Dave82

Help starting a mission with a plane in flight

Recommended Posts

Hi, first let me just say I'm a complete novice at scripting (which you probably guessed looking at the thread title alone). I'm trying to use guide I found on armahollic which is good but I just can't seem to get this to work. What I want to do is have amission starting with some planes flying overhead, I can get the planes to start in the air but no matter what script I try they are always the same hight above the ground and they stall and crash. The script in the guide had the following two lines "this setPos [(getPos this select 0),(getPos this select 1),10]" and "AV8B1 setVelocity[0,100,100];" AV8B1 being the name of the unit. I combined the two (one for the starting height and one for starting velocity which seemed to make sense but so far it's not working. I've tried playing with the numbers but they don't seem to be making any difference.

Can someone please shed light on my life threatening plight?

Share this post


Link to post
Share on other sites

To expand upon Ltn.Ghost's post... you may be able to solve your 'problem' entirely by setting the planes' "Special" property to "Flying". This will start them in the air, at cruise speed. Furthermore, you can then use the following code in the plane's "Initialization" box to give it a specific height (if the default isn't suitable):

this setPos [(getPos this select 0), (getPos this select 1), 300];
this flyInHeight 300;

The above example would cause the plane to start, and continue flying, at 300 metres. Change the two instances of '300' to vary the height.

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  

×