AppendCommand

Category: Objects / Commands
Since engine version: 4.6.5.0 CP (extended in 4.9.1.0 GWE)

Description

Appends a command to the command stack of an object. The appended command will be executed after the current other commands.
For command descriptions see SetCommand
Notice: commands set by AppendCommand are not transferred to controlled vehicles (see VehicleControl).

Syntax

bool AppendCommand (object pObj, string szCommand, object pTarget, int iX, int iY, object pTarget2, int iInterval, any Data, int iRetries, int iBaseMode);

Parameters

pObj:
Object for which the command is given.
szCommand:
Command name (as string). See the table below
pTarget:
[opt] target object for the command
iX:
[opt] X target coordinate
iY:
[opt] Y target coordinate
pTarget2:
[opt] secondary target object
iInterval:
[opt] Time (in ticks or frames) until the command is terminated
Data:
[opt] additional data for the command
iRetries:
[opt] Number of retries if the command fails, until the command fails completely.
iBaseMode:
[opt] Command stack mode. See AddCommand for values.

Example

var base = FindBase();
SetCommand(this(), "MoveTo", base);
AppendCommand(this(), "Throw", 0, GetX(base), GetY(base));
Gives the clonk the command to go to the first found base and then throw the first carried object at the base.
See also: AddCommand, FinishCommand, GetCommand, PlayerObjectCommand, SetCommand
PeterW, November 2001