Home   Help Search Login Register  

Author Topic: Making a helocopter land  (Read 800 times)

0 Members and 1 Guest are viewing this topic.

Offline SAS4Life

  • Members
  • *
  • Sas4life
Making a helocopter land
« on: 20 May 2005, 10:32:00 »
I know everyone hates copters because they can never get them do exactly waht they want them too but. i need to know how to make a helocopter land. it has to land exactly on a H though and the people cant get out.

xCIA_BlackThorn

  • Guest
Re:Making a helocopter land
« Reply #1 on: 20 May 2005, 11:34:57 »
Try somthing like this script I've made up. It kinda fakes the landing, then at the last few feet FlyInHeight -0 then waiting 5 seconds then shutting down by means of fuel cut. If you dont know anything about scripts then copy and paste this in a notepad.txt and rename it to HBLZ.sqs then placing it in your mission folder. Put this in your Activation field of a trigger called by radio. [] exec "HBLZ.sqs"   If you add the pilots seperate from the chopper at start, then you will be able to order them to get out or whatever after the chopper lands. If you don't want the Engine to shut off, just remove the cut fuel part at the end so that when they FlyInHeight 0 they will leave the engine on.

Code: [Select]
;Home-Base Landing-Zone (HBLZ)

? UH60MG Distance HBLZ < 100 : GoTo "End"

UH60MG SetFuel 1
UH60MG FlyInHeight 150
UH60MG DoMove GetPos HBLZ
UH60MG SetSpeedMode "LIMITED"

#Loop
? UH60MG Distance HBLZ < 200 : GoTo "LS1"
~2
GoTo "Loop"

#LS1
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 100
? UH60MG Distance HBLZ < 110 : GoTo "LS2"
GoTo "LS1"

#LS2
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 80
? UH60MG Distance HBLZ < 90 : GoTo "LS3"
GoTo "LS2"

#LS3
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 60
_Height = GetPos UH60MG select 2
? _Height <= 65 : GoTo "LS4"
GoTo "LS3"

#LS4
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 40
_Height = GetPos UH60MG select 2
? _Height <= 45 : GoTo "LS5"
GoTo "LS4"

#LS5
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 20
~2
_Height = GetPos UH60MG select 2
? _Height <= 25 : GoTo "LS6"
GoTo "LS5"

#LS6
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 10
~2
_Height = GetPos UH60MG select 2
? _Height <= 13 : GoTo "LS7"
GoTo "LS6"

#LS7
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 8
~2
_Height = GetPos UH60MG select 2
? _Height <= 11 : GoTo "LS8"
GoTo "LS7"

#LS8
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 6
~1.5
_Height = GetPos UH60MG select 2
? _Height <= 9 : GoTo "LS9"
GoTo "LS8"

#LS9
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 4
~1
_Height = GetPos UH60MG select 2
? _Height <= 7 : GoTo "LS10"
GoTo "LS9"

#LS10
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight 2
~0.5
_Height = GetPos UH60MG select 2
? _Height <= 5 : GoTo "LS11"
GoTo "LS10"

#LS11
UH60MG DoMove GetPos HBLZ
UH60MG FlyInHeight -0
_Height = GetPos UH60MG select 2
? _Height < 2 : GoTo "Landed"
GoTo "LS11"

#Landed
~5
UH60MG SetFuel 0
Exit

#End
CutText ["Pilot: I'm already there!", "PLAIN DOWN"]
~3
CutText ["", "PLAIN"]
Exit
« Last Edit: 20 May 2005, 11:51:37 by xCIA_BlackThorn »

voodzia

  • Guest
Re:Making a helocopter land
« Reply #2 on: 20 May 2005, 14:35:53 »
Wow - that is a pretty complex script. But if you have a "H" or "Invisible H" object on the map then giving helo command land "mode" should work without problems I guess. Only make sure that LZ is in right place - it means no obstructions nearby (trees, bushes, rocks, buildings, etc) and ground should be quite flat there too.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Making a helocopter land
« Reply #3 on: 20 May 2005, 14:45:41 »
Invisible H and a land instruction should work, but it doesn't always.

What I have done in the past is to giev the chopper a series of waypoints very close together with a steadily reducing flyinheight.

Specifically:
WP1: Limited speed; flyinheight 50
WP2: flyinheight 45
WP3: flyinheigth 40

etc.  down to 5 and then 0


« Last Edit: 20 May 2005, 14:45:58 by THobson »

xCIA_BlackThorn

  • Guest
Re:Making a helocopter land
« Reply #4 on: 20 May 2005, 14:47:41 »
Yes the script is alittle long,   but it works flawlesly,   with obstructions in the way, because i am kinda cheating the land or forcing if you will.

voodzia

  • Guest
Re:Making a helocopter land
« Reply #5 on: 20 May 2005, 15:15:11 »
xCIA_BlackThorn - I got just one small suggestion - your script looks pretty good but you could make it a bit more universal to use in other situations. Call it e.g: [helo,lz] exec "hblz.sqs" and just replace this UH60MG with _helo=_this select 0 and HBLZ with _dest = _this select 1. It'll make your script more flexible I think.

Offline SAS4Life

  • Members
  • *
  • Sas4life
Re:Making a helocopter land
« Reply #6 on: 20 May 2005, 17:52:27 »
right thanx guys that should cover it. thanx a lot

Offline 999chris

  • Members
  • *
  • I'm a llama!
Re:Making a helocopter land
« Reply #7 on: 20 May 2005, 19:36:23 »
heli land "land"

xCIA_BlackThorn

  • Guest
Re:Making a helocopter land
« Reply #8 on: 20 May 2005, 21:12:17 »
Your right voodzia, Ill do that, Thanks.
« Last Edit: 20 May 2005, 21:12:39 by xCIA_BlackThorn »