ObjectSetAction

Category: Objects / Activity
Since engine version: 4.6.5.0 CP (extended in 4.9.5.0 CE)

Description

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

Syntax

bool ObjectSetAction (object pObj, string szAction, object pTarget1, object pTarget2, bool fDirect);

Parameters

pObj:
Object for which to set an activity. Notice: unlike in many other functions this parameter may not be omitted in local calls. Use SetAction instead.
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 set, the activity is set directly, bypassing any Start- or AbortCalls and overriding the NoOtherAction flag.

Remark

If pTarget1 or pTarget2 is not specified or 0, the previous value of these action targets will be kept. To actually clear action targets use SetActionTargets. Exception: if fDirect is set, the action targets are set even if the parameter was 0.

Example

ObjectSetAction(GetCursor(), "Dead");
The currently selected clonk of the first player pretends to be dead.
See also: GetAction, GetActionTarget, SetAction, SetDir, SetPhase
Sven2, Juni 2003