buildingPos: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| '''buildingPos''' | | building '''buildingPos''' index |= Syntax | ||
|p1= building: [[Object]] |= Parameter 1 | |p1= building: [[Object]] |= Parameter 1 | ||
Line 19: | Line 19: | ||
| [[Position]] |= Return value | | [[Position]] |= Return value | ||
____________________________________________________________________________________________ | |||
|s2= '''buildingPos''' [building, index] |= Syntax | |||
|p21= building: [[Object]] |= Parameter 1 | |||
|p22= index: [[Integer]] |= Parameter 2 | |||
|r2= [[Position]] |= Return value | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <pre>soldier setPos (buildingPos [house1, 2])</pre> |= Example 1 | |x1= <pre>soldier setPos (buildingPos [house1, 2]) | ||
; equivalent to | |||
soldier setPos (house1 buildingPos 2)</pre> |= Example 1 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 11:46, 2 August 2006
Description
- Description:
- Returns the given indexed position in a building.
- Groups:
- Uncategorised
Syntax
Alternative Syntax
- Syntax:
- buildingPos [building, index]
- Parameters:
- building: Object
- index: Integer
- Return Value:
- Position
Examples
- Example 1:
soldier setPos (buildingPos [house1, 2]) ; equivalent to soldier setPos (house1 buildingPos 2)
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on August 2, 2006 - 10:45
- hardrock
- Notes from before the conversion:
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])
The location returned by buildingPos is not reliable after the player has exited and then resumed the mission. For code that is executed immediately after the mission starts there is no problem.
If buildingPos locations are to be accessed during the mission when the player may have exited and then resumed, save the locations you require at the start of the mission and use these saved locations in your subsequent scripts.