animateSource: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "createVehicle/vehicles" to "Arma 3: createVehicle/vehicles") |
Lou Montana (talk | contribs) (Cleaning up description) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| arma3 | |game1= arma3 | ||
|1.58 | |version1= 1.58 | ||
|eff= global | |eff= global | ||
|arg= global | |arg= global | ||
Line 8: | Line 9: | ||
|gr1= Animations | |gr1= Animations | ||
| Process an animation of the object. If [[animate]] uses class name from [[CfgModels]] ''Animations'', [[animateSource]] uses name defined by ''source'' property. | |descr= 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 [[:Category:CfgVehicles|CfgVehicles]]' [[Model Config#AnimationSources|AnimationSources]] (see [[Arma 3: createVehicle/vehicles]]). | ||
{{Feature | Warning | Mixing [[animateSource]] command with [[animate]] command to animate the same part | {{Feature|arma3| It is recommended that [[animateSource]] command is used instead of [[animate]] whenever is possible, as it is more efficient and optimized for MP}} | ||
{{Feature|Warning|Mixing [[animateSource]] command with [[animate]] command to animate the same part may produce some undefined behaviour.}} | |||
| object | |s1= object [[animateSource]] [source, phase, speed] | ||
|p1= object: [[Object]] | |p1= object: [[Object]] | ||
Line 83: | Line 24: | ||
|p4= phase: [[Number]] - wanted animation phase | |p4= phase: [[Number]] - wanted animation phase | ||
|p5= speed: [[Boolean]] or [[Number]] - | |p5= speed: [[Boolean]] or [[Number]] | ||
* [[Boolean]] - when set to [[true]], animation is instant. | |||
* [[Number]] > 0 is treated as config speed value multiplier {{Since|arma3|1.65.138459|y}} | |||
| [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code>house [[animateSource]] ["Door_1_source", 1, [[true]]];</code> | |x1= <code>house [[animateSource]] ["Door_1_source", 1, [[true]]];</code> | ||
|x2= Create UGV and manipulate its turret ( | |x2= Create UGV and manipulate its turret (Not possible to do with [[animate]] command. See [[Arma 3: createVehicle/vehicles]] for reference)<code>ugv = "B_UGV_01_F" [[createVehicle]] ([[player]] [[getRelPos]] [5, 0]); | ||
ugv [[addAction]] ["Show Turret", | ugv [[addAction]] ["Show Turret", | ||
{ | { | ||
Line 96: | Line 39: | ||
ugv [[animateSource]] ["MainGun", [[rad]] 0, [[true]]]; | ugv [[animateSource]] ["MainGun", [[rad]] 0, [[true]]]; | ||
}]; | }]; | ||
ugv [[addAction]] ["Hide Turret", {ugv [[animateSource]] ["Turret", 1]}]; | ugv [[addAction]] ["Hide Turret", { ugv [[animateSource]] ["Turret", 1] }]; | ||
ugv [[addAction]] ["Turret Left", {ugv [[animateSource]] ["MainTurret", [[rad]] 90]}]; | ugv [[addAction]] ["Turret Left", { ugv [[animateSource]] ["MainTurret", [[rad]] 90] }]; | ||
ugv [[addAction]] ["Turret Right", {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 Up", { ugv [[animateSource]] ["MainGun", [[rad]] 30] }]; | ||
ugv [[addAction]] ["Turret Down", {ugv [[animateSource]] ["MainGun", -[[rad]] 20]}];</code> | ugv [[addAction]] ["Turret Down", { ugv [[animateSource]] ["MainGun", -[[rad]] 20] }];</code> | ||
|x3= <code>barGate [[animateSource]] ["Door_1_sound_source", 1]; | |x3= <code>barGate [[animateSource]] ["Door_1_sound_source", 1]; {{cc|Open}} | ||
barGate [[animateSource]] ["Door_1_sound_source", 0]; | barGate [[animateSource]] ["Door_1_sound_source", 0]; {{cc|Close}}</code> | ||
|x4= Open/close Bar Gate automatically: <code> | |x4= Open/close Bar Gate automatically: <code>{{cc|Bar Gate init}} | ||
[[if]] ([[isServer]]) [[then]] | [[if]] ([[isServer]]) [[then]] | ||
{ | { | ||
Line 114: | Line 57: | ||
_gateTrigger [[setTriggerStatements]] | _gateTrigger [[setTriggerStatements]] | ||
[ | [ | ||
"this", | "this", | ||
"[[thisTrigger]] [[getVariable]] ""BarGateObj"" [[animateSource]] [""Door_1_sound_source"", 1]", | "[[thisTrigger]] [[getVariable]] ""BarGateObj"" [[animateSource]] [""Door_1_sound_source"", 1]", | ||
"[[thisTrigger]] [[getVariable]] ""BarGateObj"" [[animateSource]] [""Door_1_sound_source"", 0]" | "[[thisTrigger]] [[getVariable]] ""BarGateObj"" [[animateSource]] [""Door_1_sound_source"", 0]" | ||
]; | ]; | ||
};</code> | };</code> | ||
|seealso= [[animationSourcePhase]], [[setFaceAnimation]], [[animate]], [[animationPhase]], [[animateDoor]], [[doorPhase]], [[animationNames]] | |seealso= [[animationSourcePhase]], [[setFaceAnimation]], [[animate]], [[animationPhase]], [[animateDoor]], [[doorPhase]], [[animationNames]] | ||
}} | }} |
Revision as of 20:36, 2 April 2021
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, phase, speed]: Array
- source: String - common source
- phase: Number - wanted animation phase
- speed: Boolean or Number
- Boolean - when set to true, animation is instant.
- Number > 0 is treated as config speed value multiplier Template:Since
- Return Value:
- Nothing
Examples
- Example 1:
house animateSource ["Door_1_source", 1, true];
- 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 { _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