SetAction

Category: Objects / Activity
Since engine version: 1.0 OC

Description

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

Syntax

bool SetAction(string action, object target1, object target2, bool force);

Parameters

action:
New action to be set. "ActIdle" or "Idle" will clear any action.
target1:
[opt] First target object for the action.
target2:
[opt] Second target object for the action.
force:
[opt] If true, changes the action even if the action defined NoOtherAction=1.

Remarks

If target1 or target2 is omitted or nil, the previously set action target(s) will be preserved. To effectively clear action targets, use SetActionTargets.
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, SetDir, SetPhase
Sven2, 2003-06
Günther, 2004-12