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

Longshot
Giant
Posts: 117
Joined: Tue Feb 22, 2011 8:59 am
Location: Honolulu, Hi.

Re: Visual Dice Rolling Overlay v3.x

Post by Longshot »

wolph42 wrote:
Wed Oct 12, 2022 2:05 pm
it appears you have forgotten to reset rdResCnt so it keeps adding even when you move to the next die set
Ah, bummer. That was the thing I fixed in my previous post. Nice job though :)
wolph42 wrote:
Wed Oct 12, 2022 2:05 pm
so the alternative would indeed be to have the dice colors working. for each individual die.
For each color working on each die, you could try changing below in the RollDice macro from:

Code: Select all

         }]
         [h: totalDie = totalDie - 1]
    }]
to:

Code: Select all

              [h: totalDie = totalDie - 1]
              }]
        }]
That is, move it up one level in the loop. Worked for me.

*edit: Hope wolph42 sees this before burning too many calories working on a fix
Last edited by Longshot on Wed Oct 12, 2022 3:15 pm, edited 1 time in total.

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

@wolph42 You'd have the skill to mod it with that option, even including that in the config macro and respective JSONs because I KNOW what you're capable of :twisted:

But there's easy too :wink:

@both, please carry on and when done I'll circle back to update it hehehe

EDIT
point being that if there are optional things that should be optional, lets make them that way.

Should I release the sci-fi die roller as a standalone Lib (it doesn't have all the features since it's sci-fi die)?
My hold-off has been wanting to integrate them both as one but maybe that's not reasonable / needed / wanted?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Visual Dice Rolling Overlay v3.x

Post by wolph42 »

Longshot wrote:
Wed Oct 12, 2022 3:09 pm
*edit: Hope wolph42 sees this before burning too many calories working on a fix
well as said: i fixed that one too. and yes it can be made optional but that would make for a rather weird udf or it would require extending the settings which is a bit too much for me

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Visual Dice Rolling Overlay v3.x

Post by wolph42 »

so another question. if your just using the udf there is no clear immediate way to remove the dice from the screen (or perhaps just close the overlay).
Hence two questions:

1. what function can i call to remove the dice from screen
2. it would be a nice feature if there is a timer running in the back and the dice are removed after say 10s or so automatically!

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

wolph42 wrote:
Wed Oct 12, 2022 5:43 pm
so another question. if your just using the udf there is no clear immediate way to remove the dice from the screen (or perhaps just close the overlay).
Hence two questions:

1. what function can i call to remove the dice from screen
[macro("ClearDice@Lib:DiceOverlay"):""]

you know how things go with timers and I'm not going there
The delay you see from roll to chat is a busy macrolink loop

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Visual Dice Rolling Overlay v3.x

Post by Full Bleed »

You don't have to use some fancy timers to fade it out...

Here is a snippet of what I'm using in my my much simpler animated roller to fade out the images on the screen (and then I make the die clickable to go away.)

I think you guys could adapt the fade out portion of this pretty easily:

CSS

Code: Select all

.elementToFadeOut {
	animation: fadeout 10s linear 1 forwards;
}
		
@keyframes fadeout {
	0% {opacity: 1;}
	70%  {opacity: 0.99;}
	100% {opacity: 0.25;}
}
Overlay Div

Code: Select all

<div class="verticalHorizontalPosition elementToFadeOut"><img src="[r: dieImage]" style="--pointermap:blockopaque;" draggable=false usemap='#dieClick'></div>
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Longshot
Giant
Posts: 117
Joined: Tue Feb 22, 2011 8:59 am
Location: Honolulu, Hi.

Re: Visual Dice Rolling Overlay v3.x

Post by Longshot »

I played with the dice in a connected session with 3 players and myself. I found that the broadcast of dice rolled created 4 copies of the formatted output which pretty much flooded the chat window.

I haven't figured out how to best control it yet. Looking at the code, I don't see any kind of place where the output is looped. Possibly, it's in the macro-link execution. I removed the text output for DO rolls so I could control the output shown when dice are auto-rolled during attacks, etc. so that is working out. I may need to do the same for rolls made through the GUI for now.

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

I will test to see if this exists in the current update I'm slowly working on.

I believe all/most of the chat output will be someplace in the Delay macro (re: where to look :) )

EDIT
Was also thinking that if you've got your chat set to all, set it to self via the config macro and see if the multi-spew still happens

Longshot
Giant
Posts: 117
Joined: Tue Feb 22, 2011 8:59 am
Location: Honolulu, Hi.

Re: Visual Dice Rolling Overlay v3.x

Post by Longshot »

I'll need to look at the Delay then.

For now, there is one output sent per user connected if "all" is used. 4 connected players, 4 repeats of the roll text.
I tried "GM, Self", and I got hit with 2 text outputs for one roll (a line per user that receives a message).

della
Cave Troll
Posts: 36
Joined: Sun Feb 24, 2019 4:48 am
Location: Belgium

Re: Visual Dice Rolling Overlay v3.x

Post by della »

Hello,
thank you for this addition.
I'm trying to link it to my character sheet, I've created a macro with 2 properties (ResultDice(ie 4d6:4:4:4:2) , ColorDice (ie plastic Charcoal)),
but I'm having some trouble.
Spoiler
<!-- Get ID of selected object -->
[h,if(hasImpersonated()): tokenId=getImpersonated();tokenId=getSelected()]
[h,if(listCount(tokenId)!=1): abort(0)]

<!-- It must be a vaid token -->
[h: cLib=startsWith(upper(getName(tokenId)),'LIB:')]
[h,if(cLib==1||getLayer(tokenId)=="OBJECT"||getLayer(tokenId)=="BACKGROUND"): abort(0)]

<!-- Check permission of token -->
[h: cPerm = if(isGM()||isOwner(getPlayerName(), tokenId), 0, 1)]
[h, if(cPerm): abort(0)]

[h: switchToken(tokenId)]

[h: broadcast(rollDO(ResultDice,ColorDice,"1"),"all")]
Sometimes the dice roll appears on the 2 screens,

Image

other times only on the caster screen.

Image

I'd also like to suppress the result in the chat (for example 1:D6:4,2:D6:4,3:D6:4,4:D6:3), and only see my personal display in the chat.


Another problem, when I modify the Example UDF macro, by [h: broadcast(rollDO("2d20+5:15:3,1d6+4:2", "plastic red,plastic blue", "2"), "all")]

Image

I get this error message in chat

Image


Thanks for your help
PS: I'm not a programmer... :oops:
Admin of the MapTool sub-forum, the JDRVirtuel community

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

I've not tested this on the newer MT versions and there were some bugs folks found when using (it needs a re-write).

The syntax you're using for broadcast is incorrect.
That looks more like an "execFunction" type call.

what part isn't broadcasting to the other players?
One of the posts above mentioned a bug where it was broadcasting multiple times for each roll . . .

Post Reply

Return to “User Creations”