Skip to content

object: members

39 implemented, 0 reserved. Entries are sorted by name.

object.cancelevent(event: string) -> number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: yes.

Same as cancelevents: removes every pending scheduled event of the object with the given name.

this.cancelevent("Hit");

Specification: vm-and-coroutines.md§7.3.

object.cancelevents(event: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes every pending scheduled event of the object with the given name and answers how many it removed.

this.cancelevents("Hit");

Specification: vm-and-coroutines.md§7.3.

object.addarraymember(name: string) -> object

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Creates the member object stored under the name, or finds it, and returns it.

temp.row = temp.o.addarraymember("row");

Specification: standard-library.md§17.4.2.

object.addnamedstring(name: string, text: string) -> object

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Adds a member object with the name and a text variable set to the second argument, and returns it.

temp.o.addnamedstring("title", "Hello");

Specification: standard-library.md§17.4.2.

object.catchevent(target: any, event: string, callback: function)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Runs a function of this object after another object handled an event. The function gets the other object first, then the arguments of the event.

this.catchevent(temp.panel, "onCreated", "seen");

Specification: standard-library.md§17.4.4.

object.clearemptyvars()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes the variables that hold nothing: empty values and empty texts.

temp.o.clearemptyvars();

Specification: standard-library.md§17.4.1.

object.clearvars()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes all dynamic variables of the object.

temp.o.clearvars();

Specification: standard-library.md§17.4.1.

object.copyfrom(source: object)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Copies every dynamic variable of another object into this one; arrays are copied, objects are shared.

temp.b.copyfrom(temp.a);

Specification: standard-library.md§17.4.1.

object.getarraymember(name: string) -> object

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the member object stored under the name, or an empty value.

temp.row = temp.o.getarraymember("row");

Specification: standard-library.md§17.4.2.

object.getdynamicvarnames() -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the names of the dynamic variables of the object, sorted alphabetically without regard to case.

temp.names = this.getdynamicvarnames();

Specification: standard-library.md§6.3.

object.geteditvarnames() -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the names of the variables a script can change.

echo(temp.o.geteditvarnames());

Specification: standard-library.md§17.4.1.

object.getfunctions() -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns one object per function of the object scripts, with name, parameters, scope and description.

echo(temp.o.getfunctions().size());

Specification: standard-library.md§17.4.1.

object.getstaticvarnames() -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the names of the variables a script can change.

echo(temp.o.getstaticvarnames());

Specification: standard-library.md§17.4.1.

object.getvarnames() -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the names of the built-in variables of the object followed by its dynamic ones.

echo(temp.o.getvarnames());

Specification: standard-library.md§17.4.1.

object.hasfunction(name: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when the object has a function of that name. Called from another object, only public functions count.

if (npc.hasfunction("onHit")) npc.onHit();

Specification: standard-library.md§6.3.

object.ignoreevent(target: any, event: string)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Forgets one catchevent made for the target and event.

this.ignoreevent(temp.panel, "onCreated");

Specification: standard-library.md§17.4.4.

object.ignoreevents(target: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Forgets every catchevent made for the target.

this.ignoreevents(temp.panel);

Specification: standard-library.md§17.4.4.

object.initialized: boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no. read-only.

True once onCreated has run; always true for a TStaticVar.

echo(this.initialized);

Specification: standard-library.md§17.4.5.

object.ispaused: boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

When true the object receives no events; they are dropped, not queued.

this.ispaused = true;

Specification: standard-library.md§17.4.5.

object.joinedclasses: array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no. read-only.

The names of the classes joined to the object.

echo(this.joinedclasses);

Specification: standard-library.md§17.4.5.

object.loadini(path: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Reads an INI file into the object: each [section] becomes a member object, and name=value lines become its variables.

temp.o.loadini("databases/settings.ini");

Specification: standard-library.md§17.4.3.

object.loadjson(path: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Reads a JSON file into the variables of the object. Returns 0 for a missing file or invalid JSON.

temp.o.loadjson("databases/data.json");

Specification: standard-library.md§17.4.3.

object.loadjsonfromstring(text: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Reads a JSON object into the variables of the object, creating TStaticVar children for nested objects. Returns 1 on success, or 0 and changes nothing for invalid JSON.

temp.ok = this.loadjsonfromstring(temp.text);

Specification: standard-library.md§7.2.

object.loadvars(path: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Reads name=value lines from a file in the script folders into the variables of the object. Returns 1, or 0 when the file cannot be read.

temp.o.loadvars("databases/player.txt");

Specification: standard-library.md§17.4.3.

object.loadvarsfromarray(lines: array)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Sets dynamic variables from “name=value” strings, splitting each at its first equals sign.

this.loadvarsfromarray(temp.saved);

Specification: standard-library.md§6.3.

object.loadxml(path: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Reads an XML file into the variables of the object. Returns 0 for a missing file or malformed XML.

temp.o.loadxml("databases/data.xml");

Specification: standard-library.md§17.4.3.

object.loadxmlfromstring(xml: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Reads XML text into the variables of the object. Returns 0 and leaves the object as it was when the text is malformed.

temp.o.loadxmlfromstring("<r><a>1</a></r>");

Specification: standard-library.md§17.4.3.

object.maxlooplimit: number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

How many loop iterations one run of the object may spend, up to the engine limit.

this.maxlooplimit = 5000;

Specification: standard-library.md§17.4.5.

object.objecttype() -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the type name of the object, such as TStaticVar or TServerNPC.

echo(temp.obj.objecttype());

Specification: standard-library.md§6.2.

object.savejson(path: string, mode?: number, format?: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Writes the variables of the object as JSON to a file in the script write folders. Mode 0 replaces the file, 1 appends; format flag 1 indents the output.

temp.o.savejson("databases/data.json", 0, 1);

Specification: standard-library.md§17.4.3.

object.savejsontostring(indent: number, recursive?: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Writes the dynamic variables of the object as JSON, compact for an indent of 0 and indented otherwise. Variables holding objects become “unknown_object” unless recursive is true.

echo(this.savejsontostring(0));

Specification: standard-library.md§7.1.

object.savevars(path: string, mode?: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Writes the variables of the object as name=value lines, sorted by name, to a file in the script write folders. Mode 0 replaces the file, 1 appends.

temp.o.savevars("databases/player.txt", 0);

Specification: standard-library.md§17.4.3.

object.savevarstoarray(flag?: any) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the dynamic variables as an array of “name=value” strings in the order they were created, leaving out variables that hold objects. The argument has no effect.

temp.saved = this.savevarstoarray(false);

Specification: standard-library.md§6.3.

object.savexml(path: string, mode?: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Writes the variables of the object as XML to a file in the script write folders. Mode 0 replaces the file, 1 appends.

temp.o.savexml("databases/data.xml", 0);

Specification: standard-library.md§17.4.3.

object.savexmltostring() -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the variables of the object as XML text.

echo(temp.o.savexmltostring());

Specification: standard-library.md§17.4.3.

object.scripterrors: array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no. read-only.

The texts of the last 50 errors raised by the scripts of the object.

echo(this.scripterrors.size());

Specification: standard-library.md§17.4.5.

object.scriptlogmissingfunctions: boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

When true a call to a function the object lacks is reported.

this.scriptlogmissingfunctions = true;

Specification: standard-library.md§17.4.5.

object.timeout: number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Seconds left on the timer of the object, 0 when none runs; assigning a number starts the timer.

this.timeout = 0.5;

Specification: standard-library.md§17.4.5.

object.trigger(event: string, ...args?: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Queues the event onName for the object and returns at once. The queue runs after the current invocation returns or suspends, in the order the events were queued. Arguments become the parameters and the params array of the handler.

this.trigger("Hit", 5);

Specification: vm-and-coroutines.md§5.4.

Engine version 0.1.0. Built 2026-11-18.