buildingPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 4: Line 4:
[[Category:Scripting Commands ArmA|B]]
[[Category:Scripting Commands ArmA|B]]


back to [[Scripting_Reference#B|COMREF]]


<h2 style="color:#000066">'''''building'' buildingPos ''index'''''</h2>
<h2 style="color:#000066">'''''building'' buildingPos ''index'''''</h2>

Revision as of 12:33, 23 April 2006


building buildingPos index


Operand types:

building: Object

index: Number

Type of returned value:

Array

Description:

Returns given indexed position in building, returned value is in format Position.


Examples:

buildingPos [building2, 1] unit setPos ((object 21222) buildingPos 1)


Comments:


These examples will move a unit to the 1st position specified in a buildings model, in the second example - bunker1.

this move (building buildingPos 1)

this move (bunker1 buildingPos 1)


In the default game buildings, the buildingPos is usually right behind a window.

This can make it easy to place units in the windows of buildings, by putting the unit near a building and putting this in its init field:

this setPos getPos (buildingPos [ nearestBuilding this, 1])