Home   Help Search Login Register  

Author Topic: Absolute Height  (Read 993 times)

0 Members and 2 Guests are viewing this topic.

NA556

  • Guest
Absolute Height
« on: 29 Dec 2004, 13:33:18 »
I was wondering, is there a script to make a plane stay at a constant height instead of hugging the terrian?

Thanks

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Absolute Height
« Reply #1 on: 29 Dec 2004, 14:01:13 »
You could try

#Loop

Plane setpos [getpos plane select 0, getpos plane select 1, 200]
~0.1
goto "Loop"

That would keep it at 200m (even if it was destroyed though)

Alternativly:

#Loop

?(getdammage plane > 0.9):goto "End"
Plane setpos [getpos plane select 0, getpos plane select 1, 200]
~0.1
goto "Loop"

#End

exit

Would allow the plane to fall out of the sky when it was killed.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Absolute Height
« Reply #2 on: 29 Dec 2004, 14:01:47 »
<plane> flyinheight <height>

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Absolute Height
« Reply #3 on: 29 Dec 2004, 14:03:22 »
I thought that only worked on helicopters.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Absolute Height
« Reply #4 on: 29 Dec 2004, 14:05:11 »
no, its anything that will fly, i thought.
I think i've done it before...

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Absolute Height
« Reply #5 on: 29 Dec 2004, 14:08:02 »
yep, just tested it with an a10, in the init line.
it immediately flew up to 200 meters from the default (50?,100?)

but it definitely works

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Absolute Height
« Reply #6 on: 29 Dec 2004, 14:11:53 »
Must be my dodgy old command manual misinforming me again  ;)

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Absolute Height
« Reply #7 on: 29 Dec 2004, 14:14:44 »
Yeah I just tested it out too. Worked a charm.

Kaliyuga

  • Guest
Re:Absolute Height
« Reply #8 on: 29 Dec 2004, 16:35:50 »
 It was added to effect planes in a patch.. it did use to be for choppers only.

BibiPhoque

  • Guest
Re:Absolute Height
« Reply #9 on: 30 Dec 2004, 14:11:39 »
I don't think that answers NA556's question. He's talking about absolute height.
You need an objet at sea level, and some triangulation to calculate the absolute altitude of a flying object. I don't know if it's possible though.

Edit: I found a script doing exactly this:
http://www.ofpec.com/editors/resource_view.php?id=329

But that's only for getting the real altitude. Not setting it. Maybe some workaround can be found to do this.

Edit 2 : Of course! Am I stupid. Just do this :

Code: [Select]
_plane = _this select 0
#Loop
_plane setvelocity [velocity _plane select 0, velocity _plane select 1, 0]
~0.05
goto "Loop"
« Last Edit: 30 Dec 2004, 15:44:35 by BibiPhoque »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Absolute Height
« Reply #10 on: 30 Dec 2004, 16:39:05 »
I was wondering, is there a script to make a plane stay at a constant height instead of hugging the terrian?

Thanks
i'm pretty sure that means what it says

BibiPhoque

  • Guest
Re:Absolute Height
« Reply #11 on: 30 Dec 2004, 17:02:56 »
What you said will actually make the plane "hug" the terrain, that is, it will constantly be 200m (for example) above the terrain : the plane will not follow a straight line, unless the terrain is completely flat.
Maybe I'm mistaken by the word "hug" (sorry I'm french). In that case, forget what I said earlier :p
Maybe I'm also mistaken by the word "absolute". But I seriously doubt it.
« Last Edit: 30 Dec 2004, 17:28:10 by BibiPhoque »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Absolute Height
« Reply #12 on: 30 Dec 2004, 17:42:40 »
wow, that last post really makes me sound like an arse, doesn't it? sorry bout that. :P

by "hugging" i thought he meant flying really low to the ground:
i guess it could be either, it would help if he replied. Then he could tell us exactly what he means..

NA556

  • Guest
Re:Absolute Height
« Reply #13 on: 30 Dec 2004, 21:10:53 »
sorry, i should have made myself more clear. By 'hugging the terrain' i ment the plane adjusting its height according to the terrian. As in when a plane goes over a hill it increases its altitude (so to keep the same hieght compared to land level) and vice versa with a vally or the such. But i need it as a sea level constant.
« Last Edit: 30 Dec 2004, 21:13:52 by NA556 »

BibiPhoque

  • Guest
Re:Absolute Height
« Reply #14 on: 30 Dec 2004, 23:08:14 »
Then you can do this :
Code: [Select]
_plane = _this select 0
_height = 200
_plane setpos [getpos _plane select 0, getpos _plane select 1, _height]
#Loop
_plane setvelocity [velocity _plane select 0, velocity _plane select 1, 0]
~0.05
goto "Loop"
Here the plane will begin at an altitude of 200m above the ground, and will fly in a straight line. If you need to know at any moment the real altitude of the plane, you can use this script made by dschulle : http://www.ofpec.com/editors/resource_view.php?id=329