Home   Help Search Login Register  

Author Topic: Placing units inside buildings  (Read 1487 times)

0 Members and 1 Guest are viewing this topic.

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Placing units inside buildings
« 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.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Placing units inside buildings
« Reply #1 on: 14 Nov 2009, 14:21:07 »
Isn't buildingPos used for this?

unitname setPos ((object 123456) buildingPos 5) .......  for example


Planck
I know a little about a lot, and a lot about a little.

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Placing units inside buildings
« Reply #2 on: 14 Nov 2009, 15:04:50 »
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?
« Last Edit: 14 Nov 2009, 15:42:02 by Rellikki »

Offline Trexian

  • Members
  • *
Re: Placing units inside buildings
« Reply #3 on: 14 Nov 2009, 22:53:46 »
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.
Sic semper tyrannosauro.