OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Buzz on 28 Jul 2003, 03:18:07

Title: Minimum Altitude
Post by: Buzz on 28 Jul 2003, 03:18:07
Me and a m8 of mine are workin on a dogfight map and were making a hard deck on this map. I'm still new at this scripting stuff, so how would you make it detect if the player has flown his aircraft below 500m?
Title: Re:Minimum Altitude
Post by: deaddog on 28 Jul 2003, 03:56:51
500 meters is pretty damn high for OFP, but you can do this:

_height = getpos planename select 2

That will return the altitude of your plane above ground.  If you want the altitude above sea level, then look in the editors depot under functions.  There is a nice function call getASLheight by Snypir.

 ;)
Title: Re:Minimum Altitude
Post by: Terame on 24 Sep 2003, 04:29:32
500 meters is pretty d**n high for OFP, but you can do this:

_height = getpos planename select 2

That will return the altitude of your plane above ground.  If you want the altitude above sea level, then look in the editors depot under functions.  There is a nice function call getASLheight by Snypir.

 ;)

Interested... if I wanted to have an event set to take place above or below a certain altitude (ie if the flying unit is within range I execute a flak script) how would this be worded in the trigger?


in shortened terms:
if height of plane1 is less than 200 then exec "flak.sqs"

(yes I know this isn't scripting syntax - I'm juts trying to explain in simple terms what I am trying to achieve )

thanks in advance ;D
Title: Re:Minimum Altitude
Post by: LCD on 24 Sep 2003, 04:40:50
triger shud b like dat

condition field :

getpos planename select 2 < 500

on activision :

[parameters] exec "flak.sqs"

------------------------

i donno da script u use :P

so u put da parameters need dere

LCD OUT