Tabletop Simulator

Tabletop Simulator

59 ratings
Counting Bowl
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc
File Size
Posted
Updated
26.010 KB
13 Jun, 2017 @ 3:20pm
1 Jan, 2018 @ 7:17am
5 Change Notes ( view )

Subscribe to download
Counting Bowl

Description
This is a bowl that counts the things that are in it. It will only count items in a list, and you can assign value (to make some values worth more than other). You can also put a value in the description to override the value you put into the script. Easy to edit. Handles stacks of items (but not containers or decks currently).

This also has an example of a sphere physics cast to locate objects. As always, if you have questions, drop a line in the comments.

Judgernaut from the forums requested this.

Updatated using the new visual debug for ray casts.

Updated to prevent it from throwing an error if deleted. Also fixed it for the bug that occurs when you copy/paste the bowl.
59 Comments
☣CoRNeRNoTe☣ 3 Sep @ 3:26am 
Thanks for sharing! I used this in my Space Crusade game to count the miniatures value - https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3545458420

It was super easy to setup with their names and values
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