animateSource: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[.*\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
m (Text replacement - "this" to "this")
Line 108: Line 108:
[[if]] ([[isServer]]) [[then]]
[[if]] ([[isServer]]) [[then]]
{
{
_gateTrigger = [[createTrigger]] ["EmptyDetector", [[getPosWorld]] [[this]], [[false]]];
_gateTrigger = [[createTrigger]] ["EmptyDetector", [[getPosWorld]] [[Magic Variables#this_2|this]], [[false]]];
_gateTrigger [[setVariable]] ["BarGateObj", [[this]]];
_gateTrigger [[setVariable]] ["BarGateObj", [[Magic Variables#this_2|this]]];
_gateTrigger [[setTriggerActivation]] ["ANYPLAYER", "PRESENT", [[true]]];
_gateTrigger [[setTriggerActivation]] ["ANYPLAYER", "PRESENT", [[true]]];
_gateTrigger [[setTriggerArea]] [5, 25, [[getDir]] [[this]], [[true]]];
_gateTrigger [[setTriggerArea]] [5, 25, [[getDir]] [[Magic Variables#this_2|this]], [[true]]];
_gateTrigger [[setTriggerStatements]]  
_gateTrigger [[setTriggerStatements]]  
[
[

Revision as of 13:07, 25 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Animations

Syntax

Syntax:
Syntax needed
Parameters:
object: Object
[source, phase, speed]: Array
source: String - common source
phase: Number - wanted animation phase
speed: Boolean or Number - When true animation is instant. Since Arma 3 v1.65.138459 Number > 0 is treated as config speed value multiplier
Return Value:
Return value needed

Examples

Example 1:
house animateSource ["Door_1_source", 1, true];
Example 2:
Create UGV and manipulate its turret (Currently not possible to do with animate command. See createVehicle/vehicles for reference)ugv = "B_UGV_01_F" createVehicle (player getRelPos [5, 0]); ugv addAction ["Show Turret", { ugv animateSource ["Turret", 0]; ugv animateSource ["MainTurret", rad 0, true]; ugv animateSource ["MainGun", rad 0, true]; }]; ugv addAction ["Hide Turret", {ugv animateSource ["Turret", 1]}]; ugv addAction ["Turret Left", {ugv animateSource ["MainTurret", rad 90]}]; ugv addAction ["Turret Right", {ugv animateSource ["MainTurret", -rad 90]}]; ugv addAction ["Turret Up", {ugv animateSource ["MainGun", rad 30]}]; ugv addAction ["Turret Down", {ugv animateSource ["MainGun", -rad 20]}];
Example 3:
barGate animateSource ["Door_1_sound_source", 1]; //Open barGate animateSource ["Door_1_sound_source", 0]; //Close
Example 4:
Open/close Bar Gate automatically: //--- init of the Bar Gate if (isServer) then { _gateTrigger = createTrigger ["EmptyDetector", getPosWorld this, false]; _gateTrigger setVariable ["BarGateObj", this]; _gateTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", true]; _gateTrigger setTriggerArea [5, 25, getDir this, true]; _gateTrigger setTriggerStatements [ "this", "thisTrigger getVariable ""BarGateObj"" animateSource [""Door_1_sound_source"", 1]", "thisTrigger getVariable ""BarGateObj"" animateSource [""Door_1_sound_source"", 0]" ]; };

Additional Information

See also:
animationSourcePhasesetFaceAnimationanimateanimationPhaseanimateDoordoorPhaseanimationNames

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