buildingPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|BUILDINGPOS]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|BUILDINGPOS]]
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|BUILDINGPOS]]
[[Category:Scripting Commands ArmA|BUILDINGPOS]]


| ofp |= Game name


<h2 style="color:#000066">'''''building'' buildingPos ''index'''''</h2>
|1.00|= Game version


|arg= global |= Arguments in MP
____________________________________________________________________________________________


'''Operand types:'''
| Returns the given indexed position in a building. |= Description
____________________________________________________________________________________________


'''building:''' [[Object]]
| '''buildingPos''' [building, index] |= Syntax


'''index:''' [[Number]]
|p1= building: [[Object]] |= Parameter 1


'''Type of returned value:'''
|p2= index: [[Integer]] |= Parameter 2


[[Array]]
| [[Position]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>soldier setPos (buildingPos [house1, 2])</pre> |= Example 1
____________________________________________________________________________________________


'''Description:'''
| [[position]], [[setPos]] |= See also


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


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Examples:'''
<!-- Note Section END -->
</dl>


'''buildingPos''' [building2, 1]
<h3 style="display:none">Bottom Section</h3>
unit [[setPos]] (([[object]] 21222) '''buildingPos''' 1)
Old Notes (temporary):


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 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.


'''Comments:'''
[[Category:Scripting Commands|BUILDINGPOS]]
 
[[Category:Scripting Commands OFP 1.96|BUILDINGPOS]]
 
[[Category:Scripting Commands OFP 1.46|BUILDINGPOS]]
These examples will move a unit to the 1st position specified in a buildings model, in the second example - '''''bunker1'''''.
[[Category:Scripting Commands ArmA|BUILDINGPOS]]
 
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 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.

Revision as of 23:09, 1 August 2006

Hover & click on the images for description

Description

Description:
Returns the given indexed position in a building.
Groups:
Uncategorised

Syntax

Syntax:
buildingPos [building, index]
Parameters:
building: Object
index: Integer
Return Value:
Position

Examples

Example 1:
soldier setPos (buildingPos [house1, 2])

Additional Information

See also:
positionsetPos

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

Bottom Section

Old Notes (temporary):

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 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.