Tabletop Simulator

Tabletop Simulator

Not enough ratings
Universal Blackjack Reboot Modding Guide
By MrStump
I decided to re-do much of my scripting from the ground up, as well as make a series of changes and improvements. I want people to be able to modify this table to personalize it, so I'm going to summarize common help requests and problems people run into to make that easier.
   
Award
Favorite
Favorited
Unfavorite
How to use this guide
This guide is simply a list of how you can enact changes on certain elements of the table. Often it will require you to make changes to the scripting, but this typically requires no real knowledge of how scripting works. Generally you can just use context clues from other things in the scripts to see how to format certain elements.

If scripting knowledge IS required, I will be sure to mention it in that entry.

And if you want to know how to make other changes not outlined in this guide, as long as they aren't crazy complicated, leave a comment at the bottom. I'll respond and, if reasonable, add an entry to the guide =)
Where's the Global script?
Unity, the game engine in which Tabletop Simulator is made, has a problem with displaying strings of a long length. Because the script in Global is so long, its display string in-game is made invisible by this bug. The text is there, you just can't see it. There are 2 solutions.

(1) Use Atom. Atom is a supported code editor program that has a plugin that helps auto-complete many of Tabletop Simulator's functions. In the Knowledge Base of the Tabletop Simulator website there are instructions for setting it up. Once you do, when you have Atom open and then open the table, Atom will auto-populate with its scripts. Global will be fully visible. Once you make changes, you can then right click in Atom and select Save and Play to send those changes back over to the table. I would recommend this option.

(2) If you open scripting in-game and select Global, you will see an empty window. If you put your cursor in the empty window and hit Control+A, you will select all of the (invisible) code there. You can then Control+C to copy, open up any text editor you prefer to edit code in (Notepad, Notepad++, etc), and Control+V to paste. After you make your edits, you can copy and paste it back over into Tabletop Simulator. As long as all of the text in Global is selected when you paste it will all be overwritten by the "new" code.
-------------------------------------------------
Add Chips
  • Name the chips. (Each type of chip should have their own name)
  • Put each chip into its own infinite bag.
  • Save your table once you have the previous 2 steps set up.
  • In Scripting, go to MrStump's Chip Converter Token
  • You will see a long list of entries like: {name="$1", tierUp=10, GUID="a9d013"},
  • Add a new entry in the location where the value of your chip lies. (Ex: if it is a $5 chip, it goes between the $1 and $10 entries)
  • The name is the name of the chip in quotes. The tierUp is how many of this chip it takes to make the next chip up (NO FRACTIONS/DECIMALS). GUID is the guid of the infinite bag holding that chip, in quotes.
  • The tierUp of the previous chip may need to be updated to reflect how many of it are required to get the new entry.
  • For the final entry in that list, tierUp should equal 0.
Add Decks
  • The cards in the deck need to be named with names that match the entries in the Global table: cardNameTable
  • Once all cards have names, combine them into a deck.
  • Name the deck "Deck" without the quotes, with that same capitalization.
  • Once your deck is as you would like it, place it into an infinite bag.
  • At this point, save the table.
  • Open the Global script.
  • At the end of the script is a table named: deckBagGUIDList
  • It contains the GUID of any Infinite Bag that contains a valid deck. Default is only one, "4c8fe2"
  • If you want to replace the origional deck, just delete the old infinite bag GUID and paste in your new one.
  • If you want to add multiple different bags to have multiple different decsk, you may. Just put a comma between each entry.
  • Example: deckBagGUIDList = {"4c8fe2", "######","######","######"}

Note: If you remove a deck, you MUST remove its GUID from this list. Otherwise the script will attempt to look for that bag, fail, and throw an error, and you end up without a deck.
Add/Edit VIP/Prestige Cards/Rewards
  • Add the "cards" you want to represent various levels of VIP and/or Prestige.
  • Once they are on the table, give each a unique name.
  • Save the table before proceeding.
  • Open the Global entry of scripting.
  • At the bottom is an entry for vipRewardsTable.
  • By default, it has only one editable entry: ["VIP Example"] = {powerup=1, payout=2},
  • Copy and paste that line directly beneath itself, giving you 2 identical entries.
  • In one of the entries, in the quotes, enter the name you put onto your card. They must be identical in every way.
  • You can now change how many additional powerups they get and a payout modifier.
  • If they do not get any additional powerups/payout, the "Default" values would be powerup=0, payout=1.
NOTE: There is a default entry. The default entry MUST REMAIN, it is used to determine what a baseline should be. If you wanted to increase prize delivery for all players regardless of VIP level, you would do so in that entry.
Add/Remove Player Areas
This is more complicated than it used to be, with the additions I have made to functionality. But still possible.

  • Open the Global script.
  • Go to the table named MasterReference, at the bottom.
  • Listed here is each color, then a list of guids that belong to that color.
  • Hand is for the script zone that goes over where the cards are placed.
  • Vip is for the small script zone that goes where the vip/prestige cards are placed.
  • Save is for the small script zone that goes where the save bag is placed (for packing).
  • Sideboard is the pack/convert board each player has. The actual object's guid.
  • Sidetable is the large scripting zone over the entire table each player gets.
  • With this information you should be able to add/remove/change players just by updating these entires.
Change Amount Of Time For Prize Timer
  • Open Global.
  • In onLoad, look for this like: countdownTime = 20*60
  • This is the amount of time the countdown clock is reset to in seconds.
  • 20x60 = 20 minutes.
Change Card Names/Values
  • Open the Global script.
  • Towards the bottom is an entry for cardNameTable, find that.
  • It contains a list of entries, with a name equaling a value.
  • You can put any name here to equal any value, including negatives.
  • You should NOT use 0. It is utilized by the code for Aces.
  • This will allow you to name your cards as you like, or add in speciality cards.
NOTE: Some people play with Jokers where a Joker means instant blackjack. I did NOT include built-in functionality for this. With some scripting knowledge, you would be able to add it. Just make an entry in cardNameTable with the name and an arbitrary value (like 50) for it. Then in the function getValueFromCardNames(cardNamesInZone) you can see it using cardName to determine value. You could add a function here so that if it finds a certain name it instantly returns a pre-determined value (ex: 5000). Then in the function countCardValuesInAllZones(), add an if statement to check if totalValue == 5000 and, if it is, make totalValue = "WIN" or "*" or something to indicate the automatic victory.
Change Prize Bag Contents
  • Locate the Infinite Bag holding the prize bags in the hidden zone.
  • Right click it, and select reset to void the contents.
  • Create a new bag and put into it the selection of objects you want to be prizes. When prizes are given, one object will be chosen at random from its contents.
  • Once your bag is as you want it, place it into the infinite bag.
  • Save your table.
Change the Table Graphics
The object you want to edit may be set to be non-interactable, meaning you cannot right click it. If this is the case, you must:
  • Open the Global script.
  • At the top of the code, find this line in onLoad: if obj then obj.interactable = false end
  • Change the false to a true.
  • Save and apply the script.

Now that you can right click on all objects:
  • Right click on the table.
  • Select Custom.
  • Copy the URL of the Diffuse by highlighting it and hitting Control+C.
  • Go into any web browser and paste the URL.
  • Save the image to your computer.
  • Edit the image.
  • Upload it somewhere or to steam cloud.
  • Go to the Table's Custom entry again and replace the old diffuse with your new one.
  • You may or may not want to remove or replace the normal map entry.
  • Do not remove the model or collider.

Once you make you changes, go back and turn the true back to false so the table is not accidently unlocked.
Change Where Cards are Placed in Hand Zone
  • Open the Global script.
  • At the bottom are two tables: cardPlacementList_player and cardPlacementList_dealer
  • Both contain a list of entries. Each entry contains 3 entries of its own. Ex: {-1.2,-2,1.7}
  • In that example, the first number (-1.2) is the left/right justification from the center of the hand zone.
  • The second number (-2) is the height offset of the center of the hand zone.
  • The third number (1.7) is the forward/back offset from the center of the hand zone.
  • As you may have gathered, {0,0,0} would result in a card being dealt directly to the center of the scripting zone.
  • You can now create your own card placements.
  • They are used in order, so the first entry is where the first card is placed.
  • Obviously 1 list is for player hand zones, while the other is for the dealer hand zone.
1 Comments
Se7ntus 22 Oct, 2019 @ 12:05pm 
I am legit trying to add my own set of unique powerups and I really need your help my man. If you can drop me a message, that would be amazing.