buildingPos: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 ") |
||
Line 41: | Line 41: | ||
|x2= <code>_allpositions = [[nearestBuilding]] [[player]] [[buildingPos]] -1;</code> | |x2= <code>_allpositions = [[nearestBuilding]] [[player]] [[buildingPos]] -1;</code> | ||
|seealso= [[nearestBuilding]] [[nearestObject]] [[nearestObjects]] [[nearObjects]] [[buildingExit]] | |seealso= [[nearestBuilding]] [[nearestObject]] [[nearestObjects]] [[nearObjects]] [[buildingExit]] [[position]], [[setPos]], [[setWaypointHousePosition]], [[waypointHousePosition]], [[BIS_fnc_buildingPositions]] | ||
}} | }} | ||
Revision as of 14:03, 20 January 2022
Description
Syntax
- Syntax:
- building buildingPos index
- Parameters:
- building: Object
- index: Number - Index of a specific position
- Return Value:
- Array - A single building position in format PositionAGL. If building position with given index does not exist, [0, 0, 0] is returned
Examples
- Example 1:
_soldier setPosATL (_house1 buildingPos 2);
- Example 2:
_allpositions = nearestBuilding player buildingPos -1;
Additional Information
- See also:
- nearestBuilding nearestObject nearestObjects nearObjects buildingExit positionsetPossetWaypointHousePositionwaypointHousePositionBIS_fnc_buildingPositions
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
- 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 setPosATL ((nearestBuilding this) buildingPos 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. - Posted on January 26, 2007 - 01:02
- Kronzky
- The highest index is not necessarily the highest position in a building! Check the z-value to find out the absolute height of a position.
- Posted on January 08, 2011
- kju
- Almost all buildings loose their building positions when they get (visually) damaged or destroyed. Some debris do still have building positions though. So it is no technical limitation. Just most damaged/destructed buildings models do not (yet?) have building positions. Keep in mind that a damaged or destroyed building is a different object instance (and model).
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Positions