Skip to content

Features

onelivesleft edited this page Jun 3, 2018 · 15 revisions

Connected to Tabletop Simulator

The primary function of the package: it connects Atom to Tabletop Simulator, allowing the two to communicate with each other so you can edit your code in Atom and send it to TTS, and then TTS can send feedback (such as error messages) back to Atom. If you select an object in TTS and select the menu option to edit its code, that code will be sent to Atom.


Lua Grammar / Syntax Highlighting

The package integrates with Atom's grammar system so its syntax highlighting will colour your code as per your Atom theme, and other plugins which operate on code grammar should work seamlessly too.


Autocomplete

The package knows the Tabletop Simulator API, as well as the API for all the Lua packages available in the TTS environment, and it will provide suggestions for them as you type. For some TTS API functions it will also provide a second, verbose snippet; functions which take a Table of parameters will be expanded out for you if you select this second option, letting you figure out what options you need without having to jump back to the API docs.

Example of createButton verbose expansion

It also includes snippets for creating function wrapped coroutines: write the first line of your function then pick the second or third snippet suggestion.


Code Map

The package maps your code, keeping a track of all your functions. You can have it display in the status bar which function your cursor is currently inside (handy when you have large functions that are longer than a single screen's height). Clicking on the function name will jump your cursor to its start, while shift-clicking will select the entire function. This also allows for other commands provided by the package, such as the Goto Function... and Jump To Function commands.


TTS Interaction

The package interacts with TTS in real time, allowing you to send code to be executed immediately (without restarting the game with Save & Play). It also scans the save file, allowing it to generate code for inserting GUIDs into your scripts, as well as highlight the matching object in TTS if your Atom cursor is near the GUID string.


Smart Selection

The package provides some commands for more easily selecting blocks of code; code-aware selection based on indentation rather than row or column.


Linter Support

The package conforms to Atom's linter provider API; to enable linting simply install one of Atom's linter packages (linter by steelbrain has been tested, though any should work).
Enabling the linter will give you real-time warning and error messages as you type your code, giving you much more responsive feedback than if you had to run it through TTS before discovering simple mistakes.

You may manually suppress any Linter warning for a given line by adding -- to the end of that line (though this is not recommended; better to just fix your formatting!)


#include Keyword

The #include command allows you to insert other .ttslua files into your program when it is sent to TTS, allowing for more modular and reusable code.