Home   Help Search Login Register  

Author Topic: A different helicopter landing problem...  (Read 697 times)

0 Members and 1 Guest are viewing this topic.

Offline Skumball

  • Members
  • *
A different helicopter landing problem...
« on: 09 Nov 2002, 15:41:14 »
I've really got into this whole scripting thing so I am trying to do as much as possible in outside scripts and not in the editor. So I have had a go at a test map where a heli takes off, flies to a spot, lands, takes off, flies back and lands at the original spot. It's all done by getting the position of named H spots ( not G ones :P ) and telling the heli to land.

The problem is that the heli wont land on the original H but will fly back and land at the spot it just took off from. Isn't it supposed to land at the nearest available H? I have included the mission for you to look at, here is the script anyway:

Pilot1 assignAsDriver Heli1
[Pilot1] orderGetIn true
Pilot1 move (getPos Heli1a)
@unitReady Pilot1
Heli1 land "land"
@(getPos Heli1 select 2) < 2
~4
Pilot1 move (getPos Heli1b)
@unitReady Pilot1
Heli1 land "land"                           <----- problem
@(getPos Heli1 select 2) < 2
Pilot1 action ["Engine Off", Heli1]
exit

I know it can be done with waypoints, but I don't want to use them :)
« Last Edit: 09 Nov 2002, 15:44:39 by Skumball »

abomb1508

  • Guest
Re:A different helicopter landing problem...
« Reply #1 on: 15 Nov 2002, 11:06:20 »
i think your problem is that your entire script is happening in an instant, as far as ofp is concerned. so before you execute your "land" commands, give the helo a little window to wait in, or use a trigger. that way you can be sure that the helo will land at the nearest H, the one he should be on top of.

Have fun,

A-Bomb

Offline Skumball

  • Members
  • *
Re:A different helicopter landing problem...
« Reply #2 on: 16 Nov 2002, 15:10:10 »
thanks very much. I played around a bit more and it's all working fine now.