Tabletop Simulator Lua Extension for VSCode
Extension for VSCode to make writing Lua scripts for Tabletop Simulator easier.
- Get Scripts
- Send Scripts
- Syntax Highlight based on the official Atom plugin
- Code autocompletion based on OliPro007's Extension
- #include support with nested, root, and scoped includes (Read more)
- Highly Configurable
- Built-in Console
- Integration with Console++ by onelivesleft (Tutorial) w/ Automatic Installation!
- Send commands from VSCode (Adds
- Receive output and debug information on VSCode Panel
- BBCode and nested colors support!
- Visual Studio Code v1.35.1
- Tabletop Simulator v12.0.4
From the marketplace:
Launch VS Code Quick Open (
Ctrl+P), paste the following command, and type enter.
ext install tabletopsimulator-lua
You can also Install from the VSIX Package, you can find it under Releases
Download or clone this repository and place it under:
Ctrl+Alt+`: Open TTS Console++
Ctrl+Alt+L: Get Lua Scripts
Ctrl+Alt+S: Save And Play
Tip: Press enter or double click on the Console++ Panel to focus the command input at the bottom.
This extension proves a quick and easy way to install Console++
By default, the TTS Console++ Panel will only show messages and errors from Tabletop, to enable further interaction you need to install Console++ along with a modified version that listens on
Bring up the Command Palette (
Ctrl+Shift+P) and look up:
TTSLua: Install Console++
If successful you should see a notification near the bottom right letting you know so.
Finally activate the scripts by including them in your Global scope:
Save and Play (
Ctrl+Alt+S) And you can now use the input textbox at the bottom of the Console++ Panel that will send commands to the game directly from VSCode. Prefixing these messages with
> will send your input as a command for Console++.
Here is a tutorial series on how to use Console++
You can also choose to not prefix a command and be able to catch them in TTS like this:
-- input contains the string you entered from VS Code
print('VSCode: ' .. input)
This extension contributes the following settings:
TTSLua.autoOpen: Which files should be opened automatically. (Default:
TTSLua.clearOnReload: Enable to clear console history when reloading. (Default:
TTSLua.consoleFontFamily: Font family for console. (Default
TTSLua.consoleFontSize: Font size for console in pixels. (Default
TTSLua.consoleInputHeight: Set Height for command input in pixels. (Default:
TTSLua.coroutinePostfix: Postfix to be appended to coroutine functions. (Default:
TTSLua.createXml: Create XML UI File for each Lua received. (Default:
TTSLua.clearOnFocus: Enable to clear command input on input focus. (Default:
TTSLua.guidPostfix: Postfix of variable when guessing
TTSLua.includeOtherFiles: Insert other files specified in source code (Default:
TTSLua.logSave: Enable to log a message when a save occurs. (Default:
TTSLua.parameterFormat: Formatting for Autocomplete. (Default:
TTSLua.parameterToDisplay: Autocomplete parameter insertion. (Default:
Execute Lua Code is not supported.
Partial theme support. Needs more testing.
#include doesn't work for XML UI Files.
Line numbers on error are mismatched when using #include.
Command Input has no history. (
Unable to add more Include Paths. (Only supports
Console panel sometimes displays print messages out of order.
This project was motivated on trying out different solutions to communicate VSCode with TTS and being rather unsuccessful at that. I tried using OliPro007's Extension and was a bit finicky for me, I also checked out dustinlacewell's vatts and was able to retrieve scripts but not send them. I guess I'm just inexperienced setting up these extensions which is why I wanted to dive into it by making my own and hoped to streamline the process for someone else.
I kind of ended up doing my own thing.
I included OliPro007's autocomplete ported from Typescript and built a much more simple communication architecture, which probably means it has a bit worse performance, however it works out for my purposes.
If you have any suggestions feel free to contact me or submit a PR.
You can find me on Steam and Reddit!
If you like this extension, please consider a small donation.