Tabletop Simulator Guide

Tabletop Simulator - scripting beginner's guide 001 - How to change other person's tables and scripts for Tabletop Simulator

Tabletop Simulator – scripting beginner’s guide 001 – How to change other person’s tables and scripts

Overview

How to change other person’s tables and scripts.I had the problem, that all my changes of existing scripts won’t have any effect to the game. I found a solution: You have to save the mod. Your scripts will have an effect only after saving the mod additionally.The guide will show you how I solved it.

How to cange other person’s scripts

You cannot change scripting code in other people’s mods, until you saved the table additionally! It is not enough to download a table.
This guide will show you how you have to save the mod, so that your scripting will have an effect.

But before that, the API side will explain more of the API that I thougth:
[link]

The links there are not explaining Lua, they explain how to use Lua in the Tabletop Simulator. I never clicked them before.
For example, you will get here:
[link]

See, what I mean

Load a table.
Then click the button ‚Modding‘ and select ‚Scripting‘:

You will see the code of the table. Insert a line of code in the ‚function onLoad()‘. For example:

    print(„## My own line of code“)

Then click the button ‚Save & Play‘:

The editor loads the table and runs the script automatically, but an error message should appear: ‚Error no save found. You must load a save first.‘:

So, you cannot change the scripting code, until you additionally saved your table. Now the solution:

Additionally save the table (mod, dlc)

To additionally save your own table click on the button ‚Games‘ in the upper corner:

Then just click on the button ‚create‘:

Give the file a name you want, like my ‚My new table‘ and click the button ‚Save‘:

Your done! Now your scripting changes will have an effect.

Test your code again

Test your code like in the first chapter, where I showed you how to see what I mean.
After clicking the button ‚Save & Play‘ the error message should be gone, only ‚Loading complete‘ should be there:

Load the table

Click on the button ‚Games‘:

and click on your save file:

Then on the button ‚Load‘:

For a short moment you should see:

The changes you made in the script should be here now.

Use the editor ‘Atom’

On the tabletop simulator page the hint is given to use the editor Atom:
[link]

Install Atom and the Tabletop Simulator Plugin

Download the editor from here:
[link]
• Click on File –> Settings
• Select the install tab in Settings
• Type ‚tabletopsimulator-lua‘ and press Enter
• Click the blue install button

‘File -> Settings’:

‘Install -> Search Packages’:

To change the settings of the new plugin from tabletop simulator,
go in ‚Settings –> Packages –> tabletopsimulator-lua -> Settings‘:

Use Atom editor and the Tabletop Simulator together

If you have opend Atom and the Tabletop Simulator together you should always see the scripts of the actual table inside of Atom. If you change the table, Atom will show the new scripts automatically.

At the moment it won’t work always (maybe it’s my mistake?), so I download the actual scripts with Atom in the menu:
‚Packages -> Get Lua Scripts‘:

Like shown in the picture you can use the shortcut ‘CTRL + SHIFT + L’ (the picture has a German keyboard layout).
The saving shortcut is: ‘CTRL + SHIFT + S’

A new window is opened, click on ‚Get Scripts‘:

After this loading the scripts are shown in Atom: ‚Received 2 files…‘:

You can now change the script. For example, I will print a message when the table is saved and loaded again. I will put my one liner under the line ‚function onLoad():

    print(“## My text when the table is loaded :)”)


When I use the shortcut for saving: ‚CTRL + SHIFT + S‘Plugin will save the whole table and restart it. Atom will show me this sending to Tabletop Simulator:

And starts my script too. You will see it in the chat in the corner left:

Done

I hope, now you are able to play and to change the scripts of other people‘s mods.
If you find interesting stuff, please write your own manuel, so I can learn from you!
🙂

SteamSolo.com