animateSource: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
m (Text replacement - "createVehicle/vehicles" to "Arma 3: createVehicle/vehicles") |
||
Line 67: | Line 67: | ||
...</syntaxhighlight> | ...</syntaxhighlight> | ||
If you don't know much about model config you can use this page [[createVehicle/vehicles]] for reference. Some of the ''AnimationSources'' are listed with the class names of the available assets in Arma 3. If it says "user", the chances are it could work with [[animateSource]] (see example 2). | If you don't know much about model config you can use this page [[Arma 3: createVehicle/vehicles]] for reference. Some of the ''AnimationSources'' are listed with the class names of the available assets in Arma 3. If it says "user", the chances are it could work with [[animateSource]] (see example 2). | ||
{{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}}<br><br> | {{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}}<br><br> | ||
Line 89: | Line 89: | ||
|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 (Currently not possible to do with [[animate]] command. See [[createVehicle/vehicles]] for reference)<code>ugv = "B_UGV_01_F" [[createVehicle]] ([[player]] [[getRelPos]] [5, 0]); | |x2= Create UGV and manipulate its turret (Currently 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", | ||
{ | { |
Revision as of 00:25, 1 March 2021
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 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:
//--- 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