BIS fnc ambientAnim: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
m (template:command argument fix)
Line 16: Line 16:
|SYNTAX=
|SYNTAX=


|p1= Unit [[Object]] - Unit where the animations will be played |= Parameter 1
|p1= Unit [[Object]] - Unit where the animations will be played |PARAMETER1=
|p2= Animation-Set [[String]] - The animationset to play <br>
|p2= Animation-Set [[String]] - The animationset to play <br>
Possible values are: (Some values are missing because some of them do the same animations: "STAND" is the same as "STAND1")
Possible values are: (Some values are missing because some of them do the same animations: "STAND" is the same as "STAND1")
Line 56: Line 56:
*BRIEFING_POINT_RIGHT
*BRIEFING_POINT_RIGHT
*BRIEFING_POINT_TABLE
*BRIEFING_POINT_TABLE
|= Parameter 2
|PARAMETER2=
|p3= EquipmentLevel [[String]] - The equipment level of the unit <br>
|p3= EquipmentLevel [[String]] - The equipment level of the unit <br>
Possible values:
Possible values:
Line 65: Line 65:
*ASIS
*ASIS
*RANDOM
*RANDOM
|= Parameter 3
|PARAMETER3=
|p4= snapToObject [[Object]] - Optional - The object where the unit will be snapped to |= Parameter 4
|p4= snapToObject [[Object]] - Optional - The object where the unit will be snapped to |PARAMETER4=
|p5= interpolate [[Bool]] - Optional - Should try to interpolate into the ambient animation. Works only for some default stances
|p5= interpolate [[Bool]] - Optional - Should try to interpolate into the ambient animation. Works only for some default stances


Line 73: Line 73:
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>[player, "STAND1", "NONE"] [[call]] [[BIS_fnc_ambientAnim]];</code> |= Example 1
|x1= <code>[player, "STAND1", "NONE"] [[call]] [[BIS_fnc_ambientAnim]];</code> |EXAMPLE1=
|x2= <code>[_unit, "SIT", "NONE"] [[call]] [[BIS_fnc_ambientAnim]];</code>
|x2= <code>[_unit, "SIT", "NONE"] [[call]] [[BIS_fnc_ambientAnim]];</code>
Will search for a chair within 2 meters around the unit and will "place" the unit on it |=Example 2
Will search for a chair within 2 meters around the unit and will "place" the unit on it |EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 15:28, 7 April 2019


Hover & click on the images for description

Description

Description:
Play set of ambient animations on given unit.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[unit, animationset, equipmentlevel, snaptoObject, interpolate] call BIS_fnc_ambientAnim Template:note
Parameters:
Unit Object - Unit where the animations will be played
Animation-Set String - The animationset to play
Possible values are: (Some values are missing because some of them do the same animations: "STAND" is the same as "STAND1")
  • STAND1
  • STAND2
  • STAND_U1
  • STAND_U2
  • STAND_U3
  • WATCH
  • WATCH2
  • GUARD
  • LISTEN_BRIEFING
  • LEAN_ON_TABLE
  • LEAN
  • SIT_AT_TABLE
  • SIT1
  • SIT
  • SIT3
  • SIT_U1
  • SIT_U2
  • SIT_U3
  • SIT_HIGH1
  • SIT_HIGH
  • SIT_LOW
  • SIT_LOW_U
  • SIT_SAD1
  • SIT_SAD2
  • KNEEL
  • REPAIR_VEH_PRONE
  • REPAIR_VEH_KNEEL
  • REPAIR_VEH_STAND
  • PRONE_INJURED_U1
  • PRONE_INJURED_U2
  • PRONE_INJURED
  • KNEEL_TREAT
  • KNEEL_TREAT2
  • BRIEFING
  • BRIEFING_POINT_LEFT
  • BRIEFING_POINT_RIGHT
  • BRIEFING_POINT_TABLE
EquipmentLevel String - The equipment level of the unit
Possible values:
  • NONE
  • LIGHT
  • MEDIUM
  • FULL
  • ASIS
  • RANDOM
snapToObject Object - Optional - The object where the unit will be snapped to
interpolate Bool - Optional - Should try to interpolate into the ambient animation. Works only for some default stances
Return Value:
None

Examples

Example 1:
[player, "STAND1", "NONE"] call BIS_fnc_ambientAnim;
Example 2:
[_unit, "SIT", "NONE"] call BIS_fnc_ambientAnim; Will search for a chair within 2 meters around the unit and will "place" the unit on it

Additional Information

See also:
BIS_fnc_ambientAnimCombatBIS_fnc_ambientAnimGetParams

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 February 19, 2016 - 04:24
Pierre MGI
In 3den editor, place a blufor unit (B_soldier_A_F) near a camping chair (land_campingChair_V2_F).
In init field of the unit:
[this,"SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {waitUntil {behaviour _this == "combat"}; _this call BIS_fnc_ambientAnim__terminate;}
When this unit is aware of a threat, he will quit the "ambient animation" and will able to return fire.
Note: Bis_fnc_ambientAnimCombat doesn't need this script but the list of animations is limited.

Posted on August 08, 2016 - 01:37
Pierre MGI
To make this command working in MP (hosted server tested) [this,"SIT2"] call BIS_fnc_ambientAnim; // Wrong! the first JIP will throw the unit to position [0,0,0] if (isServer) then {[this,"SIT2"] call BIS_fnc_ambientAnim} // Wrong! only player located on server
will see the animation if (local this) then {[this,"SIT2"] call BIS_fnc_ambientAnim} // OK, best way if (isServer) then { [[this,"SIT2"],BIS_fnc_ambientAnim ] remoteExec ["call"] }; // OK


Bottom Section

Posted on July 28, 2016 - 19:14 (UTC)
TheBlueFire
If the unit should react to combat use BIS_fnc_ambientAnimCombat instead
Posted on September 11, 2016 - 16:33 (UTC)
Icaruk
Be careful using this function multiple times on MP, it uses createUnit (global).
If you use it on 20 units, 20 additional units (logics) will be created.