Module tts_external_api::messages
source · Expand description
In- and Outcoming messages
Structs
Custom Messages are sent by calling
sendExternalMessage
with the table of data you wish to send.TTS sends all error messages in a
AnswerError
response.Whenever the player saves the game in TTS,
AnswerGameSaved
is sent as a response.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.Whenever the player saves the game in TTS,
AnswerObjectCreated
is sent as a response.TTS sends all
print()
messages in a AnswerPrint
response.After loading a new game in TTS, TTS will send all the Lua scripts
and UI XML from the new game as an
AnswerReload
.If code executed with a
MessageExecute
message returns a value,
it will be sent back in a AnswerReturn
message.
Tables have to be decoded using JSON.decode(table)
.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.Executes a lua script and returns the value in a
AnswerReturn
message.
Using a guid of “-1” runs the script globally.Get a list containing the states for every object. Returns an
AnswerReload
message.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.