animateSource: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (Created page with "{{Command|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |0.50|= Game version |eff= global|=...") |
Killzone Kid (talk | contribs) (wip) |
||
Line 11: | Line 11: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Activates object animations by source. If [[animate]] uses class name from [[CfgModels]] ''Animations'', [[animateSource]] uses name defined by ''source'' property. This allows to use | | Activates object animations by source. If [[animate]] uses class name from [[CfgModels]] ''Animations'', [[animateSource]] uses name defined by ''source'' property. This allows to use just one command on a bunch of animations related to the same source simultaneously. | ||
<br><br> | <br><br> | ||
A class with the same source name should also be present in main config in [[CfgVehicles]] ''AnimationSources'' and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using [[animate]] command it would require 2 calls: | A class with the same source name should also be present in main config in [[CfgVehicles]] ''AnimationSources'' and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using [[animate]] command it would require 2 calls: | ||
Line 64: | Line 64: | ||
}; | }; | ||
}; | }; | ||
...</syntaxhighlight> | ...</syntaxhighlight> | ||
{{Feature arma3| It is recommended that [[animateSource]] command is used instead of [[animate]] whenever is possible, as it is more efficient and optimised for MP}} | |||
{{warning | Mixing [[animateSource]] command with [[animate]] command in the same script may produce some undefined behaviour}} |= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 74: | Line 77: | ||
|p2= [source, phase, now]: [[Array]] |= PARAMETER2 | |p2= [source, phase, now]: [[Array]] |= PARAMETER2 | ||
|p3= source: [[String]] | |p3= source: [[String]] - common source |= PARAMETER3 | ||
|p4= phase: [[Number]] | |p4= phase: [[Number]] - wanted animation phase |= PARAMETER4 | ||
|p5= now: [[Boolean]] |= PARAMETER5 | |p5= now: [[Boolean]] - when [[true]] animation is instant |= PARAMETER5 | ||
| [[Nothing]] |= RETURNVALUE | | [[Nothing]] |= RETURNVALUE | ||
|x1= <code>house [[animateSource]] ["Door_1_source | |x1= <code>house [[animateSource]] ["Door_1_source", 1, [[true]]];</code>|= EXAMPLE1 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[ | | [[animationSourcePhase]], [[animateDoor]], [[animate]], [[setFaceAnimation]] |= SEEALSO | ||
| |= MPBEHAVIOUR | | |= MPBEHAVIOUR |
Revision as of 16:59, 12 March 2016
Description
- Description:
- Activates object animations by source. If animate uses class name from CfgModels Animations, animateSource uses name defined by source property. This allows to use just one command on a bunch of animations related to the same source simultaneously.
A class with the same source name should also be present in main config in CfgVehicles AnimationSources and have to be bound to the "user" controller for the command to work. If in order to animate door in example below using animate command it would require 2 calls:
house animate ["Door_1_rot", 1];
house animate ["Door_Handle_1_rot_1", 1];
With animateSource this would require only 1 (provided everything is configured correctly):
house animateSource ["Door_1_source", 1];
// model.cfg .... class Animations { class Door_1_rot { type = rotation; source = Door_1_source; selection = Door_1; axis = Door_1_axis; memory = 1; minValue = 0.1; maxValue = 1; angle0 = 0; angle1 = (rad 110); }; class Door_Handle_1_rot_1: Door_1_rot { source = Door_1_source; selection = Door_Handle_1; axis = Door_Handle_1_axis; minValue = 0; maxValue = 0.1; angle0 = 0; angle1 = (rad -50); }; }; ... // config.cpp ... class AnimationSources { class Door_1_source { source = "user"; animPeriod = 2; initPhase = 0; }; }; ...
- Groups:
- Uncategorised
Syntax
- Syntax:
- object animateSource [source, phase, now]
- Parameters:
- object: Object
- [source, phase, now]: Array
- source: String - common source
- phase: Number - wanted animation phase
- now: Boolean - when true animation is instant
- Return Value:
- Nothing
Examples
- Example 1:
house animateSource ["Door_1_source", 1, true];
Additional Information
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