OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: reedwasere on 15 Jul 2005, 23:33:53

Title: Helicopter Addon - Mis-Reading Altimeter ruining script.
Post by: reedwasere on 15 Jul 2005, 23:33:53
G'day Everyone.

I'm trying to create a script that drops parachutes of ammo and stuff out the back of an Mv-22 for a personal addon.

The script works and it's all good however, I noticed that when ever I created the chute, it always spawned straight at the ground.

Expreimenting, I found that it worked perfectly when I used other helicopters and planes, it was just the Mv-22.

So when I went again to fly the Mv-22, I noticed that no matter how high I flew, the altimeter always read me as at an altidtude of -1.

So I asumed this to be the problem.  That the getpos command was always receiving the altitude of -1.

I tried around with a few other custom addons, and sure enough I was right, a few of them also had the same problem, and those ones were the same ones that the script refused to work with.

So I was wondering if anyone knew of how to fix this, caz i am baffled  ;D
Title: Re:Helicopter Addon - Mis-Reading Altimeter ruining script.
Post by: UNN on 15 Jul 2005, 23:46:32
Hi,

Does your addon have a roadway LOD? If so, there are three ways you can get round it:

1)You might be able to getpos the pilot and use his height.

2)You can use SetCamaeraRelPos (http://www.ofpec.com/editors/comref.php?letter=C#camSetRelPos) to place a custom camera at the right position, they ignore roadways.

3)Or you can setpos a game logic at the heli's XY position, then use distance (http://www.ofpec.com/editors/comref.php?letter=D#distance) from the logic (always on the ground) to the helicopter.

I think CamSetRelPos will be the best one, as it will pitch with the aircraft. But let me know if you want more details on that or the others.
Title: Re:Helicopter Addon - Mis-Reading Altimeter ruining script.
Post by: reedwasere on 16 Jul 2005, 00:09:50
hey i never thought of that mate, that is perfect.

ty  ;D