Skip to content

tes3script⚓︎

A script object.

This type inherits the following: tes3baseObject

Properties⚓︎

blocked⚓︎

The blocked state of the object.

Returns:

  • result (boolean)

context⚓︎

Read-only. A special context used for getting and setting script's variables.

Returns:


deleted⚓︎

Read-only. The deleted state of the object.

Returns:

  • result (boolean)

disabled⚓︎

Read-only. The disabled state of the object.

Returns:

  • result (boolean)

floatVariableCount⚓︎

Read-only. The number of variables of float type in the script.

Returns:

  • result (number)

id⚓︎

Read-only. The unique identifier for the object.

Returns:

  • result (string)

longVariableCount⚓︎

Read-only. The number of variables of long type in the script.

Returns:

  • result (number)

modified⚓︎

The modification state of the object since the last save.

Returns:

  • result (boolean)

objectFlags⚓︎

Read-only. The raw flags of the object.

Returns:

  • result (number)

objectType⚓︎

Read-only. The type of object. Maps to values in tes3.objectType.

Returns:


persistent⚓︎

The persistent flag of the object.

Returns:

  • result (boolean)

shortVariableCount⚓︎

Read-only. The number of variables of short type in the script.

Returns:

  • result (number)

sourceless⚓︎

The soruceless flag of the object.

Returns:

  • result (boolean)

sourceMod⚓︎

Read-only. The filename (including the extension) of the mod that owns this object. It has nil value if the object was anything other than loaded from an ESP or ESM file.

Returns:

  • result (string)

supportsLuaData⚓︎

If true, references of this object can store temporary or persistent lua data.

Returns:

  • result (boolean)

Methods⚓︎

__tojson⚓︎

Serializes the object to json.

local string = myObject:__tojson()

Returns:

  • string (string)

getVariableData⚓︎

This method fetches all of the script's variables as a table. Returns nil if the script has no variables.

local results = myObject:getVariableData(useLocals)

Parameters:

  • useLocals (boolean): Optional.

Returns:

  • results (table<string, tes3scriptVariableData>, nil): A table with all of the script's variable names as keys.