Category: Objects
/ Commands
Since engine version: 1.0 OC
AppendCommand
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).
For command descriptions see SetCommand
Notice: commands set by AppendCommand are not transferred to controlled vehicles (see VehicleControl).
Syntax
bool AppendCommand(string command, object target, int x, int y, object target2, int delay, any Data, int retries, int base_mode);
Parameters
- command:
- Command name (as string). See the table below.
- target:
- [opt] target object for the command
- x:
- [opt] X target coordinate
- y:
- [opt] Y target coordinate
- target2:
- [opt] secondary target object
- delay:
- [opt] Time (in ticks or frames) until the command is terminated.
- Data:
- [opt] additional data for the command
- retries:
- [opt] Number of retries if the command fails, until the command fails completely.
- base_mode:
- [opt] Command stack mode. See AddCommand for values.
Example
var base = FindBase(); SetCommand("MoveTo", base); AppendCommand("Throw", nil, base->GetX(), base->GetY());
Gives the clonk the command to go to the first found base and then throw the first carried object at the base.