Tabletop Simulator

Tabletop Simulator

Not enough ratings
Setting Object's Variables Tool
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
File Size
Posted
13.051 KB
19 Apr, 2020 @ 6:43am
1 Change Note ( view )

Subscribe to download
Setting Object's Variables Tool

Description
Hi everybody! This is a tool I've created by need. If you have already dealt with scripts, I guess that sometimes you had to insert hidden information within the objects, like the number of a card or the price of an object.
A simple way to do this is to use the functions setVar() and getVar(), but in this case the state is temporary and don't survive after saving. Also, for the moment, I haven't found a way to get a list of all the variables. I can only find them by name. This is not a huge problem, but I prefered to use a more general purpose tool (without knowing the keys used for the setting).
Another way to do this is to manualy code the informations in the Lua script of the object like normal variables. This works and, to get the list of all the variables, just use the getLuaScript() function.
Now, to avoid editing the scripts of each object manually, I created this tool that allows you to do 3 things (all inside the game):
- get the Lua script of an object and directly overwrite it
- insert a variable as couple Name - Value (like the setVar() function)
- test the value of a variable to see if it's correct (not much useful but let you know if getVar() will works properly)
Using Lua scripts for store variables has its flaws, like fill your editor with a lot of pages, but for that just put the objects inside a deck or a bag to avoid show them.
This tool is a single object and can be imported in any table you want to use it.
IMPORTANT: any changes only take effect after you save the table.
1 Comments
Unreal Ed 19 Apr, 2020 @ 3:17pm 
Nice! Seems very useful. Thanks for creating it!