BIS fnc ambientAnim: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(79 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |= Game name
|gr1= Ambient


|1.00|= Game version
|descr= Play set of ambient animations on given unit. If the unit should react to combat, use [[BIS_fnc_ambientAnimCombat]] instead.
____________________________________________________________________________________________
{{Feature|informative|Animations can be cancelled using <sqf inline>_unit call BIS_fnc_ambientAnim__terminate</sqf>.}}


| Play set of ambient animations on given unit. |= Description
|s1= [unit, animationSet, equipmentLevel, snapTo, interpolate, attachToLogic] call [[BIS_fnc_ambientAnim]]
____________________________________________________________________________________________


| [unit, animationset, equipmentlevel, snaptoObject, interpolate] call '''BIS_fnc_ambientAnim''' |= Syntax
|p1= unit: [[Object]] - unit that will play the animations


|p1= Unit [[Object]] - Unit where the animations will be played |= Parameter 1
|p2= animationSet: [[String]] - the animation set to play. Possible values:
|p2= Animation-Set [[String]] - The animationset to play <br>
{{{!}}
Possible values are: (Some values are missing becouse some of them do the same animations: "STAND" is the same as "STAND1")
{{!}}+ style="caption-side: bottom" {{!}} ''some values are missing due to duplicate results, e.g "STAND" does the same as "STAND1"''
*STAND1
{{!}}- style="vertical-align: top"
*STAND2
{{!}}
*STAND_U1
* STAND1
*STAND_U2
* STAND2
*STAND_U3
* STAND_U1
*WATCH
* STAND_U2
*WATCH2
* STAND_U3
*GUARD
* WATCH
*LISTEN_BRIEFING
* WATCH2
*LEAN_ON_TABLE
* GUARD
*LEAN
* LISTEN_BRIEFING
*SIT_AT_TABLE
* LEAN_ON_TABLE
*SIT1
* LEAN
*SIT
{{!}}
*SIT3
* SIT_AT_TABLE
*SIT_U1
* SIT1
*SIT_U2
* SIT
*SIT_U3
* SIT3
*SIT_HIGH1
* SIT_U1
*SIT_HIGH
* SIT_U2
*SIT_LOW
* SIT_U3
*SIT_LOW_U
* SIT_HIGH1
*SIT_SAD1
* SIT_HIGH
*SIT_SAD2
* SIT_LOW
*KNEEL
* SIT_LOW_U
*REPAIR_VEH_PRONE
* SIT_SAD1
*REPAIR_VEH_KNEEL
* SIT_SAD2
*REPAIR_VEH_STAND
{{!}}
*PRONE_INJURED_U1
* KNEEL
*PRONE_INJURED_U2
* REPAIR_VEH_PRONE
*PRONE_INJURED
* REPAIR_VEH_KNEEL
*KNEEL_TREAT
* REPAIR_VEH_STAND
*KNEEL_TREAT2
* PRONE_INJURED_U1
*BRIEFING
* PRONE_INJURED_U2
*BRIEFING_POINT_LEFT
* PRONE_INJURED
*BRIEFING_POINT_RIGHT
* KNEEL_TREAT
*BRIEFING_POINT_TABLE
* KNEEL_TREAT2
|= Parameter 2
* BRIEFING
|p3= EquipmentLevel [[String]] - The equipment level of the unit <br>
* BRIEFING_POINT_LEFT
Possible values:
* BRIEFING_POINT_RIGHT
*NONE
* BRIEFING_POINT_TABLE
*LIGHT
{{!}}}
*MEDIUM
*FULL
*RANDOM
|= Parameter 3
|p4= snapToObject [[Object]] - Optional - The object where the unit will be snapped to |= Parameter 4
|p5= interpolate [[Bool]] - Optional - Should try to interpolate into the ambient animation. Works only for some default stances


|p3= equipmentLevel: [[String]] - the equipment level of the unit. Possible values:
* NONE
* LIGHT
* MEDIUM
* FULL
* ASIS
* RANDOM


| None |= Return value
|p4= snapTo: [[Object]] - (Optional, default [[objNull]]) the object where the unit will be snapped to
____________________________________________________________________________________________


|x1= <code>[player, "STAND1", "NONE"] call BIS_fnc_ambientAnim;</code> |= Example 1
|p5= interpolate: [[Boolean]] - (Optional, default [[false]]) should try to interpolate into the ambient animation. Works only for some default stances
|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
____________________________________________________________________________________________


| |= See also
|p6= attachToLogic: [[Boolean]] - (Optional, default [[true]]) [[true]] to [[attachTo|attach]] the unit to the created logic object, forcing it in one position


|r1= [[Nothing]]
|x1= <sqf>[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim;</sqf>
|x2= <sqf>
// will search for a chair within 2 meters around the unit and will place the unit on it
[_unit, "SIT", "NONE"] call BIS_fnc_ambientAnim;
</sqf>
|seealso= [[BIS_fnc_ambientAnimCombat]] [[BIS_fnc_ambientAnimGetParams]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= PierreMGI
<!-- Note Section BEGIN -->
|timestamp= 20160219042400
<dd class="notedate">Posted on February 19, 2016 - 04:24
|text= In 3den editor, place a blufor unit (B_soldier_A_F) near a camping chair (land_campingChair_V2_F).<br>
<dt class="note">'''[[User:Pierre MGI|Pierre MGI]]'''
<dd class="note">In 3den editor, place a blufor unit (B_soldier_A_F) near a camping chair (land_campingChair_V2_F).<br>
In init field of the unit:<br>
In init field of the unit:<br>
<code>[this,"SIT2"] call BIS_fnc_ambientAnim;<br>0 = this spawn {waitUntil {behaviour _this == "combat"};<br>
<sqf>
_this call BIS_fnc_ambientAnim__terminate;}</code>
[this, "SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {
waitUntil { behaviour _this == "combat"};
_this call BIS_fnc_ambientAnim__terminate;
};
</sqf>
When this unit is aware of a threat, he will quit the "ambient animation" and will able to return fire.<br>
When this unit is aware of a threat, he will quit the "ambient animation" and will able to return fire.<br>
Note: [[BIS_fnc_ambientAnimCombat]] doesn't need this script but the list of animations is limited.
}}


<!-- Note Section END -->
{{Note
</dl>
|user= PierreMGI
|timestamp= 20160808013700
|text= To make this command working in MP (hosted server tested)
<sqf>
[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"] remoteExecCall ["BIS_fnc_ambientAnim"]; }; // OK
</sqf>
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Function Group: Ambient|{{uc:ambientAnim}}]]
|user= Icaruk
[[Category:Functions|{{uc:ambientAnim}}]]
|timestamp= 20160811163300
[[Category:{{Name|arma3}}: Functions|{{uc:ambientAnim}}]]
|text= Be careful using this function multiple times on MP, it creates a Logic using [[createUnit]] (which is global).<br>
 
If you use it on 20 units, 20 additional logics will be created.
<!-- CONTINUE Notes -->
}}
<dl class="command_description">
<dd class="notedate">Posted on July 28, 2016 - 19:14 (UTC)</dd>
<dt class="note">[[User:TheBlueFire|TheBlueFire]]</dt>
<dd class="note">
If the unit should react to combat use [[BIS_fnc_ambientAnimCombat]] instead
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 14:38, 27 July 2022

Hover & click on the images for description

Description

Description:
Play set of ambient animations on given unit. If the unit should react to combat, use BIS_fnc_ambientAnimCombat instead.
Animations can be cancelled using _unit call BIS_fnc_ambientAnim__terminate.
Execution:
call
Groups:
Ambient

Syntax

Syntax:
[unit, animationSet, equipmentLevel, snapTo, interpolate, attachToLogic] call BIS_fnc_ambientAnim
Parameters:
unit: Object - unit that will play the animations
animationSet: String - the animation set to play. Possible values:
some values are missing due to duplicate results, e.g "STAND" does 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
snapTo: Object - (Optional, default objNull) the object where the unit will be snapped to
interpolate: Boolean - (Optional, default false) should try to interpolate into the ambient animation. Works only for some default stances
attachToLogic: Boolean - (Optional, default true) true to attach the unit to the created logic object, forcing it in one position
Return Value:
Nothing

Examples

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

Additional Information

See also:
BIS_fnc_ambientAnimCombat BIS_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
PierreMGI - c
Posted on Feb 19, 2016 - 04:24 (UTC)
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.
PierreMGI - c
Posted on Aug 08, 2016 - 01:37 (UTC)
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"] remoteExecCall ["BIS_fnc_ambientAnim"]; }; // OK
Icaruk - c
Posted on Aug 11, 2016 - 16:33 (UTC)
Be careful using this function multiple times on MP, it creates a Logic using createUnit (which is global).
If you use it on 20 units, 20 additional logics will be created.