animateSource: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "|size=0.75" to "|size= 0.75") |
||
Line 24: | Line 24: | ||
|p5= speed: [[Boolean]] or [[Number]] - (Optional, default [[false]]) | |p5= speed: [[Boolean]] or [[Number]] - (Optional, default [[false]]) | ||
* [[Boolean]] - when set to [[true]], animation is instant | * [[Boolean]] - when set to [[true]], animation is instant | ||
* {{GVI|arma3|1.66|size=0.75}} [[Number]] > 0 is treated as config speed value multiplier. Since {{GVI|arma3|2.10|size=0.75}} values <= 0 will instantly reset animation to initPhase. | * {{GVI|arma3|1.66|size= 0.75}} [[Number]] > 0 is treated as config speed value multiplier. Since {{GVI|arma3|2.10|size= 0.75}} values <= 0 will instantly reset animation to initPhase. | ||
|r1= [[Nothing]] | |r1= [[Nothing]] |
Revision as of 12:09, 21 December 2022
Description
- Description:
- Process an animation of the object. If animate uses class name from CfgModels Animations, animateSource uses name defined by the source property. AnimationSources can animate multiple animate Animations. AnimationSource is defined in CfgVehicles' AnimationSources (see Arma 3: createVehicle/vehicles).
- Groups:
- Animations
Syntax
- Syntax:
- object animateSource [source, phase, speed]
- Parameters:
- object: Object
- source: String - common source
- phase: Number - wanted animation phase
- speed: Boolean or Number - (Optional, default false)
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Create UGV and manipulate its turret (Not possible to do with animate command. See Arma 3: 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:
// Bar Gate init if (isServer) then { private _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:
- animationSourcePhase setFaceAnimation animate animationPhase animateDoor doorPhase animationNames
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