switchGesture: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ">Posted on August ([0-9]{2}), ([0-9]{4})" to ">Posted on $2-08-$1") |
(Add new syntax for 2.18) |
||
Line 24: | Line 24: | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|s2= soldier [[switchGesture]] [moveName, time, blendFactor, resetAim] | |||
|s2since= arma3 2.18 | |||
|p21= moveName: [[String]] - Entry from {{hl|"CfgMovesMaleSdr" >> "states"}} or {{hl|"CfgGesturesMale" >> "states"}} | |||
|p22= time: [[Number]] - (Optional, default: 0) progress time, in range 0-1, where 0 = beginning of the animation, and 1 = end of the animation | |||
|p23= blendFactor: [[Number]] - (Optional, default: 0) In range 0-1. How much to blend the new animation with the current animation. | |||
|p24= resetAim: [[Boolean]] - (Optional, default: true) Whether the aim/head direction should be reset after switching | |||
|r2= [[Nothing]] | |||
|x1= <sqf>soldierOne switchGesture "Wave";</sqf> | |x1= <sqf>soldierOne switchGesture "Wave";</sqf> | ||
|x2= <sqf>// Create a dummy agent that copies your moves | |||
ai1 = createAgent [typeOf player, getPosATL player, [], 0, "NONE"]; | |||
ai1 disableAI "ALL"; | |||
onEachFrame | |||
{ | |||
ai1 setAnimSpeedCoef getAnimSpeedCoef player; | |||
ai1 setVectorDir vectorDir player; | |||
_m = animationState player; | |||
_g = gestureState player; | |||
_i = getUnitMovesInfo player; | |||
_a = getUnitMovesInfo ai1; | |||
if (animationState ai1 != _m || abs(_i#1 - _a#1) > 0.1) then { | |||
ai1 switchMove [_m, _i#0, _i#3, false]; | |||
}; | |||
if ((gestureState ai1 != _g || abs(_i#6 - _a#6) > 0.1) && (_g != "<none>" && _g find "_player" < 0)) then { | |||
ai1 switchGesture [_g, _i#5, _i#8, false]; | |||
}; | |||
} | |||
</sqf> | |||
|seealso= [[playGesture]] | |seealso= [[playGesture]] | ||
}} | }} |
Revision as of 12:09, 26 February 2024
Description
- Description:
- When used on a person,the given move is started immediately (without transition).
- Groups:
- Animations
Syntax
- Syntax:
- soldier switchGesture moveName
- Parameters:
- soldier: Object
- moveName: String
- Return Value:
- Nothing
Alternative Syntax
- Syntax:
- soldier switchGesture [moveName, time, blendFactor, resetAim]
- Parameters:
- moveName: String - Entry from "CfgMovesMaleSdr" >> "states" or "CfgGesturesMale" >> "states"
- time: Number - (Optional, default: 0) progress time, in range 0-1, where 0 = beginning of the animation, and 1 = end of the animation
- blendFactor: Number - (Optional, default: 0) In range 0-1. How much to blend the new animation with the current animation.
- resetAim: Boolean - (Optional, default: true) Whether the aim/head direction should be reset after switching
- Return Value:
- Nothing
Examples
- Example 1:
- soldierOne switchGesture "Wave";
- Example 2:
- // Create a dummy agent that copies your moves ai1 = createAgent [typeOf player, getPosATL player, [], 0, "NONE"]; ai1 disableAI "ALL"; onEachFrame { ai1 setAnimSpeedCoef getAnimSpeedCoef player; ai1 setVectorDir vectorDir player; _m = animationState player; _g = gestureState player; _i = getUnitMovesInfo player; _a = getUnitMovesInfo ai1; if (animationState ai1 != _m || abs(_i#1 - _a#1) > 0.1) then { ai1 switchMove [_m, _i#0, _i#3, false]; }; if ((gestureState ai1 != _g || abs(_i#6 - _a#6) > 0.1) && (_g != "<none>" && _g find "_player" < 0)) then { ai1 switchGesture [_g, _i#5, _i#8, false]; }; }
Additional Information
- See also:
- playGesture
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
- Posted on 2010-08-31
- kju
- Rpt says "Not implemented" as of OA 1.54.