Tabletop Simulator

Tabletop Simulator

Not enough ratings
Importing modules in Atom-Lua
By Mellester1
A quick guide how to import Lua modules Into your mod using the atom editor
   
Award
Favorite
Favorited
Unfavorite
About this guide
This is a quick guide to help you setup the Lua "require" keyword in table top simulator

The 'require' keyword is a high level function in Lua that loads modules for you written by you or other people.
Requirments
Before reading this guide I am gone assume you followed the official guide on setting up atom within table top simulator. here are 2 links that might help if you don’t have it https://api.tabletopsimulator.com/atom/
https://github.com/Berserk-Games/atom-tabletopsimulator-lua/wiki/Installation

HowTo
First open the Settings View by navigating to Edit > Preferences (Linux), Atom > Preferences (macOS), or File > Settings (Windows).
Then click on the packages button

Then go to Table top simulator -> settings and change it to the following

Basepath : "~\Documents\My Games\Tabletop Simulator"
Bunde file pattern: "Tabletop Simulator Lua\?.ttslua;Tabletop Simulator Lua\?.lua;?.lua;?.ttslua;"

That is it.
You can then go to "Documents\My Games\Tabletop Simulator\Tabletop Simulator Lua"
And add place in you modules you like to use in your mods.
Note the folder "Tabletop Simulator Lua" needs to be created by you first.
Or you can just dump your modules in the Tabletop Simulator folder.

This is how a basic module could look


There are ofcourse diffrent ways to make modules in Lua but this should atleast get you started
Happy modding
1 Comments
Jere 24 Apr, 2021 @ 12:06am 
Thank you, I was searching for this :steamthumbsup: