Tabletop Simulator
Оценок: 59
Counting Bowl
   
Наградить
В избранное
В избранном
Удалить
Assets: Scripting
Метки: Misc
Размер файла
Добавлен
Изменён
26.010 KB
13 июн. 2017 г. в 15:20
1 янв. 2018 г. в 7:17
Обновлений: 5 (просмотреть)

Подпишитесь, чтобы загрузить
Counting Bowl

Описание
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
☣CoRNeRNoTe☣ 3 сен в 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 апр в 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 фев в 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 фев в 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 фев в 8:28 
@Habanero Name one object, then copy it or put it in an infinite bag.
Habanero 28 фев в 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 окт. 2022 г. в 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 мая. 2022 г. в 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 янв. 2022 г. в 2:11 
Hello! How would I apply the code so instead of a bowl I could use something else?
BrickHouse 3 фев. 2021 г. в 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