buildingPos

From Bohemia Interactive Community
Revision as of 15:26, 15 April 2006 by Planck (talk | contribs)
Jump to navigation Jump to search

back to COMREF

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])