BIS fnc ambientAnim: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (see also)
No edit summary
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3 |= Game name
| Arma 3 |= Game


|1.00|= Game version
|1.62|= Game Version
____________________________________________________________________________________________
____________________________________________________________________________________________


| Play set of ambient animations on given unit. |= Description
|Replaces object with simple object. Object must not contain any crew and must be placed on ground.<br><br>
 
Remarks:<br>
* Useful if you do not have access to simple object adjustment data - e.g. in case of unsupported/discontinued asset.<br>
* All official assets have the adjustment data defined in config.<br><br>
 
{{note|Use with caution as this technique is not very clean - should '''not''' be used for many objects and definitely '''not in MP''' games.}}
|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| [unit, animationset, equipmentlevel, snaptoObject, interpolate] call '''BIS_fnc_ambientAnim'''
| [object] [[call]] '''BIS_fnc_replaceWithSimpleObject''' |= Syntax
{{note|Animations can be cancelled by calling _unit [[call]] '''BIS_fnc_ambientAnim__terminate'''}}


|= Syntax
|p1= [[Object]]: Object that will be replaced by simple object|= Parameter 1
____________________________________________________________________________________________


|p1= Unit [[Object]] - Unit where the animations will be played |= Parameter 1
| [[Boolean]] - [[true]] if throwable |= Return value
|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")
*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
|= Parameter 2
|p3= EquipmentLevel [[String]] - The equipment level of the unit <br>
Possible values:
*NONE
*LIGHT
*MEDIUM
*FULL
*ASIS
*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


____________________________________________________________________________________________


| None |= Return value
|x1= <code>[tank] [[call]] '''BIS_fnc_replaceWithSimpleObject''';</code>|= EXAMPLE1
____________________________________________________________________________________________


|x1= <code>[player, "STAND1", "NONE"] [[call]] [[BIS_fnc_ambientAnim]];</code> |= Example 1
|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
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[BIS_fnc_ambientAnimCombat]], [[BIS_fnc_ambientAnimGetParams]] |= See also
| [[createSimpleObject]], [[BIS_fnc_adjustSimpleObject]], [[BIS_fnc_createSimpleObject]], [[BIS_fnc_simpleObjectData]] |= See Also


}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- BEGIN Note Section -->
<dd class="notedate">Posted on February 19, 2016 - 04:24
<!-- For example:
<dt class="note">'''[[User:Pierre MGI|Pierre MGI]]'''
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dd class="note">In 3den editor, place a blufor unit (B_soldier_A_F) near a camping chair (land_campingChair_V2_F).<br>
<dt class="note">'''[[User:User Name|User Name]]'''</dt>
In init field of the unit:<br>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[this,"SIT2"] [[call]] [[BIS_fnc_ambientAnim]];<br>0 = this [[spawn]] {[[waitUntil]] {[[behaviour]] _this == "combat"};<br>
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
_this [[call]] BIS_fnc_ambientAnim__terminate;}</code>
-->
When this unit is aware of a threat, he will quit the "ambient animation" and will able to return fire.<br>
<!-- END Note Section -->
Note: Bis_fnc_ambientAnimCombat doesn't need this script but the list of animations is limited.
<br><br>
<dd class="notedate">Posted on August 08, 2016 - 01:37
<dt class="note">'''[[User:Pierre MGI|Pierre MGI]]'''
<dd class="note">To make this command working in MP (hosted server tested)<br>
<code>[this,"SIT2"] [[call]] [[BIS_fnc_ambientAnim]]; // Wrong! the first JIP will throw the unit to position [0,0,0]<br>
[[if]] ([[isServer]]) [[then]] {[this,"SIT2"] [[call]] [[BIS_fnc_ambientAnim]]} // Wrong! only player located on server will see the animation<br>
[[if]] ([[isServer]]) [[then]] { [[this,"SIT2"],[[BIS_fnc_ambientAnim]] ] [[remoteExec]] ["call"] }; OK </code><br> <br>
 
 
<!-- Note Section END -->
</dl>
</dl>


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Ambient|{{uc:ambientAnim}}]]
<!-- Appropriate categories go here -->
[[Category:Functions|{{uc:ambientAnim}}]]
[[Category:Arma 3: Functions|{{uc:{{PAGENAME}}}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:ambientAnim}}]]
 
<!-- 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 -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 11, 2016 - 16:33 (UTC)</dd>
<dt class="note">[[User:Icaruk|Icaruk]]</dt>
<dd class="note">
Be careful using this function multiple times on MP, it uses [[createUnit]] (global).<br>
If you use it on 20 units, 20 additional units (logics) will be created.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 14:25, 14 September 2016

Hover & click on the images for description

Description

Description:
Replaces object with simple object. Object must not contain any crew and must be placed on ground.

Remarks:
  • Useful if you do not have access to simple object adjustment data - e.g. in case of unsupported/discontinued asset.
  • All official assets have the adjustment data defined in config.

Template:note
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[object] call BIS_fnc_replaceWithSimpleObject
Parameters:
Object: Object that will be replaced by simple object
Return Value:
Boolean - true if throwable

Examples

Example 1:
[tank] call BIS_fnc_replaceWithSimpleObject;

Additional Information

See also:
createSimpleObjectBIS_fnc_adjustSimpleObjectBIS_fnc_createSimpleObjectBIS_fnc_simpleObjectData

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

Bottom Section