Module messages

Source
Expand description

Incoming and Outgoing messages

Structs§

AnswerCustomMessage
Custom Messages are sent by calling sendExternalMessage with the table of data you wish to send.
AnswerError
TTS sends all error messages in a AnswerError response.
AnswerGameSaved
Whenever the player saves the game in TTS, AnswerGameSaved is sent as a response.
AnswerNewObject
When clicking on “Scripting Editor” in the right click contextual menu in TTS for an object that doesn’t have a Lua Script yet, TTS will send an AnswerNewObject message containing data for the object.
AnswerObjectCreated
Whenever the player saves the game in TTS, AnswerObjectCreated is sent as a response.
AnswerPrint
TTS sends all print() messages in a AnswerPrint response.
AnswerReload
After loading a new game in TTS, TTS will send all the Lua scripts and UI XML from the new game as an AnswerReload.
AnswerReturn
If code executed with a MessageExecute message returns a value, it will be sent back in a AnswerReturn message.
MessageCustomMessage
Send a custom message to be forwarded to the onExternalMessage event handler in the currently loaded game. The value of customMessage must be an object, and is passed as a parameter to the event handler. If this value is not an object then the event is not triggered.
MessageExecute
Executes a lua script and returns the value in a AnswerReturn message. Using a guid of “-1” runs the script globally.
MessageGetScripts
Get a list containing the states for every object. Returns an AnswerReload message.
MessageReload
Update the Lua scripts and UI XML for any objects listed in the message, and then reloads the save file, the same way it does when pressing “Save & Play” within the in-game editor. Returns an AnswerReload message.

Enums§

Answer
Represents incoming messages sent by Tabletop Simulator.
Message
Represents outgoing messages sent to Tabletop Simulator