SetActionKeepPhase

Category: Objects / Activity
Since engine version: 4.9.10.14 LC [353]

Description

Sets the activity of the calling object, in the same way as SetAction, but keeps the animation phase of the object. This allows seamless switching between different animations for the same activity, for example if there are separate animations with a carried weapon.

Syntax

bool SetActionKeepPhase (string szAction, object pTarget1, object pTarget2, bool fDirect);

Parameters

szAction:
New action to be set. "ActIdle" or "Idle" will clear any action.
pTarget1:
[opt] First target object for the action
pTarget2:
[opt] Second target object for the action
fDirect:
[opt] If true, Start- and AbortCalls aren't made and the action will be set even if the current action is specified as NoOtherAction.

Remarks

This function is a wrapper for GetPhase, SetAction and SetPhase.
This functionality is used in various Clonks in a function called CheckArmed.
The return value is only true if both activity and phase can be set successffully, otherwise it is false.
See also: GetPhase, SetAction, SetPhase
Der Tod, April 2022