setUnitPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<code>([^\[]+)<\/code>" to "<sqf>$1</sqf>")
(84 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|S]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97|S]]
[[Category:Scripting Commands OFP 1.46|S]]
[[Category:Scripting Commands ArmA|S]]


back to [[Scripting_Reference#S|COMREF]]
|game1= ofp
|version1= 1.00


<h2 style="color:#000066">'''''person'' setUnitPos ''mode'''''</h2>
|game2= ofpe
|version2= 1.00


|game3= arma1
|version3= 1.00


'''Operand types:'''
|game4= arma2
|version4= 1.00


'''person:''' [[Object]]
|game5= arma2oa
|version5= 1.50


'''mode:''' [[String]]
|game6= tkoh
|version6= 1.00


'''Type of returned value:'''
|game7= arma3
|version7= 0.50


[[Nothing]]
|eff= global


'''Description:'''
|arg= local


Set unit position rules.
|gr1= Unit Control


'''Mode''' may be one of:
|descr= Set unit position rules. This command will not change the stance of the human player, even though it will change the output of [[unitPos]] command. To change player stance use [[playAction]] or [[playActionNow]]:
<sqf>player playAction "PlayerProne"; // DOWN
player playAction "PlayerStand"; // UP
player playAction "PlayerCrouch"; // MIDDLE</sqf>


* '''"DOWN"''' - person goes prone and stays prone.
|s1= unit [[setUnitPos]] mode
* '''"UP"''' - person stands and stays standing.
* '''"AUTO"''' - person chooses mode according to circumstances.


|p1= unit: [[Object]]


'''Example:'''
|p2= mode: [[String]] - Can be:
* "DOWN" - Unit goes prone and stays prone.
* "UP" - Unit stands and stays standing.
* "MIDDLE" - Kneel Position. {{GVI|arma1|1.04}} - Unit will not kneel if it is unarmed
* "AUTO" - Unit chooses mode according to circumstances.


loon1 '''setUnitPos''' '''"UP"'''
|r1= [[Nothing]]
 
|x1= <sqf>_soldier setUnitPos "UP";</sqf>
 
|seealso= [[setUnitPosWeak]] [[unitPos]]
}}
 
<dl class="command_description">
 
<dt><dt>
<dd class="notedate">Posted on 18 September 2008‎ </dd>
<dt class="note">[[User:Dwarden|Dwarden]]</dt>
<dd class="note">
Command most likely only works if run before [[join]] into group after [[createUnit]].
<dt><dt>
<dd class="notedate">Posted on 11 March 2011</dd>
<dt class="note">[[User:kju|kju]]</dt>
<dd class="note">
The above  comment by [[User:Dwarden|Dwarden]] about 'an additional join required' is no longer true for Operation Arrowhead.
<dt><dt>
<dd class="notedate">Posted on 26 September 2013‎</dd>
<dt class="note">[[User:Katulobotomia|Katulobotomia]]</dt>
<dd class="note">
A unit might not always go prone when ordered to [[setUnitPos]] "DOWN", if the unit doesn't agree with the command. To force the unit to go prone, stop the unit from firing by [[setCombatMode]] "BLUE" and then order the unit to prone.
 
</dl>

Revision as of 21:08, 13 May 2022

Hover & click on the images for description

Description

Description:
Set unit position rules. This command will not change the stance of the human player, even though it will change the output of unitPos command. To change player stance use playAction or playActionNow:
player playAction "PlayerProne"; // DOWN player playAction "PlayerStand"; // UP player playAction "PlayerCrouch"; // MIDDLE
Groups:
Unit Control

Syntax

Syntax:
unit setUnitPos mode
Parameters:
unit: Object
mode: String - Can be:
  • "DOWN" - Unit goes prone and stays prone.
  • "UP" - Unit stands and stays standing.
  • "MIDDLE" - Kneel Position. Logo A1 black.png1.04 - Unit will not kneel if it is unarmed
  • "AUTO" - Unit chooses mode according to circumstances.
Return Value:
Nothing

Examples

Example 1:
_soldier setUnitPos "UP";

Additional Information

See also:
setUnitPosWeak unitPos

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 18 September 2008‎
Dwarden
Command most likely only works if run before join into group after createUnit.
Posted on 11 March 2011
kju
The above comment by Dwarden about 'an additional join required' is no longer true for Operation Arrowhead.
Posted on 26 September 2013‎
Katulobotomia
A unit might not always go prone when ordered to setUnitPos "DOWN", if the unit doesn't agree with the command. To force the unit to go prone, stop the unit from firing by setCombatMode "BLUE" and then order the unit to prone.