OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Rellikki on 14 Nov 2009, 12:11:32
-
As the title says, what's the best way to place units inside buildings? The setPos command seems to have different effects compared to BIS' previous games - If you setPos an unit even one inch too high from the floor's level, he will stay floating there in the air, instead of falling down on the floor like they did in OFP and ArmA, and dies for no reason in a matter of seconds. It seems like the AI can't stand the power of the meditation...
Is there any more practical way of doing it? Setting each unit precisely on the floor's level one by one seems kinda time consuming. I was hoping that there was some command or something which would automatically align them on the floor's level.
-
Isn't buildingPos used for this?
unitname setPos ((object 123456) buildingPos 5) ....... for example
Planck
-
Ah yes, I had forgotten all about that command. It works just perfectly, thanks for the tip. Problem solved. :good:
For anyone interested, here's the correct syntax for the example above, as the "object" command doesn't work in Arma 2 anymore. Just an example:
unit setPos ((position player nearestObject 220142) buildingPos 1)
Edit: I take that back. BuildingPos doesn't return the exact height of the floor level. The units still seem to get injured when all they do is just stand still. This seems to be more of an engine problem rather than a mission editing problem. Bug tracker, anyone?
-
I think there is an issue with the buildingpos implementation. With the ambient civilian module, I routinely see AI spawned within walls and floors of buildings. May not be related, but it points to issues.