buildingPos

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Operation Flashpoint version 1.00Arguments of this scripting command don't have to be local to the client the command is executed on

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
Returns the given indexed position in a building

The index is 0-based (i.e. the first possible position would be 0. So if a building has 5 positions listed in the editor, 4 would be the highest position index usable with this command).

Syntax

Syntax:
building buildingPos index
Parameters:
building: Object
index: Integer
Return Value:
Array

Examples

Example 1:
_soldier setPos (_house1 buildingPos 2)

Additional Information

Multiplayer:
Behaviour unknown.
See also:
nearestBuilding, position, setPos

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

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

Bdfy
'(building buildingPos 1)' will return [0,0,0] if buildingPos with this index does not exist

Bottom Section

Personal tools
Buy ArmA now!