action: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Bot: Replacing category Scripting Commands Arma 3 with Arma 3: Scripting Commands)
m (Bot: Reverted to revision 103937 by Yuval on 2017-07-20T12:22:18Z)
Line 47: Line 47:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|ACTION]]
[[Category:Scripting Commands OFP 1.99|ACTION]]
[[Category:Scripting Commands OFP 1.96|ACTION]]
[[Category:Scripting Commands OFP 1.46|ACTION]]
[[Category:Scripting Commands ArmA|ACTION]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Unit_Control|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
Line 83: Line 94:
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->
[[Category:Scripting Commands|ACTION]]
[[Category:Scripting Commands OFP 1.99|ACTION]]
[[Category:Scripting Commands OFP 1.96|ACTION]]
[[Category:Scripting Commands OFP 1.46|ACTION]]
[[Category:Scripting Commands ArmA|ACTION]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Arma 3: Scripting Commands]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Unit Control|{{uc:{{PAGENAME}}}}]]

Revision as of 18:49, 3 December 2018

Hover & click on the images for description

Description

Description:
Make a unit to perform an action. Use the List of Actions for reference about the available actions and their syntax. arguments global.gif

NOTES:
  • While this command should be executed where unit is local, it is not always the case. Actions such as "Eject", "GetOut", "GetInXXXX", "MoveToXXXX", etc can be executed on remote units.
  • In SP, when user Alt+Tabs the simulation is paused and so the action will also halt until user returns to the game. For example, player action ["GetInDriver", car] executed while user is Alt+Tabbed will result in user seeing the action happening when he returns to the game screen. This doesn't happen in MP.
Groups:
Uncategorised

Syntax

Syntax:
unit action actionArray
Parameters:
unit: Object
actionArray: Array
Return Value:
Nothing

Examples

Example 1:
player action ["SitDown", player];
Example 2:
_soldier action ["Eject", vehicle _soldier];

Additional Information

See also:
actionIDsactionParamsaddActionsetUserActionTextinGameUISetEventHandlershowHUDinputActionremoveActionremoveAllActions

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

Posted on 28 Aug, 2009
tom_48_97
In ArmA 2, you can place a unique unit (for example a boat, far of all combats) and use it for all command lines with action.

Bottom Section

Posted on March 27, 2015 - 17:57 (UTC)
DreadedEntity
This command has no effect when a dead unit is used as input.
Posted on June 27, 2017 - 02:15 (UTC)
DrSova
player action ["SWITCHWEAPON",player,player,-1] Switching weapon to the back.
Posted on July 20, 2017 - 12:22 (UTC)
Yuval
Some of the actions (such as "DropWeapon") do not always execute, and there should be a set of conditions for them to run. The unit must be able to perform the dropping animation in order for the action to properly execute. So, if for example we spawn a unit at [0,0,0] and make it perform a "DropWeapon" action - it won't work if [0,0,0] is water (which it is, if the current map is an island) because the unit will be swimming.

Also, you cannot stack up actions right after the other. If you run a "DropWeapon" action when the current action animation is still going - it will not perform. There are a few more conditions for an action to perform, but relying on a hundred percent success of the action is not a good practice.