Atom
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.
We created an official plugin for the Atom text editor to make writing Lua scripts for Tabletop Simulator super easy and fun!
This page provides a basic overview of how to install and use the plugin; if you would like a more in-depth explanation of its features and how to install/use it then please see its documentation:
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.
Features¶
This is only a summarized list of features Atom offers. Check out a more complete documentation on the plugin specifically in the plugin wiki.
Syntax Highlighting¶
All standard Lua syntax is highlighted in multiple colors to help with readability.
Code Autocompletion¶
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.
Tabletop Simulator Integration¶
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.
Command | Action Taken |
---|---|
Get Lua Scripts | 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. Shortcut: Ctrl+Shift+L |
Save & Play | 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). Shortcut: Ctrl+Shift+S |
Every time you start up Atom, the cached local *.ttslua
files are deleted.
Installing Atom¶
Download and install Atom from the official website.
Installing the Official Plugin¶
- Click on File -> Settings
- Select the Install tab in Settings
- Type in tabletopsimulator-lua into the search field and press the Enter key or click the Packages button
- Click the blue Install button for the tabletopsimulator-lua package
Updating the Official Plugin¶
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.
Atom Console¶
Print, Log and Error Messages¶
All print(...), log(...) and error messages are sent to Atom's console. This is particularly helpful as you're able to copy text from here.
Shortcut¶
Windows/Linux: Ctrl+Alt+I
macOS: Cmd+Option+I
User Customization¶
Tab Width¶
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:
- Click on File -> Settings
- Select the Editor tab in Settings
- Scroll down to Tab Length
- Set the Tab Length to 4
Tables as Pipe Operators¶
To enable tabs showing up as pipe operators "|" as an indent guide:
- Click on File -> Settings
- Select the Editor tab in Settings
- Scroll down to Show Indent Guide
- Check Show Indent Guide