GetCommand
Category: Objects
/ Commands
Since engine version: 4.6.5.0 CP
(extended in 4.9.1.0 GWE)
(extended in 4.9.5.0 CE)
Description
Returns information on a current command of an object. If the object does not have any commands set, 0 is returned for all queries.
Syntax
any GetCommand
(object pObj, int iElement, int iCommandNum);
Parameters
- pObj:
[opt]
Object of which to get commands.
- iElement:
[opt]
Data to be returned. Unspecified or 0: Name, 1: Target, 2: TargetX, 3: TargetY, 4: Target2, 5: Data
- iCommandNum:
[opt]
Number of the command. 0 is the currently active command, other values are the following (super-level) commands.
Example
func Timer()
{
if(GetCommand() eq "Enter" && GetCommand(0, 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.
PeterW, November 2001