buildingPos: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 44: | Line 44: | ||
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 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''' [ [[ | this [[setpos]] [[getpos]] ('''buildingPos''' [ [[nearestBuilding]] this, 1]) |
Revision as of 15:30, 21 April 2006
back to COMREF
building buildingPos index
Operand types:
building: Object
index: Number
Type of returned value:
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])