A lot of Tabletop Simulator's features are about trying to recreate the experience of playing board games in a virtual setting. However, when it comes to its built-in scripting capabilities, Tabletop Simulator leverages the processing power of computers to create board game experiences that you would not be able to do in the offline world. Some mods features scripts that will do the table setup in mere seconds, while other mods have rudimentary computer opponents built in. In any case, the programming aspects of Tabletop Simulator are part of what makes the software special, and no tutorial series would be complete without addressing them.
However, this class is not a programming class and its scope and time frame prevent me to go in-depth into programming Tabletop Simulator. This video is therefore just an introduction on how you can add code to Tabletop Simulator, with some helpful tips towards the end for those interested in giving it a closer look. While I strongly recommend that everyone has a look at the video, I am not requiring any coding to be done on any of the assignments for this class and I will not ask any questions regarding to this video on the quizzes or midterm.
LEARNING GOALS
Adding code to your Tabletop Simulator mod to optimize gameplay
Knowing where to find the unofficial API documentation for Tabletop Simulator
Joining the online Tabletop Simulator community of Discord
VIDEO CONTENT
1:04 Installing Atom from Atom.io
1:46 Importing LUA scripts in Atom
2:31 onLoad() and onUpdate()
3:24 The official documentation
3:40 The unofficial documentation (by the TTS community)
5:16 Start of the improvised coding example
10:44 Creating a button with createButton()
18:29 Printing "Hello World" when pressing the button
19:43 Accessing the deck of cards using its GUID
22:08 Shuffling a deck and dealing cards using code
24:17 Making a second button without losing our work
26:41 Taking a card from the top of the deck and moving it
29:19 Tip #1: Everything in TTS mods is open source
30:43 Tip #2: The difference between objects and containers
31:42 Tip #3: Don't try to turn a TTS mod into a video game
32:19 Tip #4: Don't put all your code in the onUpdate() main loop
33:05 Tip #5: Get a LUA tutorial and learn about LUA tables
33:25 Tip #6: Make good use of the GMNotes field
33:58 Tip #7: LUA can parse the JSON files of every object
34:54 MrStump's Tabletop Simulator Tutorials
36:01 Where to get help for TTS coding online