OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Mandoble on 01 Jul 2007, 17:51:07

Title: Gamelogics dont fall down
Post by: Mandoble on 01 Jul 2007, 17:51:07
You place a gamelogic over a building in the map and its altitude above ground is 0, now you destroy that building and gamelogic's altitude above ground becomes the height of the destroyed building before being destroyed. Just take that into consideration when doing weird things like me :D

Title: Re: Gamelogics dont fall down
Post by: The-Architect on 01 Jul 2007, 17:53:48
Hmm, queer indeed. I reckon you should add this phenomenon to the wiki. It's the kind of stuff that needs to be updated so we can all learn this stuff inside out. Good, if rather odd discovery.  :clap:
Title: Re: Gamelogics dont fall down
Post by: Planck on 01 Jul 2007, 18:10:42
Ah, but........

Is the engine counting the 'ground' as the roof of the building, which will have a roadway LOD.
Maybe it is seeing the roadway as the ground, so when you destroy the building, it stays where it was originally put, at the height of the buildings roof.

What does setPosASL and getPosASL tell you when placed and after the building is destroyed?


Planck
Title: Re: Gamelogics dont fall down
Post by: Mandoble on 01 Jul 2007, 18:18:49
Effectively, gamelogics stay all the time where you placed them, they dont fall from roofs  :P
And yes, any roof is considered ground, so getPos of anything above any roof will return 0. And getPosASL seems to be failing there too as it seems to consider the distance between ground at unit's position and sea plus the distance between unit and ground (which is 0 at roofs). Alternatively you may use an empty detector (created trigger), place it at the position of the unit with Z = 0, and check distance between unit and trigger. May be that distance will be the correct ASL height of the unit.