External Editor API

This page describes how our Official Atom Plugin API works so that you can write your own plugin for your text editor of choice if Atom does not suit your needs. The plugin communicates with Tabletop Simulator via two localhost TCP connections – one for each system acting as a server and the other as a client and vice versa. All communication messages are JSON.

Tabletop Simulator as the Server

TTS listens for incoming localhost TCP connections on port 39999.

Get Lua Scripts

Atom sends a JSON message with an ID of 0.

{
“messageID”: 0
}

TTS sends back a JSON message with an ID of 0 and an array of the Lua Scripts.

Save & Play

Atom as the Server

Atom listens for incoming localhost TCP connections on port 39998.

Pushing New Object

When clicking on “Lua Editor” in the right click contextual menu in-game for an Object that doesn’t have a Lua Script yet, it will try to open a new tab in Atom for this Object before falling back to the in-game editor if Atom is not running. TTS sends a JSON message with an ID of 0 and the new Object.