OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ronin on 13 Sep 2002, 06:36:27
-
Hi,
I've made this script that works well, but I want to see if you guys can help me make it better.
Here is the script
helo1 flyinheight 10
helo1 move getmarkerpos "way1"
@unitready helo1
helo1 setspeedmode "limited"
helo1 move getpos helipad
helo1 flyinheight 4
@unitready helo1
@(getpos transport select 2) < 5
~8
p1 exec "alphaexit.sqs"
@Not (p1 in helo1) AND not (p2 in helo1) AND not (p3 in helo1)
helo1 move getmarkerpos "way2"
Exit
Now what happends is that the helicopter helo1 comes in really low, hovers about 4 m above the ground while the soldiers jump out and then it flies off to another waypoint.
What I don't like is the need to wait 8 seconds before the soldiers jump. I had to add this because the soldiers were jumping out before the helo reached the invisible helipad, and this being a coastal insertion they started jumping into the water.
I tried adding a line to detect when the distance between the helipad and the helicopter was less than 5 meters but that didn't work.
Does anyone know of a command I can use to make the soldiers wait until the helo is directly above the helipad rather than just in the approximate area before jumping out.
Thanks for any help,
Ronin
-
Just a thought, but if the helo is flying at 4 metres, then looking for distance < 5 m will only be true over a very small area, as I think the distance measures not just horizontal seperation, but vertical too. If you are after a 5m radius you may need to check for distance less than 6.4 metres (if my maths serves me well.
Helos = Pain in the Arse
Cheers,
Teeps
-
Can you not just use this:
@heliname distance Helipadname <10
8)PEACE
-
Thanks for all your replies,
I'll try the first suggestion, because i've tried gameer_77's suggestion and they still bailed out early for some reason. Might give it another go though.
Thanks,
Ronin
-
Check for the helicopters speed. 3-6 is really slow, and probably means the helicopter is close enough to it's destination. I recreated your mission from what you described at checking for the helicopters speed solved the problem with the ejection happening too soon.
@speed helo1 < 4
-
Thanks toadlife i'll try that straight away.
Ronin