Visual Dice Rolling Overlay v3.x

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

Current v3.x Controls
Spoiler
ImageImage
Here is a short intro video example
https://1drv.ms/v/s!Al6_vh5ZO29wgXHaXSS ... 6?e=ggU7yS

Here is a video of two players rolling 20 die each across a network
https://1drv.ms/v/s!Al6_vh5ZO29wgXAf9BO ... B?e=rwTlqG

Most current updates will be here:
https://1drv.ms/u/s!Al6_vh5ZO29wgWg0Kk2 ... z?e=f4x3lJ
Here are two maps files
https://1drv.ms/u/s!Al6_vh5ZO29wgghlq3q ... i?e=e4dbLO
- maclud
- gunnarskeep
They contain the die sets current to 6/28

This has not been regression tested and I would appreciate any feedback.

Revision History
Spoiler
rev3.5.6
- fixed bug in die size setting

rev3.5.5
- add some inline code comments
- code cleanup

rev3.5.3
- Removed DiceOverlayLastRoll
- populate "lastroll" json value in users json
- Minor code cleanups

rev3.5.2
- Fixed type in rollDice to use the chosen table

rev3.5.1
- reverted back to multiple tables
- major changes to rollDO UDF
- added Die Table importer
- too many others to mention

rev3.4.6
- added bonus options to rollDO (+- # over die) and return
- added 6 new dies sets from maclud
- added 5 new die sets from gunnarskeep
- changed RollAnimation UDF to rollDO UDF to integrate into macros
- added overlap checks so if there is space it won't overlap
- added bouncy affect
- changed the config options a bit (removed field, added "selected" option)
- added chat output delay so die finish before output is shown
Attachments
Lib_DiceOverlay v3.5.6.rptok
Main Token - Lib Token with macros
(116.78 KiB) Not downloaded yet
Lib_Die Importer v1.5.5.rptok
Token - Lib Token with macros to import die sets
(57.12 KiB) Not downloaded yet
DO_Controls v3.5.1.mttable
Table - Controls and Coin images (required)
(1.17 MiB) Downloaded 1 time
DO_DefaultDice v3.5.1.mttable
Table - Set of 6 Default dice to start with
(6.9 MiB) Downloaded 1 time
Last edited by Jmr3366 on Wed Jun 29, 2022 11:01 am, edited 25 times in total.

User avatar
Full Bleed
Demigod
Posts: 4702
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Visual Dice Rolling Overlay

Post by Full Bleed »

I got a chance to play with this and it was cool... 8) Nice work!

If I may offer some suggestions:

1) Add a check box in settings to "Show Field" that will drop a transparent background over the area that the dice will roll in. It will help setting up the field... the "Location of the Overlay" and "Throw and Field" numbers just won't/don't mean a lot to most people.

2) The chat output doesn't work well on dark themes. You should probably wrap the output in something that will be theme independent.

3) Would have a more pleasing effect if the blurry sprite spin effect would not have a constant speed (that is, if it would incrementally slow down through the animation.)

4) Any plans for sound? This guy's dice roller might have some sounds you could use: http://dnd.majorsplace.com/dicex/index.html
You can see how he builds up his rolling effects using small sound files. His files are located here: http://dnd.majorsplace.com/?dir=dicex%2Fsounds%2F

5) It would be nice to have more functions that will make using this plug-and-play for existing frameworks. In particular, being able to execute a single call that determines all the dice that will be thrown in the animation, dice color, the field for that particular throw (default or custom), and predetermined or random results of the rolls. That way the animation can be added to existing setups in the least painful way possible.

Anyway, just a few ideas off the top...

Thanks for sharing!
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay

Post by Jmr3366 »

Full Bleed wrote:
Fri Apr 15, 2022 5:20 am
1) Add a check box in settings to "Show Field" that will drop a transparent background over the area that the dice will roll in. It will help setting up the field... the "Location of the Overlay" and "Throw and Field" numbers just won't/don't mean a lot to most people.
I like this idea and will try to implement it. I was debating on having like 8 predefined locations on the top and left frame. I'll try to do some sort of drag drop thing but we'll see.
Full Bleed wrote:
Fri Apr 15, 2022 5:20 am
2) The chat output doesn't work well on dark themes. You should probably wrap the output in something that will be theme independent.
Simple enough . . .
Full Bleed wrote:
Fri Apr 15, 2022 5:20 am
3) Would have a more pleasing effect if the blurry sprite spin effect would not have a constant speed (that is, if it would incrementally slow down through the animation.)
There is a variable for length of spin so the further from 0 or source of throw, the longer it spins, short throws spin .5s. I am not aware of a way to slow mid spin though. I'll hit up bubblobill for some ideas here :p
Full Bleed wrote:
Fri Apr 15, 2022 5:20 am
4) Any plans for sound? This guy's dice roller might have some sounds you could use: http://dnd.majorsplace.com/dicex/index.html
You can see how he builds up his rolling effects using small sound files. His files are located here: http://dnd.majorsplace.com/?dir=dicex%2Fsounds%2F
Yes I have thought of them but I've not touched sound "audio" in MT yet. I will take a look and work to do something as it would bring more flair :).
Full Bleed wrote:
Fri Apr 15, 2022 5:20 am
5) It would be nice to have more functions that will make using this plug-and-play for existing frameworks. In particular, being able to execute a single call that determines all the dice that will be thrown in the animation, dice color, the field for that particular throw (default or custom), and predetermined or random results of the rolls. That way the animation can be added to existing setups in the least painful way possible.
Some syntax examples would be helpful. It would not be too much to add an input (like macro("[email protected]:DiceOverlay"):{"1":"D2:1","2":"D2:2","3":"D2:1","4":"D2:2","5":"D2:2"} (but include the color (like the chat output). Is something like that "in scope" of your thought?

User avatar
Full Bleed
Demigod
Posts: 4702
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Visual Dice Rolling Overlay

Post by Full Bleed »

Jmr3366 wrote:
Fri Apr 15, 2022 8:04 am
I like this idea and will try to implement it. I was debating on having like 8 predefined locations on the top and left frame. I'll try to do some sort of drag drop thing but we'll see.
Having some predefined options would be nice and probably cover most situations. I think a percentage setting would probably be more intuitive, too (given that the size of most people's viewports will vary based on the layouts they are using.)

And being able to set that per throw, might also be useful.
Yes I have thought of them but I've not touched sound "audio" in MT yet. I will take a look and work to do something as it would bring more flair :).
Hopefully the links I posted will help building something decent. MT has to pull sound remotely, so it's not as intuitive to build this type of thing...
Some syntax examples would be helpful. It would not be too much to add an input (like macro("[email protected]:DiceOverlay"):{"1":"D2:1","2":"D2:2","3":"D2:1","4":"D2:2","5":"D2:2"} (but include the color (like the chat output). Is something like that "in scope" of your thought?
I'd like to see a simple string based udf:

dieType
dieColor (no parameter could equal default)
dieCount (no parameter could equal 1 die)
dieResults (0 or no parameter = random)
dieField (x percentage by y percentage)

So, some examples:

[h: rollAnimation("d4")]
[h: rollAnimation("d6", "green")]
[h: rollAnimation("d8", "red", 2)]
[h: rollAnimation("d10", "amber", 3, "6,3,9")]
[h: rollAnimation("d20", "charcoal", 2, "5,10", "100, 50")]

For ease of use I think something like that is about as simple as it gets.

Edit: Made some minor mods. I was initially using "output" instead of "results" and r: or h: to indicate whether or not there would be chat output... but that isn't the best idea because you might still want to generate random results and use you own custom output. So, in general, I'd say that this function should not have chat output and "results" woud determine whether the function returned anything in the call (0 or none set would return the rolls, otherwise the results are known.)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay

Post by Jmr3366 »

Full Bleed wrote:
Sat Apr 16, 2022 4:24 am

dieType
dieColor (no parameter could equal default)
dieCount (no parameter could equal 1 die)
dieSize (0 or no parameter = default)
Full Bleed wrote:
Sat Apr 16, 2022 4:24 am
dieResults (0 or no parameter = random)
dieField (x percentage by y percentage)
Example:
rollAnimation("D20","amber","2","3","13,18","50,50")
I'll give this a go and see where it lands . . .

I was also thinking about having some way to explode them (reverend had mentioned it), but it would have to be via a click (example a button by the chat output when a 20 is rolled, or maybe something fancy by making the d20 become a button...) and then replacing the same overlay. I don't know if this would work in an acceptable way (I've never played with exploding dice)

EDIT
I'll take that formatting point and put it at the end, I'll keep editing this part until we conclude the syntax

rollAnimation ("1d20,4d6","amber,red","18,2,4,3,6","3","50,50")

I'm thinking this way will allow for more die types during the roll...
Last edited by Jmr3366 on Sat Apr 16, 2022 12:51 pm, edited 2 times in total.

User avatar
Full Bleed
Demigod
Posts: 4702
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Visual Dice Rolling Overlay

Post by Full Bleed »

Jmr3366 wrote:
Sat Apr 16, 2022 10:38 am
Example:
rollAnimation("D20","amber","2","3","13,18","50,50")
Good call on a size paremeter... though I'd put it after results since it a format thing.
I was also thinking about having some way to explode them (reverend had mentioned it), but it would have to be via a click (example a button by the chat output when a 20 is rolled, or maybe something fancy by making the d20 become a button...) and then replacing the same overlay. I don't know if this would work in an acceptable way (I've never played with exploding dice)
I might give that type of die its own function like rollAnimationExplode()... and then have an "explode" overlay over the existing output when triggered. Would be cool if the exploded die rolled out of the die that exploded though. ;)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay

Post by Jmr3366 »

Updated to rev1.5

Needs testing and feedback

rev1.5
- Added RollAnimation UDF
- Added background to chat output for easier reading in darkmode

rev1.4
- Tweaked Coin image (green side)
- removed flash that can occur after a clear
- CloseDice actually closes ALL your dice
- cleaned up code a bit
- added code to allow for variable on animation timing

RollAnimation UDF example:

RollAnimation("1d20,3d6","18,3,2,6","amber,blue","1.5","250,250")]
Image

pseudo syntax
RollAnimation("{die count}d{die faces},{..}","{die color},{..}","{die result},{..}","{die size}","{die field X in pixels},{die field Y in pixels}")

maclud
Kobold
Posts: 11
Joined: Tue Jun 21, 2022 8:32 pm

Re: Visual Dice Rolling Overlay v3.x

Post by maclud »

this is awesome! I reallyyy like this thing :D

I dont know if this will be possible or not .... but anyway, since I had some time to waste during the last couple of days, I started working on "more" dice for fun (files example and everything zipped there>>> https://drive.google.com/drive/folders/ ... k-E9rANSIU - not finished, not readable enough, lack of shadows, etc. Im just testing for now )

my question are :
1- would it be possible to load additionnal tables instead of putting everything into a big one? (was thinking of making multiple dice for different "theme" .. cthulhu, medfan, cyber etc..)
2- is there, by any chance, a way to make tables without droping EACH dice file in it one by one manually ? (sorry Im actually new to maptool, I dont get everything yet... but I dont feel like doing this for 400/500 dice images...)
3- if the only solution is to generate the mttables "manually" (make folder, generate IDs, create additional file for each pic, generate content.xml and zip everything to .mttable ... is there already a script somewhere for helping this task ? or should I code my own thing ?)
4- I cant find in your macros where you hide the dice "list" for the differents colors name and the corresponding table index values... if I want for example to add more items to the table? (is there one ? does the code just scan the table randomly ? or is it just getting each image by a predetermined table index value?)

I hope my question are not unclear :oops:

anyway... thanks again, this is a great addon to maptool!!!

User avatar
Full Bleed
Demigod
Posts: 4702
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Visual Dice Rolling Overlay v3.x

Post by Full Bleed »

maclud wrote:
Wed Jun 22, 2022 12:07 am
I dont know if this will be possible or not .... but anyway, since I had some time to waste during the last couple of days, I started working on "more" dice for fun (files example and everything zipped there>>> https://drive.google.com/drive/folders/ ... k-E9rANSIU - not finished, not readable enough, lack of shadows, etc. Im just testing for now )
I like your dice. I hope you finish producing sets.

Check out this link to see some discussion of dice images and see some of the new sets being made: viewtopic.php?f=8&t=29377
2- is there, by any chance, a way to make tables without droping EACH dice file in it one by one manually ? (sorry Im actually new to maptool, I dont get everything yet... but I dont feel like doing this for 400/500 dice images...)
I put up some code here to make getting sets into tables easier: viewtopic.php?f=8&t=29377&start=15#p279093
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

maclud
Kobold
Posts: 11
Joined: Tue Jun 21, 2022 8:32 pm

Re: Visual Dice Rolling Overlay v3.x

Post by maclud »

[/quote]
I put up some code here to make getting sets into tables easier: viewtopic.php?f=8&t=29377&start=15#p279093
[/quote]

woot! exactly what I needed ! thanks a lot, will post my stuff when they are finished in the other thread. :D

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

maclud wrote:
Wed Jun 22, 2022 12:07 am
this is awesome! I reallyyy like this thing :D
Thanks, it's always appreciated :)
maclud wrote:
Wed Jun 22, 2022 12:07 am
I dont know if this will be possible or not .... but anyway, since I had some time to waste during the last couple of days, I started working on "more" dice for fun (files example and everything zipped there>>> https://drive.google.com/drive/folders/ ... k-E9rANSIU - not finished, not readable enough, lack of shadows, etc. Im just testing for now )
I agree with Full Bleed that these are looking nice, if there are done sets in the zip file that I find. I'll try to make time and throw together / share the gimp files I use.
maclud wrote:
Wed Jun 22, 2022 12:07 am
my question are :
1- would it be possible to load additionnal tables instead of putting everything into a big one? (was thinking of making multiple dice for different "theme" .. cthulhu, medfan, cyber etc..)
Yes, and that seems like a good feature / option I can add: reading from a chosen table(s).
maclud wrote:
Wed Jun 22, 2022 12:07 am
2- is there, by any chance, a way to make tables without droping EACH dice file in it one by one manually ? (sorry Im actually new to maptool, I dont get everything yet... but I dont feel like doing this for 400/500 dice images...)
3- if the only solution is to generate the mttables "manually" (make folder, generate IDs, create additional file for each pic, generate content.xml and zip everything to .mttable ... is there already a script somewhere for helping this task ? or should I code my own thing ?)
I started with Full Bleeds and ended up making my own.
maclud wrote:
Wed Jun 22, 2022 12:07 am
4- I cant find in your macros where you hide the dice "list" for the differents colors name and the corresponding table index values... if I want for example to add more items to the table? (is there one ? does the code just scan the table randomly ? or is it just getting each image by a predetermined table index value?)
Yeah, I hear you and the variables I used aren't so clear, sorry. In rev3.3 I broke out the code a bit more so you can see it better.
The only random (roll) is the die value and the destination x,y. The die value and your color preference drives the rest
The table is set up so each block of 100 is a new set of die, I have some reservations regarding the spritesheets, controls, the coin, and a few others.

Jmr3366
Cave Troll
Posts: 27
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

maclud wrote:
Wed Jun 22, 2022 12:07 am
I've taken a look and you've got the sprite sheets and all done, very nice!!.
I'll try to convert my "table maker" macro into something that takes inputs: table name, dice name, dice image name, etc.

EDIT
I will use the webp files but I noticed the Galaxy set was missing from there.
I think a few sprite sheets may need a little touchup I'll do (slight offset).
If I can find the time in the next few days I can have an update with a new table for your very nice dice

User avatar
Full Bleed
Demigod
Posts: 4702
Joined: Sun Feb 25, 2007 11:53 am
Location: MD
Contact:

Re: Visual Dice Rolling Overlay v3.x

Post by Full Bleed »

maclud wrote:
Wed Jun 22, 2022 10:00 am
woot! exactly what I needed ! thanks a lot, will post my stuff when they are finished in the other thread. :D
Hope it helps.

Any chance you can produce these at higher resolution (480x480)? Would be nice if they were more 4K friendly.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

maclud
Kobold
Posts: 11
Joined: Tue Jun 21, 2022 8:32 pm

Re: Visual Dice Rolling Overlay v3.x

Post by maclud »

annddd... there you go...
did some retouch, those one should be better than the previous tests but I'm still not happy with the shadows (

https://drive.google.com/drive/folders/ ... sp=sharing

converted to webm 120px and 480px... added the blurry ss files in the 120px folder.

ENJOY!
Attachments
maclud-1-batch.jpg
maclud-1-batch.jpg (137.01 KiB) Viewed 38 times
Last edited by maclud on Sat Jun 25, 2022 8:39 pm, edited 1 time in total.

maclud
Kobold
Posts: 11
Joined: Tue Jun 21, 2022 8:32 pm

Re: Visual Dice Rolling Overlay v3.x

Post by maclud »

Jmr3366 wrote:
Wed Jun 22, 2022 5:20 pm
Yeah, I hear you and the variables I used aren't so clear, sorry. In rev3.3 I broke out the code a bit more so you can see it better.
The only random (roll) is the die value and the destination x,y. The die value and your color preference drives the rest
The table is set up so each block of 100 is a new set of die, I have some reservations regarding the spritesheets, controls, the coin, and a few others.
yes I kinda figured out the 100 block size and reservations but wasnt sure about the rest of the list ;) thanks.
I tried to stick to the graphic part this week and didnt have time for coding (but if you like my dice 'll maybe just wait and let you do the work lol)
Jmr3366 wrote:
Wed Jun 22, 2022 5:20 pm
I agree with Full Bleed that these are looking nice, if there are done sets in the zip file that I find. I'll try to make time and throw together / share the gimp files I use.
I think i found somewhere a gimp file of yours where everything is on a "grid" ... would that help if I compose mine the same way next time ?
Jmr3366 wrote:
Wed Jun 22, 2022 9:21 pm
I've taken a look and you've got the sprite sheets and all done, very nice!!.
I'll try to convert my "table maker" macro into something that takes inputs: table name, dice name, dice image name, etc.
that would be awesome!
Jmr3366 wrote:
Wed Jun 22, 2022 9:21 pm
I will use the webp files but I noticed the Galaxy set was missing from there.
I think a few sprite sheets may need a little touchup I'll do (slight offset).
If I can find the time in the next few days I can have an update with a new table for your very nice dice
yes sorry the one I made earlier this week were not great and I couldnt find an easy way to rename/convert to webp at the time ...
could you point out exactly which sprite seems offsetted? I ll try to align everything properly if needed next time..

also, I tweaked your macro a little last week and added an option for rolling the dice with "bonus" added to the result (sending 0 as an argument if no bonus is send) and show some critical hit and fail text in the chat window. also added a simple script button for removing the other people dice (because my players just cant remind themselves to do so on their own)...

next question is : would it be possible - in the futur - to add an option for "explosive" dice (re-roll every max roll). like, saving the result temporarly, re-roll a second dice on the board without erasing the first one (this I guess is not doable).. and adding its value to the final result ?
Last edited by maclud on Sat Jun 25, 2022 9:37 pm, edited 1 time in total.

Post Reply

Return to “User Creations”