Tabletop Simulator

Tabletop Simulator

Not enough ratings
Universal Chip Converter Script v2.0
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc
File Size
Posted
Updated
26.347 KB
29 Aug, 2016 @ 4:39pm
8 Oct, 2016 @ 3:18am
4 Change Notes ( view )

Subscribe to download
Universal Chip Converter Script v2.0

Description
UPDATE: I created a new chip converter from the ground up. It is smarter, has more features, works with multiple zones and more. And it does all this while letting you still use your same chipList so you don't have to create it again. I will leave this one up for legacy reasons, but I highly recommend using the new one instead. You can find it here.

A chip converter either combines or splits poker chips up/down in value. I have designed this script to be usable by anyone to add a chip converter to their table. It comes with detailed instructions in the script to explain how to set it up, little-no scripting knowledge required.

Included is an example table that shows you how the script work, and how I set it up. Just save the scripted object to your chest (the one with the buttons on it), import it into your game, and follow the instructions in the script. It is meant to be as easy as this kind of thing can be.

If you experience any errors and have followed the instructions carefully, please leave a comment to let me know how I can re-create the problem. That way I can fix it for everyone. So far, the exchanges all seem great.

UPDATE Oct 2016: I've updated the script with some small new features. The "tierDown" field is GONE, so the script is now easier and faster to set up. It also has a self-delaying buffer that prevents you from spamming the button which can cause errors due to how TTS works. It also will try to split chips into different piles when stacking them up, so if you have 2 different piles they won't stack on top of eachother while being dispensed.
21 Comments
Se7ntus 25 Oct, 2016 @ 11:53am 
Hey Mr. Stump, im in the making of the best blackjack table and i REALLY need your help with scripting your chip converter!
Wyan 8 Oct, 2016 @ 3:39am 
Alright man i'll give it a try.
MrStump  [author] 8 Oct, 2016 @ 3:16am 
Issue 1, you have "tierUp" set to invalid values for a few of your chips (0) which would result in chips being devoured but not getting anything in return. Lines 76 and 77. Secondly, I've gotta new version of the script out which does NOT require the tierDown, but you can keep using the version you have. See my update in the description though to determine if you want to upgrade.

Also, if your chipList is not correctly formatted, it CAN cause TTS to lock up and die. The reason is the "return" loop in the tradeUp function. Avoid tradeUp while you are debugging the code to avoid crashes.

Thirdly, when you move the code to another object, or combine it with a lot of other code, it is a lot harder for me to troubleshot because I can't be sure what you have or have not changed. But give the fixes I've mentioned a try and see how it goes.
Wyan 7 Oct, 2016 @ 8:38am 
It's 1:30 in the morning in Australia. Feel free to add me on steam. I'll upload my version of the map when i get up.
Wyan 7 Oct, 2016 @ 8:37am 
Downloaded this map about 4-5 days ago. the trade up script was messy. And only really supported $1-$100k chips. So i replaced it with your script. Keep in mind there is two converter spots. I just changed a few numbers. I've hosted an multiplayer lobby today. Twice it has crashed. Once in an multiplayer lobby with someone trying to trade up 53 stack of 1ks. Second time in an multiplayer lobby by someone trading up nothing. It has also crashed alot on singleplayer when i throw in random amounts of chips of random values between $10 - $100t.

code -- http://pastebin.com/junZPbM4

map(without custom chips) -- https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=774292858

My lua is pretty shit.

Thanks for helping
MrStump  [author] 7 Oct, 2016 @ 7:35am 
The value of the chips has no impact on the script, it only reads chip names and the "tierUp" value you assigned to them. I am unable to reproduce any of the bugs you are mentioning on this test table that comes as part of the workshop item.

Upload you full script to Pastebin and I'll take a look for you.
Wyan 7 Oct, 2016 @ 3:13am 
Edit: I found the issue of the crashing. it appears when i try to convert chips with way higher values it crashes. I tried to convert 5 100k's and 10m it crashed.
Wyan 7 Oct, 2016 @ 2:55am 
I set everything up right. I pile in some chips. Sometimes it works. Sometimes the chips get sucked up and i get nothing. Sometimes my game crashes. Sorry, but i don't think this works anymore.
MrStump  [author] 10 Sep, 2016 @ 5:09pm 
Sure. And for everyone else, if you get an error, check the following 3 things.

(1) When you right click on each chip, make sure the Name field has the name of the chip that you put into the script.

(2) Check you scripting zone and its GUID. Make sure the GUID of the scripting zone matches what is in the code.

(3) Make sure the GUID of the INFINITE bags all match each entry.

These are the usualy problems I see.
Dev 10 Sep, 2016 @ 2:01pm 
when i tried this i get the error: error calling Lua function tradeUp: chunk_1:(97,4-43): attempt to index a nil value

Ive added you can you help me?