Tabletop Simulator

Tabletop Simulator

45 ratings
Click Roller Universal
2
   
Award
Favorite
Favorited
Unfavorite
Assets: Scripting
Tags: Misc, Templates
File Size
Posted
Updated
61.814 KB
12 Aug, 2017 @ 2:49pm
14 Aug, 2017 @ 1:55pm
2 Change Notes ( view )

Subscribe to download
Click Roller Universal

Description
My best scripted tool that can roll any dice for you and announce the roll results. Click it one to spawn a die that is then rolled, click it again before it rolls the first die and it will spawn a second then roll both.

You can change what type of die it rolls and how it works without any scripting or modeling knowledge. The image you see on the tool is a DECAL, so you can also swap out new images onto the tool without needing to edit the object's texture (although you still could).

MODIFIABLE FEATURES:
I have added new features over the previous Click Roller and Click Roller Strip models. This is probably my ultimate version. You can modify all of this stuff by just tweaking variables at the top of the script. Instructions are included there.
  • Setup Mode - If enabled, this will remove the clickable button from the tool and spawn some "display" icons to show you where the dice are going to be spawned. Use this mode while setting up your tool if you like, and especially if you need to change/remove the decal on it.
  • Die Placement - You can set how far from the tool the dice are spawned. You can select how long of an arc they are spawned on now too (360 degrees for all around the tool, 180 degrees so they only spawn on one side of it, etc). Not to mention how high off the table they are spawned.
  • Die Scale - The die will be spawned with the same scale as the die you put into the tool. You can, however, modify that scale with the script if you please.
  • Die Color - By default, the dice will be the color of the die that is in the tool. Or you can overwrite it so that the spawned dice will be the color of the player who clicked the button.
  • Overflow Protection - Set a max limit of dice each tool can spawn. You can also disable it and live dangerously, you mad rebel.
  • Roll Delay - How long after you click before the dice that you have spawned with clicks are rolled.
  • Automatic Cleanup - The dice can be automatically cleaned up after a roll is finished. You can set a length of time after the roll to clean them up. Alternatively, you can turn this time off. Either way, if you still have dice on the table that this tool spawned when you go to start a new roll, it will just delete them for you then.
  • Printing Options - Each roll can announce sorted results using Rotation Value if you so desire. You can print the player who did the rolling, each individual roll result and/or the total combined value. If your Rotation Values are not numbers, obviously Total will not be able to add them together. You can also choose to have the announcement font color be white or to be set to the rolling player's color.
  • Coop Mode - This mode is the biggest new feature. It allows copies of this tool to work together. Click one tool to spawn a die, then start clicking another to spawn more and the first tool is going to be synced up, waiting to roll with the second tool. Works with as many tools at once as desired. They all roll at once and then, once all dice have come to a stop, you get a single printed result. Works by color of the clicker. It can also be disabled.

FAQ:
  • How do I change the die? - On the tool, around its edge (so you don't click the button), right click. Select RESET from the context menu. Now drop your die onto the tool. It is an infinite bag, so what you are doing is replacing the contents of the bag. Don't forget to save.
  • Is there an UNDO button? - I did not include an undo button. I feel like there is so little time between the click and the roll ending, it just isn't worth it. In the same way that if you picked up too many dice and physically rolled them, you would just roll again. However, the tool can handle you deleting a die mid-roll. So if you spawn too many, you can quickly click and delete one if it fills you with joy.
  • Can I change the model? - Yes. Button placement and such may be thrown off depending on the model you use, but as long as the model/assetbundle is still set to act as an infinite bag, it should work.
  • Can I change just the texture? - Yes. This is a custom model, so you can download its texture and modify it. This would be a good way to put the image of what it is rolling if you didn't want to use a decal.
  • Do I have permission to use this in my own mod? Or release it with my own modifications? - Absolutely. I love hearing about/seeing my tools being put to good use. If possible, I do appreciate a being credited.
  • How does coop mode work if you have 2 players rolling at once? - Coop mode only links together buttons by the color of the player who is pressing them. So you can have as many players rolling at once using any number of tools. It is NOT recommended that they try rolling using the same tool at the same time. There are limits =P

KNOWN BUGS:
  • PRINTING IN COOP MODE - Right now, the last roller to have dice come to a stop while in coop mode (other rollers also being used by that player at the same time) will have its print settings used. That means if you have different rollers with different print settings, there could be a conflict. I don't really forsee it being a problem, but please leave a comment if it impacts you. Maybe I am just not thinking of any examples.
  • WON'T ANNOUNCE RESULTS - If you are using a non-standard die, it needs to have ROTATION VALUES set on it. This can be done with one of the GIZMO tools (the rotation value one). The basic idea is you are setting each side that is "UP" with what number that side represents. Once you set up the die, save the table. Now that die will remember the rotation values you set for it forever and you can put it into the tool.
  • DICE WON'T GO BACK INTO THE BAG - This tool is an infinite bag. I designed it so dice that are taken out by the script to be rolled are altered so they cannot re-enter the bag. This prevents "fall back in" problems. In other words, this is a design feature, not a bug. The script can clean up the dice for you after the roll or you can feel free to delete it yourself.
  • WEIRD RESULTS WHEN TWO PEOPLE USE THE SAME TOOL AT ONCE - This is not really designed to be used by multiple people at once. It would be possible, but would require a major redesign so I have decided to leave it out. You can just use two copies of the tool instead, one for each player.

If you like this tool and are vastly wealthy, please consider supporting my work by donating one or more wealths to me. I am not wealthy and would very much like to try it.
[www.paypal.com]
44 Comments
FizzMan 13 Apr @ 4:24pm 
How to you change the decal image for the dice?
Duke Blitzein 11 Mar @ 10:16am 
After I reset the dice roller and add a die how do stop the dice from falling into it?
MU/TH/UR 17 Dec, 2022 @ 11:13am 
Hi, "if you need to change/remove the decal on it." I cannot figure out how to change decal in setup mode. Help anyone?
Zabi 20 Aug, 2022 @ 8:24pm 
Same question as the one [NS] zu Pferd asked before, any way to make the dice rolled, at least by the Game Master, to not be announced to the rest of the table?

It could help a lot in my D&D sessions.

Thanks for creating this mod, is awesome.
Groovebot 4 Apr, 2022 @ 1:10pm 
This mod is brilliant and is almost exactly what I need for the game I'm working on.

Is there a way to bypass the cleanupDice() function and have rollInProgress still get set back to false? I'm looking for a version of this that doesn't ever clean up the dice, basically.
Rebe 21 Jan, 2022 @ 11:01am 
Ceigar

noone forces you to use this tool, get a grip lol
{†k£r$} Kill Biu Goiaba 11 Nov, 2021 @ 4:02pm 
Can i add a custom die like the one on betrayal at the house on the hill?
Happy Wanderer 25 Feb, 2021 @ 2:03pm 
...a brilliant mod Mr. stump...thank you!
JJ.Sch 20 Dec, 2020 @ 10:43am 
Hello MeStump! I changed the die as described. Unfortunately I always get a script error!

Error in Script (Click Roller Universal - 64e216) function <startLuaCoroutine/coroutine_monitorDice>: Object reference not set to an instance of an object !

What am I doing wrong? I'm slowly overwhelmed!
Udspoon 7 Sep, 2020 @ 3:35am 
Hey tanks for this awsome mod!
Is there a way to add the custom values to print in total? Were playing middara and the dice have some icons (star, shild, skull and book) The individual printing works fine, only the total dosnt work. There it counts only the num values but ignores the symbols.