SetAction

Category: Objects / Activity
Since engine version: 4.6.5.0 CP

Description

Sets the activity of the calling object. Also see ActMap.txt.

Syntax

bool SetAction (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

If pTarget1 or pTarget2 is omitted or 0, the previously set action target(s) will be preserved. To effectively clear action targets, use SetActionTargets.
To set the action of another object, use ObjectSetAction or obj->SetAction().
If fDirect is false, the StartCall of the defined action is called during the execution of SetAction. So if the StartCall should happen to delete the object you must not access the object in any way following the call to SetAction!

Example

SetAction("Dead");
The calling clonk will pretend death.
See also: GetAction, GetActionTarget, ObjectSetAction, SetActionKeepPhase, SetDir, SetPhase
Sven2, Juni 2003
Günther, Dezember 2004