Meteor 2 Scripting Functions
Command
void setCommander(int objectID, int commanderID)
Assign an object to a commander's squad (server and client)

Example
// Add object ID 10 to local player's squad
setCommander(0, 1);

Comments
Set commanderID to -1 to leave a squad.

See also
getCommander

int getCommander(int objectID)
Get the commanding object being for the specified object.

Example
print(getCommander(1));

Comments
Returns -1 if not in a squad.

See also
setCommander getFollowingObjects

bool isCommander(int objectID)
Determine if an object is commanding other objects.

Example
print(isCommander(PLAYER_OBJECT));

See also
getSquadCount

void getSquadCount(int objectID)
Get a commanding object's sqaud count.

Example
print(getSquadCount(PLAYER_OBJECT));

See also
isCommander

array getSquadObjects(int commanderID)
Get array of object IDs that are commanded by the specified object (commander).

Example
// print player squad member IDs
array<int> objectIDs = getSquadObjects(PLAYER_OBJECT);
for (uint i = 0; i < objectIDs.length(); i++)
{
    print(objectIDs[i]);
}

See also
setFollow getLeader

void commandFollow(int objectID, int leaderID)
Command a unit to follow another unit (server and clients).

void commandMove(int objectID, vector2 destPos)
Command a unit to move to a position (server and clients).

void commandStop(int objectID)
Command a unit to stop and guard (server and clients).

void commandRoam(int objectID)
Command a unit to roam (server and clients).

void commandUnassign(int objectID)
Remove a unit from a commander's squad (server and clients).


Index