Object

All pieces in the game are an Object. Once you have a reference to an Object you can call these functions like this: obj.getPosition(). You can get a reference multiple ways: using the self property on an Object scripts, using a GUID with getObjectFromGUID(), or as a return type from a function like takeObject().

The Global Script can be referenced by a special keyword Global. The Global reference is used only for functions getting or setting variables on the Global Script or for specifying the owner of a function in callbacks.

Gets a Lua variable for this Object. Will result in an error if you try to get a Table variable. Use getTable function for getting a Table from the Object.

bool

setDescription(string description)

Sets the description for this Object.

bool

setLuaScript(string script)

Sets the Lua script for this Object. Only useful in very rare cases right when this object is spawned. Once the Lua interpreter reads the Lua script, it will not care about this again. Setting this variable after its been read will do nothing.

bool

setName(string nickname)

Sets the nickname for this Object.

bool

setTable(string table_name, Table table)

Sets a Lua Table for this Object.

bool

setVar(string variable_name, variable value)

Sets a Lua variable for this Object. Will result in an error if you try to set a Table variable. Use setTable function for setting a Table from the Object.

A nil value for funtion_owner means the function lives on the Global script.
The input_function runs with optional parameters: input_function(Object objectInputTyped, string playerColorTyped, string input_value, bool selected). Can return string in Callback to overwrite input value. Callback fires every time the input is typed in or deselected.

The number of sides of the Custom Dice, the shape of the Custom Tile, the type of Custom Mesh, or the type of Custom AssetBundle.

thickness

float

Thickness of the Custom Tile or Custom Token.

stackable

bool

Is this Custom Tile or Custom Token stackable?

merge_distance

float

The accuracy of the Custom Tile to it’s base image.

mesh

string

Mesh URL for the Custom Mesh.

diffuse

string

Diffuse image URL for the Custom Mesh.

normal

string

Normal image URL for the Custom Mesh.

collider

string

Collider URL for the Custom Mesh.

convex

bool

Is this Custom Mesh concave?

material

int

The material for the Custom Mesh or Custom AssetBundle.

specular_intensity

float

The specular intensity for the Custom Mesh.

specular_color

Table

The specular color for the Custom Mesh.

specular_sharpness

float

The specular sharpness for the Custom Mesh.

fresnel_strength

float

The fresnel strength for the Custom Mesh.

cast_shadows

bool

Does this Custom Mesh cast shadows?

assetbundle

string

AssetBundle URL for this Custom AssetBundle.

assetbundle_secondary

string

Secondary AssetBundle URL for this Custom AssetBundle.

face

string

Face URL for this Custom Deck.

unique_back

bool

Unique back for this Custom Deck.

back

string

Back URL for this Custom Deck.

width

int

Width for this Custom Deck.

height

int

Height for this Custom Deck.

number

int

Number of cards for this Custom Deck.

sideways

bool

Sideways for this Custom Deck.

back_is_hidden

bool

Back is hidden for this Custom Deck.

bool

getLock()

Get the lock status of this object.

Table

getObjects()

Returns all the Objects inside of this container.

Object

Returned Data

Scripting Zone

Returns all Objects in the Zone.

Loot Bag

Returns a Table with the keys “name”, “guid”, and “index”. Objects in Loot Bags are not living in the game. They’re serialized into a text format. To interact with or change an Object in a Loot Bag, it must first be taken out (which spawns it in the game). Objects in Loot Bags can be taken out of the Bag by the takeObject function by referencing its “index” or “guid”. It’s recommended to remove Objects by their GUIDs rather than their indices since the indices can change after one object was removed.

Deck

Returns a Table of Tables of all of the Cards in the Deck. These are not references to the cards since the Cards are not instantiated until they are removed from the Deck.

Add this object to the current object. Works for stacking chips, decks, and bags.

bool

randomize()

Same as pressing the ‘R’ key on an Object. Shuffles deck/bag, rolls dice/coin, lifts any other object up in the air.

Object

reload()

Reloads this object by destroying and spawning it place. Returns the newly spawned object. Very useful if using setCustomObject().

bool

reset()

Resets this Object. Resetting a Deck brings all the Cards back into it. Resetting a Bag clears its contents (works for both Loot and Infinite Bags).

bool

roll()

Rolls this Object. Works on Dice and Coins.

bool

setCustomObject(Table parameters)

Used to create a Custom Object, if updating an already loaded object use reload(). See here for information about the parameters for each type of Custom Object.

bool

setLock(bool lock)

Set the lock status of an object.

bool

setRotationValues(Table rotation_values)

Sets the rotation values for this Object just like the Gizmo -> Rotation Value tool. List of Tables with Keys: “value” and “rotation”.

Object

setState(int state)

Sets the current State for this Object if it has multiple States attached to it and returns a reference to the new State. The old reference will be destroyed, so update your reference to this Object with the return value of the new State. Returns nil if this Object does not have multiple states attached to it.

Shuffles the States on this Object if it has multiple States attached to it and returns a reference to the new State. The old reference will be destroyed, so update your reference to this Object with the return value of the new State. Returns nil if this Object does not have multiple states attached to it.

Object

takeObject(Table parameters)

Takes an Object from this container (Loot Bag, Deck, and Infinite Bag), moves, and rotates it to the specified position and rotation. Returns a reference to the taken Object. Since executing the Lua scripts on the taken object and other initialization takes a few frames, any operations that need to be performed on this object immediately after it is taken from the container should be done in the callback function. The callback prevents needing to use a coroutine and yielding/waiting multiple frames. All of the parameters are optional and defers to default values if any of the lines are not included. If you want all of the default values, just pass in an empty table.

Parameters Table:

local params = {}
params.position = Vector–Optional. Defaults to the container’s position + 2 in the x direction.
params.rotation = Vector–Optional. Defaults to the container’s rotation.
params.callback = string callback_function_name –Optional.
params.callback_owner = Object callback_owner –Optional. Defaults to the container that the Object was taken from.
params.params = Table callback_parameters –Optional.
params.flip = boolean flip_object –Optional. Only used when taking Cards from a Deck.
params.guid = string guid –Optional. Only used when taking an Object from a Loot Bag by GUID.
params.index = int index –Optional. Used when taking an Object from a Loot Bag or a Card from a Deck by index.
params.top = bool take_from_top –Optional. Specifies whether to take a Card from the top or bottom of the Deck. Defaults to true, taking from the top of the Deck.
params.smooth = bool –Optional. Specifies if the object should smoothly move to position or instantly. Defaults to true.

It’s recommended to remove Objects from Loot Bags by their GUIDs rather than their indices since the indices can change after one object was removed.