GetCommand

Category: Objects / Commands
Since engine version: 1.0 OC

Description

Returns information on a current command of an object. If the object does not have any commands set, nil is returned for all queries.

Syntax

any GetCommand(int element, int command_num);

Parameters

element:
[opt] Data to be returned. Unspecified or 0: Name, 1: Target, 2: TargetX, 3: TargetY, 4: Target2, 5: Data
command_num:
[opt] Number of the command. 0 is the currently active command, other values are the following (super-level) commands.

Example

func Timer()
{
  if(GetCommand() == "Enter" && GetCommand(1) == FindBase(GetOwner()))
    Enter(FindBase(GetOwner()));
}
If the object has been commanded to enter the home base, this script will warp the object there directly.
See also: AddCommand, AppendCommand, SetCommand
PeterW, 2001-11