Tabletop Simulator

Tabletop Simulator

Scripted Hold'em Poker Table
This topic has been locked
Skor  [developer] 28 Apr, 2016 @ 8:00am
Updates through 04-22-2016
Update 2016-04-22:
- Chip stacks are slightly closer together in the pot (changed 2 to 1.75)
- Made a few changes to the script to make it more adaptable to other tables.
-- Function resetPot is now getPotPos. The function doesn't reset any variables within itself, but just returns the coordinate(s) of the initial pot location.
-- Added a stacks variable to the collectBets function. This variable allows you to specify how many stacks of chips will be made along the z axis before it starts a new row of chip stacks.
-- Added two new global variables: dealdelay1 and dealdelay2. This allows the user to easily specify the frame delay between dealing cards.
-- The reset function now checks specifically for cards and decks in the muck zone, so you no longer need to have the "skip" variable on permanent objects in that area.

Update 2016-04-17:
- Added a resetPot function in which the pot's initial location is defined. I noticed that I had various locations in the script that would reset the pot location (or even just the y), which were easy to miss when porting to one's own table. Now the initial location coordinates are defined in only this one function.
- More improvements to collect bets. There are no longer gaps in the stacks when the chips are moved into the pot. This was caused by chips that were in multiple zones and were being counted two or more times. There is now a function to check for this, so they stack almost perfectly.

Update 2016-04-08:
- Changed the way the New Deck function works. Instead of spawning a new standard deck, it looks for a deck (of 52 cards) in the main area of the table (if you look at the scripting zones, it's the big one), and if it finds one, it assigns that deck as the new deck. With this change, you are no longer limited to the standard TTS deck; you can spawn any custom poker deck you wish to use.
- $5000 and $10000 stacks are now "chips," meaning they are stackable. However, this also means that the collect bets will grab them, which can cause an explosion in the pot, so be careful if people use them for betting.
- Made the "board" scripting zone smaller so you're less likely to have dealing messed up when a player puts cards down near it.

Update 2016-03-25:
- Changed dealer button to work like the afk button - using a variable on the object instead of referencing its GUID. This way, if something happens and you need to hit the rewind button, or if it goes into a bag and comes back out, it will still work.

Update 2016-03-24:
- Added a line to (smoothly) translate collected chips to offset {0, 0, 0} (basically, exactly where they are). This allows them to be affected by gravity, so they fall down on top of each other. When tested with large amounts of non-stacking chips (one of each of the 5, alternating so they didn't stack), the towers would collapse, but in normal situations, it shouldn't be an issue.

Updated 2016-03-23:
- Slightly improved bet collection. It no longer starts a new stack each time you click the button, it will add to the statck until it's 8 units or higher.
- The deal button now distinguishes cards from other objects on the board when dealing community cards.

Update 2016-03-22:
- Added button to collect bets and move them to the pot. If you rapidly spawn chips and spam click the button, chips seem to teleport around in the pot, but this shouldn't be an issue under normal circumstances.
- Added AFK button. Players can take one of these and place it in front of themselves (where the dealer/blinds buttons go) and it will skip dealing cards to them.

Update 2016-03-20:
- Community cards are now dealt with takeObject instead of dealToColorWithOffset. Prior to 6.9, takeObject took from the bottom of the deck, but this has been fixed. This change allows the white seat to be moved without messing up card positions.
- Cards in the muck pile are now returned to the deck upon reset. (update 2: They return to the deck regardless of deck's position)
- If dealer button not found, does not deal (previously would deal anyway starting from white).