Tabletop Simulator

Tabletop Simulator

Deck Splitter
27 条留言
schattenseele 2022 年 7 月 23 日 上午 2:25 
overall great work MrStump .. thx !
ps ... video is privat
David C 2020 年 12 月 8 日 下午 11:37 
MrStump, this is very useful. I took your code, did some modifications, and made a device that distributes cards on the table in the form of an "Auction Block," think 'Power Grid' or 'Get off my Land.' Basically, it'll create grid of n rows x m columns of face up cards instead of stacks and cards .

I'd like to put this "Auction Block" up on the workshop, after some cosmetic changes. So, I wanted to check in with you first since I essentially cut-n-pasted your code. Of course, I'll give you due credit.
FourString 2020 年 2 月 25 日 下午 5:43 
Super helpful, thank you so much!
IceMaverick 2018 年 11 月 1 日 上午 9:05 
Apologies, I retract my request. Turns out you've designed another tool that does exactly what I'm looking for.

Also, man you've designed a lot of tools. Keep up the good work on that front.
IceMaverick 2018 年 11 月 1 日 上午 8:47 
So, this is probably a weird question to get after more than a year of quiet, but I'm looking to modify this tool for a very specific purpose. I'm familiar with scripting, but haven't worked with Lua before and I'm unfamiliar with TTS itself from a code standpoint. The task I have in mind is achieved well by a deck splitter like this, but I need to tweak it a little and my own attempts have failed thus far.
I want the splitter to take a deck of 10, split it into 10 stacks of 1, but lay them out in 2 rows of 5 instead of 1 row of 10. I think I know which function needs modifying, but my own attempts break the splitting function and I'm not sure where to go from here. If you have some time to help me through this, I would appreciate it, if not, I suppose I can live on.
Anjovi 2017 年 11 月 25 日 下午 7:27 
Sedawk, that's the exact game that prompted me to look for something like this :D
Sedawk 2017 年 11 月 5 日 下午 5:35 
Thanks for this tool! Downloaded Bruges and was racking my brain on how to easily split the deck into 5 stacks to adjust player count. This tool did the trick.
KBB 2017 年 5 月 27 日 下午 6:47 
Thanks that's super helpful, don't worry you've already done a lot! Thank you!
MrStump  [作者] 2017 年 5 月 26 日 下午 9:49 
I was intending on re-visiting this tool at some point. I wanted to re-write it to support larger decks, but that was about it. It was just meant to split decks into piles.

And the problem I have with making a tool that is universal enough to allow you to do things like deal to players and to pre-set postions is it ends up having so many options people have tons of trouble setting it up. So I can't make something that fits the bill, sorry.

As for dealing to players, there is a "deal to all players" command which you use on a deck in Lua to give each seated player a card from a deck, so it is easy (See the Knowledge Base on the Tabletop Simulator website if you are curious) relatively speaking. And if you're interested in learning, I've made a guide called Learning Lua in the guides section of the workshop. Sorry I can't do more
KBB 2017 年 5 月 26 日 下午 2:13 
Oh.. and what about dealing face up?
KBB 2017 年 5 月 26 日 下午 2:10 
This is amazing! Super useful.

Would it be possible to make it spit out the cards in two rows? 4 on top of 4 for the game Koi Koi? Also.. how about dealing to hands as well?

In Koi Koi you deal out 8 to each player and 8 onto the field. We can do this manually but it would be super cool if I could do it automatically, but I have no idea how to do any coding really. Is there a way to edit this to also deal to players? Sorry if that's a dumb question, I know with programming something that seems reasonable can be super complicated.

Thanks- either way this will make playing much faster.
MrStump  [作者] 2017 年 3 月 31 日 下午 1:00 
I am also considering giving it a keypad to use to enter # of stacks, # of cards in each stack. So you can enter a number of stacks and it splits the deck among them as evenly as it can (and warns if it isn't even), or a number of stacks + how many in each stack with the tool hanging onto the remainder.
MrStump  [作者] 2017 年 3 月 31 日 下午 12:56 
putObject would require decks to be formed first, which is a little tricky. It could probably be solved by handing the main deck via a coroutine, moving out 50ish cards a second. 1000 card decks could then be handled probably, although it would take a moment or three longer.

Its on my list of things to revisit possibly in the future.
Markimus 2017 年 3 月 31 日 下午 12:15 
This crashes the game if you have ~1000 cards you want to split. Is there a more efficient way to do this now with putObject()?
Acrilix 2017 年 1 月 12 日 上午 5:53 
Great little tool. Thanks.
MrStump  [作者] 2016 年 8 月 20 日 下午 8:39 
Can't control the color of that text (it is button text, technically, which can't be changed currently). But I set it back down. Glad the rest worked, thanks again for letting me know.
rossc719 2016 年 8 月 20 日 下午 5:29 
Thanks! That fixed it. Buttons are now nice and easy to click, and the way they very-slightly hover above the surface looks pretty cool, actually. Sort of like a holographic projection or something.

The only thing that is a little odd is the top and bottom lines of text also hover with the buttons, which makes them a little harder to read unless you look straight-on from above. I think those could probably be lowered back to the surface (Or make it a different color?) But that's totally minor.

Thanks again for the fix! Works perfectly now.
MrStump  [作者] 2016 年 8 月 19 日 下午 6:41 
I increased the height a little. If you want to try more, line 207 and down you will see a number in the position for each button (0.08). Increasing the number will increase the height. I don't have a VR headset to check it myself. =(
rossc719 2016 年 8 月 19 日 下午 4:16 
Nice tool! But, having a bit of trouble using it in VR mode.
After putting a deck into it, the buttons show up on the surface to select number of piles etc..
When I point at those buttons, the game can't seem to decide if I a pointing at a specific button, or at the entire deck-splitter object as a whole, and toggles back and forth very rapidly (10s of times per second). So , when you finally do click, you get one behavior or the other by chance.

Any possibility that the buttons could be raised up off the surface ever so slightly? That might help?
MrStump  [作者] 2016 年 8 月 12 日 上午 10:10 
Yeah, too much looping in scripting causes crashes, as well as too much object movement/spawning all at the same time. I don't think scripting has any checks to prevent it currently. I could write in protection from that (breaking loops up with timers to prevent overflow) but it would be too much work, sorry.

But if you're ever looking to crash TTS, just open the chest and click the Tablet button for 30 seconds.
Varulven 2016 年 8 月 12 日 上午 8:01 
Gotta give it to ya. I've never managed to crash TTS before. Now I have. From trying to split a 1453 card deck into 36.
Varulven 2016 年 8 月 11 日 下午 11:19 
if this works well and the dealt hands arent too stacked, that's some really impressive scripting. I tip my fedora to you, good gamer.
MrStump  [作者] 2016 年 8 月 11 日 下午 1:57 
Auto-dealing goes against some hard limit I put into the code. It would be easier to canabalize my code and write one from scratch that to try to edit this one for that feature. If you want to add me on steam we can discuss the features in more detail and I can make a new thing.

As far as rotating the cards that come out of it, sure. You need to make 3 code changes. (1), line 4, increase cardOffset (so the cards are spaced out more, since they are laying down). (2), line 159, change the rotation listed here by 90 degrees on the y (second number) or z (third number) acis. (3), lines 177 and 179 there is some complicated math. But in that math is a number, 0.8. That is a factor for how close/far from the tool the first card is placed. You may need to increase it if your cards are hitting the tool when dealt.
cr0wcr4w 2016 年 8 月 11 日 下午 1:02 
Is possible to split the deck bay the same number of cards altomatically? like if you put 8 cards in the deck spliter, it will split all the 8 cards altomatically. How can i do that? And is possible to the cards come out in vertical and not horizontal?
Primal Stultus 2016 年 8 月 10 日 下午 3:18 
Love it, THANK YOU THANK YOU
delta07™ 2016 年 8 月 9 日 下午 5:32 
neat
darleth 2016 年 8 月 9 日 上午 3:55 
Thanks