Jump to content
Sign in to follow this  
Benneb

Get Building Height

Recommended Posts

Hi all,

Using a combination of the excellent PlaceGroupInBuilding and HousePatrol scripts, i have managed to make a garrisoned units script. Unfortunatly it seems some buildings have a couple of crazy positions set in them. Most of the stupid position bugs i have managed to overcome.

The problem i am having is in some of the buildings there are positions far higher than the actual height of the building, resulting in some comedy placements with enemy units stood in the sky.

Does anyone know how to get the height of an object (In this case a house/building)? Not the placement height of the building but the actual size of it. If i can get that i can ignore any position with a height, say 1 meter higher than the buildings height.

Apologies if this has been asked before. I did search for it but i couldnt find it.

Share this post


Link to post
Share on other sites

_bbox = boundingBox _obj;
_height = _obj modelToWorld (_bbox select 1);
_height = _height select 2;

this should do the job. Its not 100% accurate, but enough to verify your positions.

Share this post


Link to post
Share on other sites

Brilliant, that looks exactly like what i was after. Thanks guys.

Ill give it a go when i get home :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×