Meteor 2 Scripting Functions
Var
variant getVar(int objectID, string name, variant defaultValue)
Get a named variable value from an object.
bool isPlayer = getVar(getLocalPlayerObject(), "is_player", false);
if(isPlayer)
{
print("Is a player");
}
A variant can be a bool, int, float, string or vector2.
void setVar(int objectID, string name, variant value, bool netSync)
Set a named variable value to an object.
setVar(getLocalPlayerObject(), "is_player", true, true);
A variant can be a bool, int, float, string or vector2.
array getVarNames(int objectID)
Get an array with all the variable names from an object.
int objectID = getLocalPlayerObject();
array<string> varNames = getVarNames(objectID);
for (uint i = 0; i < varNames.length(); i++)
{
variant varValue = getVar(objectID, varNames[i], "");
print(varNames[i] + " = " + varValue);
}
Index