setUnitPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
m (Text replacement - "\|s([0-9])\= ([^' ]+)'''([^' ]+)'''([^ ]*) " to "|s$1= $2$3$4 ")
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| ofp |Game name=
|game1= ofp
|version1= 1.00


|1.00|Game version=
|game2= ofpe
|version2= 1.00


|eff= global|Multiplayer Effects=
|game3= arma1
|arg= local|Multiplayer Arguments=
|version3= 1.00
____________________________________________________________________________________________


| Set unit position rules. Mode may be one of:
|game4= arma2
* '''"DOWN"''' - unit goes prone and stays prone.
|version4= 1.00
* '''"UP"''' - unit stands and stays standing.
 
* '''"MIDDLE"''' - Kneel Position. ArmA version 1.04 ''(Unit will not kneel if it is unarmed'')
|game5= arma2oa
* '''"AUTO"''' - unit chooses mode according to circumstances.
|version5= 1.50
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]]:
 
|game6= tkoh
|version6= 1.00
 
|game7= arma3
|version7= 0.50
 
|eff= global
 
|arg= local
 
|gr1= Unit Control
 
|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]]:
<code>[[player]] [[playAction]] "PlayerProne"; // DOWN
<code>[[player]] [[playAction]] "PlayerProne"; // DOWN
[[player]] [[playAction]] "PlayerStand"; // UP
[[player]] [[playAction]] "PlayerStand"; // UP
[[player]] [[playAction]] "PlayerCrouch"; // MIDDLE</code>
[[player]] [[playAction]] "PlayerCrouch"; // MIDDLE</code>


|DESCRIPTION=
|s1= unit [[setUnitPos]] mode
____________________________________________________________________________________________


| unit '''setUnitPos''' mode |SYNTAX=
|p1= unit: [[Object]]


|p1= unit: [[Object]] |PARAMETER1=
|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.


|p2= mode: [[String]] - as above |PARAMETER2=
|r1= [[Nothing]]


| [[Nothing]] |RETURNVALUE=
|x1= <code>_soldier [[setUnitPos]] "UP";</code>
____________________________________________________________________________________________
 
|x1= <code>_soldier [[setUnitPos]] "UP";</code> |EXAMPLE1=
____________________________________________________________________________________________
 
| [[setUnitPosWeak]], [[unitPos]]|SEEALSO=


|seealso= [[setUnitPosWeak]], [[unitPos]]
}}
}}


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


<dd class="notedate">Posted on 18 September 2008‎  
<dt><dt>
<dt class="note">[[User:Dwarden|Dwarden]]
<dd class="notedate">Posted on 18 September 2008‎ </dd>
<dt class="note">[[User:Dwarden|Dwarden]]</dt>
<dd class="note">
<dd class="note">
Command most likely only works if run before [[join]] into group after [[createUnit]].
Command most likely only works if run before [[join]] into group after [[createUnit]].
 
<dt><dt>
<dd class="notedate">Posted on 11 March 2011
<dd class="notedate">Posted on 11 March 2011</dd>
<dt class="note">[[User:kju|kju]]
<dt class="note">[[User:kju|kju]]</dt>
<dd class="note">
<dd class="note">
The above  comment by [[User:Dwarden|Dwarden]] about 'an additional join required' is no longer true for Operation Arrowhead.
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 class="notedate">Posted on 26 September 2013‎</dd>
<dt class="note">[[User:Katulobotomia|Katulobotomia]]
<dt class="note">[[User:Katulobotomia|Katulobotomia]]</dt>
<dd class="note">
<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.
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.


<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SETUNITPOS]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SETUNITPOS]]
[[Category:Scripting Commands OFP 1.46|SETUNITPOS]]
[[Category:Scripting Commands Armed Assault|SETUNITPOS]]
[[Category:Scripting Commands Arma 2|SETUNITPOS]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 19:07, 20 June 2021

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:
setUnitPosWeakunitPos

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.