Meteor 2 Scripting Functions
Output
void log(string text)
Output text to the log only.

Example
log("Hello Log!");

See also
print logPrint gameMessage

void logPrint(string text)
Print text to the screen and console. Also output text to the log file.

Example
logPrint("Hello Log World!");

See also
print log gameMessage

void print(string text, string col="FFFFFF", int destPlayerID=NET_EXEC_DEST_LOCAL)
Print text to the screen and console either locally (default) or on other computers.

Example 1
// print on local computer only
print("This is a local message");

Example 2
// also print on local computer only
print("This is a local message", "#FFFFFF", NET_EXEC_DEST_LOCAL);

Example 3
// print on local computer only with blue text
print("This is a local message in blue", "#0000FF");

Example 4
// print on server only
print("Hello server", "#FFFFFF", NET_EXEC_DEST_SERVER);

Example 5
// print everywhere
print("Hello all", "#FFFFFF", NET_EXEC_DEST_ALL);

Example 6
// print everywhere except this computer
print("Hello everyone else", "#FFFFFF", NET_EXEC_DEST_ALL_REMOTE);

Example 7
// print on all clients but not on server
print("Hello all clients", "#FFFFFF", NET_EXEC_DEST_ALL_CLIENTS);

Example 8
// print on computer that initiated this script code
print("Hello calling player", "#FFFFFF", getScriptPlayerID());

Example 9
// print on computer with player ID of 2
print("Hello specific player", "#FFFFFF", 2);

See also
printObject printNear logPrint getScriptPlayerID gameMessage

void printObject(string text, string col, int objectID)
Print text to the screen and console for the player with the specified object ID.

Example 1
// print on local player computer only
printObject("Hello me", "#FFFFFF", PLAYER_OBJECT);

Example 2
// print on computer for player who is object 10
printObject("Hello object ID 10", "#FFFFFF", 10);

Comments
Useful function to print text to a player by object ID instead of player ID.
If the object is a vehicle containing multiple players then all players in the vehicle will print the text.

See also
print printNear

void printNear(string text, string col, int objectID, float radius=500.0)
Print text to the screen and console for players near the specified object ID.

Example 1
// print text for players near local player
printNear("Hello nearby people!", "#FFFFFF", PLAYER_OBJECT);

Example 2
// print text for players near object 10
printNear("Hello players near object 10", "#FFFFFF", 10);

Example 3
// print text for players within 1000 pixels of object 10
printNear("Hello players within 1000 pixels of object 10", "FFFFFF", 10, 1000);

Comments
radius is in pixels and defaults to 500 pixels if not specified.

See also
print printObject

void printNear(string text, string col, vector2 pos, float radius=500.0)
Print text to the screen and console for players near the specified position.

Example
// message for players near sector 2
printNear("Hello players near sector 2!", "#FFFFFF", getSectorPos(2));

Comments
radius is in pixels and defaults to 500 pixels if not specified.

See also
print printObject


Index