Greetings, Killzone
You may want to try adding the line
heli land "LAND"
in place of that last
Heli flyinheight -1
That you have. It will command the chopper to stay on the ground, and kill the engines.
Place down an 'invisible H' object where you want the chopper to land, or place one on the map and move it to the landing position. This is good practive when using the land command, as it makes the chopper behaviour a little more predictible. But note the use of the word 'little'...
Alternatively, use "GET IN" or "GET OUT" instead of "LAND" to keep the engines running, althogh this may not prevent the chopper from flying up.
Alternatively (
), you could run a 0.1 second loop scanning for any movement away from the invisible H (helo distance invH >2), and then kill the chopper's velocity if movement occurs (helo setVelocity [0, 0, 0]).
It's not a bad script for a 'learner', actually. Given time, you'll find your own scripting style and discover just what is possible in OFP with sqs scripts...
Good luck in your scripting 'career' Killzone! :thumbsup:
Reference: OFPEC Online COMREF:
http://www.ofpec.com/editors/comref.php?letter=LEDIT: snYpir's "Quick Helicopter Landings"
http://www.ofpec.com/editors/resource_view.php?id=316-Supreme Commander PsyWarrior
-Psychic Productions C-in-C
P.S. - You may also want to examine this script:
http://www.ofpec.com/editors/resource_view.php?id=316Normally, I would direct you to this immediately, but as you are using the script as a learning process, rather than just to achieve the results, you may just want to look at how snYpir did it.