Jump to content
Sign in to follow this  
mr.peanut

Spawn Height

Recommended Posts

When a unit is placed in the editor on a building, it ends up on top. Is the same true for a game logic?

If it is, is there anyway to get the same behaviour when using createVehicle? I want to spawn a game logic at any location but for it to end up on top of a building.

Share this post


Link to post
Share on other sites

im using a script to spawn a gun inside a building ontop of a box and as long as you set the height im sure you could do that. i dont think the GL ends up on top of a building automatically though.

Share this post


Link to post
Share on other sites

Thats funny cause Im trying to get the spawn ON the ground in a building.

Share this post


Link to post
Share on other sites

Placing a gamelogic over a bridge, then measuring the distance from the logic to the player walking under a bridge. Shows the game logic is set above ground.

Same applies if you place a logic on the Airport terminal. Only when you climb on the roof, does the distance register as 0.

Quote[/b] ]If it is, is there anyway to get the same behaviour when using createVehicle? I want to spawn a game logic at any location but for it to end up on top of a building.

One way is to place your logic where you want it, then place something like an invisible roadway or helipad at the same location. Any object that sticks to the ground will do. Then measure the distance between the two and use that value with the Setpos command.

Share this post


Link to post
Share on other sites
One way is to place your logic where you want it, then place something like an invisible roadway or helipad at the same location. Any object that sticks to the ground will do. Then measure the distance between the two and use that value with the Setpos command.

But will this work using a gl and helipad spawned ingame? If I setPos a helipad specifying only horizontal coords, will it stick to the roof of the building? I guess it is testing time. Is there debugging tool for ArmA similar to the ECP spectate mode?

Share this post


Link to post
Share on other sites
One way is to place your logic where you want it, then place something like an invisible roadway or helipad at the same location. Any object that sticks to the ground will do. Then measure the distance between the two and use that value with the Setpos command.

But will this work using a gl and helipad spawned ingame? If I setPos a helipad specifying only horizontal coords, will it stick to the roof of the building? I guess it is testing time. Is there debugging tool for ArmA similar to the ECP spectate mode?

For one, you can't move a heli H above the ground (yes you could technically move the model's center above the ground but the actual H won't leave the ground), it's mapped to the ground like the road models. You would need a new addon (with modified H model) to achieve that.

Second, I can't see any possible way to find the the height of the roof of a building without any references. I assume you want to find the height of the highest roadway surface (whatever it may be) over any given 2d position. Well unfortunately there's no practical way to do this without already knowing what object that surface belongs to.

Share this post


Link to post
Share on other sites

Yep, I am scuttled on this one. What I wanted was given an X,Y position to state whether or not a building occupied that position. I was hoping that there was some way to spawn a GL such that it would automatically end up on top of a building, similar to how units in the editor do.

Now I know I have to use nearObjects, boundingBox, modelToWorld and a point inside polygon function. This is not hard, but the other way would have been simpler and more efficient. Nothing sucks resources more than rescripting what the engine already does, but is not exposed.

Implementing this second method, has shown me that many native objects on a map, namely stone walls, trees, certain fences, and car wrecks, are not returned by nearObjects or its variants. O why o why?

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  

×