Lua Scripts for Tabletop Simulator
On my free time I play boardgames in Tabletop Simulator. So most of the time I want to automate many boring actions. This is why I’m doing this notes:
Good articles and learning resources
- This playlist is excellent to start. It goes from basics to really good applications.
- Official TTS Discord has a great
#scripting
channel. - This blog post by Distilled Game is a great walkthrough to a TTS mod.
- This forum post about
require
keyword. - TTS community guide
References and some official documents
- Knowledge base TTS: General information about TTS.
- Official TTS API: Lua specific documentation for TTS.
- TTS patch notes (it has some specific notes on Lua and the like)
- Suggestions and feedback of TTS software can be voted in the nolt platform
- Lua Classes for TTS an official repo in github 😮.
Mods and saves
- Where are my mods saved? here:
C:\Users\{user}\OneDrive\Documents\My Games\Tabletop Simulator\Mods
- tts-save are tools for mods saves.
IDE
TTS is tricky, you have to open TTS and “receive” the code from tabletop simulator. So here are a bunch of tools I checked out:
- tabletopsimulator-lua-vscode is an extension for VS Code.
- You’ll probably want to assign
.ttslua
to.lua
language in VS Code. - Moonsharp debugger for TTS
-
Types for TTS for Luanalysis.
-
Atom has also an extension for TTS, but Atom got dropped of development this year. TTS has a reference guide to install and some general features.
Lua thingies
- If you end up with a lot of files, it’s useful to bundle them into one file with
luabundler
. Many mods from Steam workshop do. - You can also bundle xml with
@tts-tools/xmlbundle@tts-tools
- many devs choose to have a repos of libs, in which dump a bunch of useful files. Benjamin Dobell is a member of Berserk Organization in Github (might be related to TTS), kintastic, Zehir, omniraptor and omniraptor UI, Andr3wd, sebastian Stern, eruber have some files.
- Promise in lua
- What’s a good way to program a “sleep” function in TTS / lua?
Amazing mods to learn from
from github
from steam workshop
others
- github search:
TTS
withLua
language npm
search:tabletop-simulator
andtabletopsimulator
terms.
Things I tried (document more)
-
I tried to do an XML schema but I have abandoned the task because XSD isn’t flexible enough. I found that XML cant have optional repeatable elements, that may or may not appear (as buttons and text labels in a TTS XML).
My investigation has come up to: TTS uses XmlLayout. (source: this comment)
-
Installed v2.0 beta of TTS-lua-vscode https://github.com/rolandostar/tabletopsimulator-lua-vscode#manual-installation
This post comes from github, view it here