Tabletop Simulator

Tabletop Simulator

Counting Bowl
58 Comments
cloudust 8 Apr @ 9:22pm 
Does anyone know if they make a version that works on custom mats? I'm running a homebrew campaign right now and am using an inventory system with encumbrance. It would be awesome if I could just assign "weight" to items and have the player inventories automatically calculate it, instead of the players having to do it themselves.
theDissilent 28 Feb @ 1:27pm 
or you could edit the script to treat any item without a name as +1 to the count. It might be smart to make sure it doesn't count the bowl itself though.
Habanero 28 Feb @ 1:26pm 
The tokens are semi-unique in this case (have numbers and colors), but I think I found a janky solution to it anyway.
Dux 28 Feb @ 8:28am 
@Habanero Name one object, then copy it or put it in an infinite bag.
Habanero 28 Feb @ 12:01am 
Is there a way or workshop tool to count anything that goes in the bowl? Having to add the names of all the objects to a whitelist is a bit ridiculous. What if you have a hundred nameless counters?
Angheleny 24 Oct, 2022 @ 4:45pm 
is there a way to change the script to work as a square? I change the type to 1 instead of two and is a square, but if I change the size it doesn’t do nothing.
theDissilent 29 May, 2022 @ 7:07am 
Thanks again for this. It helped teach me how to use Physics casts when I first started.
I just noticed that TTS changed sphere casts to only size off the x value (and ignore the y&z size values). Now, if you resize this bowl to be an oval, the cast stays a sphere. I wonder why they removed that functionality.
Do you know of any work arounds?
Addict 16 Jan, 2022 @ 2:11am 
Hello! How would I apply the code so instead of a bowl I could use something else?
BrickHouse 3 Feb, 2021 @ 3:25pm 
If anyone else encountered the obj ref issue, this seemed to do the trick for me:
function onDestroy()
if timerID ~= nil then
Timer.destroy(timerID)
end
end
BrickHouse 18 Jan, 2021 @ 11:44am 
I'm encountering an "object reference not set to an instance of an object" error occasionally when exiting a game (there are multiple counting bowls). I've double-checked that I'm following the steps mentioned throughout this thread, but I'm missing something... hopefully something obvious.

It does exit cleanly sometimes as well which throws me for a loop.

Anyone else had this issue and possibly resolved it as well?
The Phoenix 1 Jan, 2021 @ 8:13am 
Great stuff ! Could we also have something similar with a flat (moveable) object ?
KUwaMAshi 16 Aug, 2020 @ 4:37am 
I tried to change the name of objects in the script,but it seems that it cannot identify the initial name of the objects. For example, I want it to count the White Piece in Go game(it doesn't have a name when pulled out from the bowl), it doesn't work. It will work only if I change the objects' name manually. Do you have any advise? Thank you!
Tsutaru 15 Jun, 2020 @ 9:08pm 
I'm using the unlimited "go" bowls as a bank of VP pieces, so it would be good to have another bowl to count these VP tokens being collected per player. However, the go pieces don't seem to have a name when I pull them from the bowl, which is preventing me from using this counting bowl. Advice?
Ben Matrix[PGU] 16 May, 2020 @ 8:41am 
Great counter. I would like to have all the items in the bowl deleted when you click on the "TotalValue" button or by adding a second button called "Empty Bowl". Is that possible? I've tried to write a buttonClicked function but I'm too bad at LUA.
Abel G 29 Apr, 2020 @ 8:06am 
Great concept! I just added it to my server but the players are reporting that the numbers are overlapping. It seems like the 0 doesn't go away. I wasn't able to get enough details from them, and since I don't see the problem as the host, I don't know how else to diagnose the problem. Any thoughts?
AJBruner77 21 Dec, 2019 @ 3:24am 
This is a handy package to help visually keep track of anything while playing. Lots of flexibility built-in and it is pretty easy to make alterations.
Unreal Ed 23 Sep, 2019 @ 7:03am 
ohhh! I didn't know that! That could be super reliable info, thanks!
mjblyth 22 Sep, 2019 @ 12:13pm 
This is great, just what I need. However, the docs say that bowls and cups are containers and should respond to getObjects(). Is this just an error, so that your ray-casting trick is required?
aceb20 15 Mar, 2019 @ 10:17am 
Is there any way to have the bowl count an assigned stat in the description? I have items with dynamic weights in the game and being able to weigh them on the fly would be great. However, hard scripting the weights wouldn't work.
MrStump  [author] 28 Aug, 2018 @ 6:10pm 
It is possible to do, but I didn't do stack/container counting
donnylicious 26 Aug, 2018 @ 10:43pm 
Does the currency only work for objects? I have cards that I've made the "currency" and, when they stack, it doesn't seem to count.
MrStump  [author] 18 Aug, 2018 @ 3:57pm 
The display is just button text. duplicating the function that creates the button, and moving its position, would make 2 of those buttons. Then the number updating just need to be applied to both
Fourleafclov 16 Aug, 2018 @ 5:02pm 
Is there a way to add two counters? Just so you can have one face you, and one face out?
theDissilent 21 Jul, 2018 @ 7:50pm 
Thanks so much for all your guides and examples. This counting bowl was just what I needed to keep score in my own mod.
Selborn 3 Feb, 2018 @ 9:37pm 
Trying to count the number of dice, trying to figure it out for warhammer, and sometimes it takes awhile when there are like 30+ dice. I already found something to sort the dice, so I only have the dice I want to count left. Just need to know "Oh, I just put 25 dice in the bowl."
Unreal Ed 3 Feb, 2018 @ 4:49am 
Do you want it to count the number of dice or the face in the bowl? if it's the latter you can just do it automatically when you roll a bunch of dice. For the former, the die would be jumbled in the bowl, so you couldn't tell which side is up, but you could count the number of dice.
Selborn 2 Feb, 2018 @ 3:08am 
Does anyone know how to use this with custom dice? I've only recently started playing with Tabletop Simulator so I'm not super familiar with stuff yet so I could be doing something simple wrong...
MrStump  [author] 1 Jan, 2018 @ 7:19am 
I did scale the size of the casting sphere, but I didn't scale the height offset it used. Whoops. I just updated it, so the workshop version will work fine.

If you ever want to take a peek at the cast, 7 lines from the bottom is: --debug=true

Remove the -- and it will visualize the casting
Unreal Ed 1 Jan, 2018 @ 6:38am 
My guess is that the physics casting used to do the counting isn't scaling with the object in the code, judging from ur comment
Lichtmeister 1 Jan, 2018 @ 2:37am 
Nice tool !
I've got an issue using it : after reducing size of the bowl to 0.5/0.5/0.5, it doesn't count anymore what is inside (it is counting when I keep the coin above the bowl, but give "0" when release inside").
I had to resize the coin and make it bigger to prevent that bug.
MrStump  [author] 16 Dec, 2017 @ 9:41pm 
Thanks for double posting, save me the trouble of guessing a bunch =D Good tip for others
Oslash o/ 16 Dec, 2017 @ 9:26pm 
Whelp, I'm going to double post because I figured out my problem. I was using a copy I had in my saved objects instead of the one from the workshop list > expand menu. Derp.
Oslash o/ 16 Dec, 2017 @ 9:22pm 
Is it weird that I'm subscribed to your mod but it still throws an error on delete? Is there some way to force version checking on these workshop items? I fixed it manually but now I'm wondering what other updates I'm not getting.

Great little tool, like all the rest of your creations.
MrStump  [author] 10 Dec, 2017 @ 6:57pm 
haha You weren't the first to run into it. When I made it I plain forgot that fix, and I was too lazy to impliment a copy/paste fix since I hadn't run into it before until this project.

Time to get off my butt =)
Tragic 10 Dec, 2017 @ 1:19pm 
nice!! where was the delete fix 3 days ago!! haha~!
Cyrusa 2 Oct, 2017 @ 12:05pm 
Cool mod. Really helped me learn how to use the physics casts.
I adapted the code to count Trade Goods tokens on the race sheets in my mod .

Note: You could destroy the timer when the bowl is destroyed, else the console will be spammed with regular error messages when it happens.
Unreal Ed 20 Sep, 2017 @ 10:58pm 
I also made a mod called Counting mats based of this mod
boris 20 Sep, 2017 @ 11:15am 
@kinokino7 - check out my Lords of Vegas mod. I made some tiles there using MrStump's code as a basis. They use a box to find what's on the tile, rather than a sphere like the bowl uses
kinokino7[Zipangu] 19 Sep, 2017 @ 11:42pm 
· I want to count on mat, not bowl
· I want to count the number by setting the name of all the cards to "1"
· How can I adjust the area to be counted to matte?
MrStump  [author] 28 Aug, 2017 @ 7:36am 
When you copy/paste the bowl, it doesn't get a unique GUID instantly. So when the timer tries to start, it has the same GUID of the other bowl on the table.

This is fixed instantly, though. So if you save/load your table with multiple bowls, they will all work fine. It is just a bug with copy/paste
БарменБарменБар 28 Aug, 2017 @ 7:27am 
why i cant have more then 1 Counting Bowl?
MrStump  [author] 22 Jul, 2017 @ 5:49pm 
Yeah I put an update out the same day.
ChizBallz 22 Jul, 2017 @ 5:45pm 
so is this mod working properly now that TTS 9.5 is out?
MrStump  [author] 22 Jul, 2017 @ 7:01am 
I know what you mean Boris, but with Lua it isn't an issue. Lua has a lot of odd quirks like that
boris 22 Jul, 2017 @ 6:27am 
Mr. Stump, in the validCountItemList part of the script, I see there's a comma after the first entry, and the other entries are commented out - so that first entry is also the last. Is it not a problem in LUA to have a comma after the last entry in a list? I program in other languages where that would be a problem.

Thanks for your insight.
MrStump  [author] 9 Jul, 2017 @ 7:24am 
Dam Tac pointed out you get an error when you copy/paste the bowl. This is because the bowls have the same GUID in the frame it loads, causing an error with the timer. No big deal, just save and load the map and it will work fine =)
ChizBallz 9 Jul, 2017 @ 6:31am 
This works great, is there a way we can have multiple bowls? I would like each player to have one, but at the moment, it seems like the script only allows for one per given table. Something with the timer GUID.
Unreal Ed 28 Jun, 2017 @ 2:09pm 
@Judgernaut you could use my counting mats ( here ) and place them on the scale. You can assign items negative values on one side and positive on the other, plus they are transparent.

One thing is that the mats are square though, and not actually circular. You could pretty easily change the cast to a sphere instead of a box though, and that would solve the problem (with the right numbers)
Judgernaut 28 Jun, 2017 @ 1:06pm 
mrStump. Pwetty please add it to this so that one tray adds positive value and the other negative value https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=958438193
Tragic 21 Jun, 2017 @ 3:24pm 
awesome!