buildingPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:


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




Line 30: Line 30:
These examples will move a unit to the 1st position specified in a buildings model, in the second example - '''''bunker1'''''.
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]] (building '''buildingPos''' 1)


this move (bunker1 '''buildingPos''' 1)
this [[move]] (bunker1 '''buildingPos''' 1)





Revision as of 16:26, 15 April 2006

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