Tabletop Simulator

Tabletop Simulator

59 beoordelingen
Counting Bowl
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Assets: Scripting
Tags: Misc
Bestandsgrootte
Geplaatst op
Bijgewerkt op
26.010 KB
13 jun 2017 om 15:20
1 jan 2018 om 7:17
5 wijzigingsnotities (weergeven)

Abonneren om te downloaden
Counting Bowl

Omschrijving
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 opmerkingen
☣CoRNeRNoTe☣ 3 sep om 3:26 
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 om 21:22 
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 om 13:27 
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 om 13:26 
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 om 8:28 
@Habanero Name one object, then copy it or put it in an infinite bag.
Habanero 28 feb om 0:01 
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 okt 2022 om 16:45 
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 mei 2022 om 7:07 
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 om 2:11 
Hello! How would I apply the code so instead of a bowl I could use something else?
BrickHouse 3 feb 2021 om 15:25 
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