Expand description
Incoming and Outgoing messages
Structs§
- Answer
Custom Message - Custom Messages are sent by calling
sendExternalMessage
with the table of data you wish to send. - Answer
Error - TTS sends all error messages in a
AnswerError
response. - Answer
Game Saved - Whenever the player saves the game in TTS,
AnswerGameSaved
is sent as a response. - Answer
NewObject - 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. - Answer
Object Created - Whenever the player saves the game in TTS,
AnswerObjectCreated
is sent as a response. - Answer
Print - TTS sends all
print()
messages in aAnswerPrint
response. - Answer
Reload - After loading a new game in TTS, TTS will send all the Lua scripts
and UI XML from the new game as an
AnswerReload
. - Answer
Return - If code executed with a
MessageExecute
message returns a value, it will be sent back in aAnswerReturn
message. - Message
Custom Message - 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. - Message
Execute - Executes a lua script and returns the value in a
AnswerReturn
message. Using a guid of “-1” runs the script globally. - Message
GetScripts - Get a list containing the states for every object. Returns an
AnswerReload
message. - Message
Reload - 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.