We created an official plugin for the Atom text editor to make writing Lua scripts for Tabletop Simulator super easy and fun!
Atom is a free, open source, and cross-platform text editor created by GitHub:
Atom is a text editor that’s modern, approachable, yet hackable to the core—a tool you can customize to do anything but also use productively without ever touching a config file.
Our official plugin introduces syntax highlighting, code autocompletion for the Tabletop Simulator Lua API, and functions to interact with the game. The in-game editor will continue to exist for quick access to scripts, but development on it will cease to continue.
Prefer another text editor? Take look at our External Editor API to make your own plugin.
All standard Lua syntax is highlighted in multiple colors to help with readability.
The entire Tabletop Simulator Lua Scripting API (with the exception of the Player class) has been added to the native Atom autocomplete system. Easily see all of the member variables and functions available to you with their parameters, return type, short description, and a link directly to our Knowledge Base with more information for that variable or function. Functions belonging to the Lua standard library classes such as math, coroutine, or os link directly to the official Lua documentation.
The Atom plugin can directly connect to a running instance of Tabletop Simulator to get all of the existing Lua scripts on Objects and to call Save & Play. Both functions can be called directly from the Packages menu or the right click contextual menu. TTS must be running with the game loaded for these functions to work.
Downloads all existing scripts in a loaded Tabletop Simulator game with Atom. You will need to call Get Lua Scripts every time you change to a different game in TTS.
Note: Every time you start up Atom, the cached local *.lua files are deleted.
Saves all Lua files in Atom, uploads them to a loaded Tabletop Simulator game, and reloads the current game (same as Save & Play in the in-game editor).
Download and install Atom from the official website.
By default, Tabletop Simulator scripts use a tab width of four spaces. You are not required to adhere to this spacing. By default, Atom has a tab width of two spaces. To optionally make Atom default to a tab width of four spaces:
To enable tabs showing up as pipe operators “|” as an indent guide:
The plugin will automatically check for updates when Atom is started. If a new update is found, it will update itself. You will have to manually restart Atom for the new version of the plugin to be loaded. You can check Atom’s console if it found an update (ctrl + alt + i).
All print() functions automatically send their messages to Atom’s console (ctrl + alt + i).
All Lua errors are automatically sent to Atom’s console (ctrl + alt + i).