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: 81
Joined: Fri Feb 04, 2022 1:08 pm

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

Those are good ideas.
I'll keep them in mind for the upcoming version.

If you follow this link (from first post):
https://1drv.ms/u/s!Al6_vh5ZO29wgWg0Kk2 ... z?e=f4x3lJ
There is a dev folder.
I copied up a new 3.8c2 campaign file that has a very much beta version.
rollDO is broken as I'm attempting to restructure some of the code to allow sci-fi die or other die sets without having to do another rewrite.

I'm also wanting to use the MT standard syntax for rolling die (and that will take a rewrite of rollDO anyway)

The exciting part, if your up for poking around, is the backgrounds.
Right now it's hard set with a firework background on exploded die.

Under the backgrounds map, using the GM panel, you can pull up the backgrounds selector (this is where I got distracted with Lib:Slide).

I need to rewrite RollDice and at nearly 600 lines, a bitter pill indeed LOL

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 »

i've been keeping an eye on this but what really peaked my interest was this:
What I've started and not finished
- RollAnimation is being changed to rollDO with a new syntax and now feeding into RollDice
rollDO("{die number}d{die faces}{die bonus},{..}","{die result},{..}","{die color},{..}","{die size})
[r: rollDO("2d20:18:18,2d6:4:3","Plastic Amber,Metalic Green","2")]<br>
[r: rollDO("2d20,1d8,2d6","Plastic Red,Plastic Green, Plastic Plum")]<br>
[r: rollDO("2d20,10d6")]
[r: rollDO("1d20+4,2d6-2")]
macro.result output is a string syntaxed: {roll num}:{die}:{value},{..}
example: 1:D20:5,2:D20:6
do i get it correctly that that function can be used to emulate a result that has already been rolled? Cause that would mean it would be REALLY easy to implement that in a standing framework. Just add the rolldo after the result has been rolled. Im mainly interested in d100 rolls (2d10's ) (cthulhu) how would that work with this?
To make a stab at this initially I could use:

Code: Select all

[d1 = 1d10]
[d10 = 1d10]
[r: rollDO("2d10:"+d1+":"+d10+","Plastic Amber,Metalic Green","2")]
(please correct me if im wrong)
it would however be nice to have a different die for the d10 (10,20,30,40 as face), I guess this could already be achieved by adding some die faces so you would have 'Plastic Amber' and 'Plastic Amber 10' or something in that direction. Is that already possible?

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 7:30 am
i've been keeping an eye on this but what really peaked my interest was this:

To make a stab at this initially I could use:

Code: Select all

[d1 = 1d10]
[d10 = 1d10]
[r: rollDO("2d10:"+d1+":"+d10+","Plastic Amber,Metalic Green","2")]
(please correct me if im wrong)
it would however be nice to have a different die for the d10 (10,20,30,40 as face), I guess this could already be achieved by adding some die faces so you would have 'Plastic Amber' and 'Plastic Amber 10' or something in that direction. Is that already possible?
Yes, that is the intent.
Some of what you said is already possible :)

[r: rollDO("2d10:"+d1+":"+d10+","Plastic Amber,Metalic Green","2")]
This would
roll 1 d10 resulting in d1 value, amber die
roll 1 d10 resulting in d10 value, green die

I'm not sure I'm following the last question tho re: different die for the d10?
Can you elaborate?

Future syntax will allow custom backdrops so attack, heal, etc can be set with custom die color and/or a custom backdrop.
Not certain how close the future is right now though :)

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 »

what i mean is that ideally you have one d10 die with the faces:
1,2,3,4,5,6.... (normal d10 die)
and one d10 with the faces
10,20,30,40,50,50,... (the special d10 die, e.g. designated as 'amber plastid 10' or something similar but smarter :D)

alternative you could name them differently: d10 and d100 where d10 would be single and d100 double digit d10), this would make the above syntax:

[r: rollDO("1d100:"+d10+"1d10:"+d1+","Plastic Amber,Metalic Green","2")]

resulting in a plastic amber die with e.g. '40' and a metalic green die with '2', for a '42' die result

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 9:52 am
alternative you could name them differently: d10 and d100 where d10 would be single and d100 double digit d10), this would make the above syntax:

[r: rollDO("1d100:"+d10+"1d10:"+d1+","Plastic Amber,Metalic Green","2")]

resulting in a plastic amber die with e.g. '40' and a metalic green die with '2', for a '42' die result
I'd say that's right: to pull off a percentile roll with the "10s" as one color die and the "1s" as a different color, you'll want a new die with the faces "10","20","30",..."00" Calling it a d100 makes sense. I think 100 images for a real 1d100 would be a stretch.
As of the last build I tested, you will only get 1 color per die type when making a roll via macro command.

Note, the Drop-In takes 3 strings for the way you're rolling:
[rollDO(String1 for rolling, String 2 for colors, string 3 for size.)]
so your roll would actually be:
[r: rollDO("1d100:"+d10+"1d10:"+d1,"Plastic Amber,Metalic Green","2")]

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 »

hmm just started testing the drop in and everything appears to be working. however the function does nothing:

Code: Select all

[r:dd1 = 1d10]
[r:dd10 = 1d10]
[r: rollDO("1d10:"+dd10+"1d10:"+dd1,"Plastic Amber,Metalic Green","2")]
results in 1 4 in the chat, but nothing is rolled on screen. Anything im doing wrong?

(edit: changed vars to dd10 cause they didnt' work correctly. still nothing on screen though)

edit2: appears to be a bug, if i change the example udf:

Code: Select all

[h: broadcast(rollDO("2d20+5:15:3,1d6+4","plastic red,plastic blue","2"),"all")]
to

Code: Select all

[h: broadcast(rollDO("2d10+5:5:3,1d6+4","plastic red,plastic blue","2"),"all")]]
it fails to work (only rolls one d10)
if i further change this to eg:

Code: Select all

[h: broadcast(rollDO("1d6:5,1d6+4:3","plastic red,plastic blue","1"),"all")]
i get
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.math.BigDecimal (java.lang.String and java.math.BigDecimal are in module java.base of loader 'bootstrap') error executing expression tDRoll = if(tDRoll,tDRoll,roll(6)).
Error trace : RollDice@Lib:DiceOverlay <<< rollDO@Lib:DiceOverlay <<< Example UDF@Lib:DiceOverlay

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 11:06 am
hmm just started testing the drop in and everything appears to be working. however the function does nothing:

Code: Select all

[r:dd1 = 1d10]
[r:dd10 = 1d10]
[r: rollDO("1d10:"+dd10+"1d10:"+dd1,"Plastic Amber,Metalic Green","2")]
results in 1 4 in the chat, but nothing is rolled on screen. Anything im doing wrong?

(edit: changed vars to dd10 cause they didnt' work correctly. still nothing on screen though)
It could be how I've parsed the inbound string.
If you loaded all of that into a variable
tVar = "1d10:"+dd10+"1d10:"+dd1]
[r: rollDO(tVar,"Plastic Amber,Metalic Green","2")]

I didn't include the d100 as on first concept I was looking to include two favorite colors a primary and secondary (you can see some of this referenced in the code but it's not used) and wanted to keep the roller smaller.
My backup was to use the roll number (eg. roll 1 is die 1, roll 2 is die 2)
2 d10 is the same as 1d100 and 1d10, depending how you do the math :)

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 11:06 am
edit2: appears to be a bug, if i change the example udf:

Code: Select all

[h: broadcast(rollDO("2d20+5:15:3,1d6+4","plastic red,plastic blue","2"),"all")]
to

Code: Select all

[h: broadcast(rollDO("2d10+5:5:3,1d6+4","plastic red,plastic blue","2"),"all")]]
it fails to work (only rolls one d10)
if i further change this to eg:

Code: Select all

[h: broadcast(rollDO("1d6:5,1d6+4:3","plastic red,plastic blue","1"),"all")]
i get
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.math.BigDecimal (java.lang.String and java.math.BigDecimal are in module java.base of loader 'bootstrap') error executing expression tDRoll = if(tDRoll,tDRoll,roll(6)).
Error trace : RollDice@Lib:DiceOverlay <<< rollDO@Lib:DiceOverlay <<< Example UDF@Lib:DiceOverlay
I think it breaks because it doesn't like the same die-type entered twice.

As for your second example, it works for me.
Mind you, I wasn't able to rollDO 1d10s till I fixed it (I think I broke it first)
Also, I now roll colors properly. Again I fixed something I may have broken.

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 »

do you have a new version to download? i used the files attached to the op

edit, k found version 8.2c and that worked better but i still get a java error with this:

[h: rollDO("1d10:5,1d6:4","plastic red,plastic blue","2")]

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 12:24 pm
do you have a new version to download? i used the files attached to the op
Doesn't look like a new one is up since I DL'd it recently. You should have the same version I do assuming you just grabbed it -minus the changes I made to my copy. I'd offer my copy, though, again, I have been messing with it.

Edit: Wow, I have version 3.5.6 Guess I'm behind. though I ran
[h: rollDO("1d10:5,1d6:4","plastic red,plastic blue","2")]
-and it worked fine.

Edit edit: wait 8.2c? I must be looking at something else for the version

Edit edit edit:
Are you having an issue when you make two "Result" assignments in a row for two Die Types? Because I had that and fixed it. (my first post in this thread)

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

If you're using anything from my dev folder(s) it would be a buyer beware experience :)


EDIT
Your best bet is to pull down the "DiceOverlay v3.7.3 wAllDice.cmpgn" file

That should be the current "most stable" code.

The dev folder has one day eventually "product".

EDIT
from the 3.7.3 version
[r: rollDO("2d10:8:5","plastic red, plastic green","1")]
will work but "green" is ignored.
The syntax will not allow two entries of the same die so you can't "1d10:5, 1d10:8" or it will puke like Wolph shown.
There is likely a bug where I'm not rolling to the next color or could it be, how to handle the options
Likely this is were re-write comes in as organic growth pushed beyond the core code :( (e.g. need to allow more than 1 die type entry of the same kind, or some other flag to show when to roll to the next color, and then make the code for it :p )

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 »

ok versio 3.7.3

[h: rollDO("1d10:5,1d6:4","plastic red,plastic blue","2")]

renders

java.lang.ClassCastException error executing expression tDRoll = if(tDRoll,tDRoll,roll(6)).
Error trace : RollDice@Lib:DiceOverlay <<< rollDO@Lib:DiceOverlay <<< test@Lib:DiceOverlay

ah copy paste fu. you're right:
[r: rollDO("2d10:8:5","plastic red, plastic green","1")]
works but green is ignored which makes sense cause theres only one entry.

Adding 1d6 you get green as well:
[r: rollDO("2d10:8:5, 1d6","plastic red, plastic green","1")]

but as expected, adding a result:
[r: rollDO("2d10:8:5, 1d6:3","plastic red, plastic green","1")]
renders the above error!

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 »

it appears you have forgotten to reset rdResCnt so it keeps adding even when you move to the next die set

it becomes clear when adding some debug info:
oDie: 2d10:8:5
oDie: 1d6:3
redeslist: 8:5
rdResCnt: 1
tDRoll: 8
redeslist: 8:5
rdResCnt: 2
tDRoll: 5
redeslist: 3
rdResCnt: 3
tDRoll:
java.lang.ClassCastException error executing expression tDRoll = if(tDRoll,tDRoll,roll(6)).
Error trace : RollDice@Lib:DiceOverlay <<< rollDO@Lib:DiceOverlay <<< test@Lib:DiceOverlay
im trying to find the reset point but im having trouble getting through the latter part of the code, so perhaps you can find and update that

ok fixed it for now by adding:

[h: rdResCnt = if(oldResList==rdResList,rdResCnt,0)]
[h: oldResList = rdResList]

and initializing oldResList outside the while loop. That worked

edit2:
found the other bug as well. This

Code: Select all

[r: rollDO("2d10:8:5, 1d10:4","plastic red, plastic green","1")]
renders this:
rdResultList: {"d2":"","d4":"","d6":"","d8":"","d10":4,"d12":"","d20":""}
and it should be
rdResultList: {"d2":"","d4":"","d6":"","d8":"","d10"8:5:4,"d12":"","d20":""}
but i can see that would be rather cumbersome to create, so the alternative would indeed be to have the dice colors working. for each individual die.

so that boils down to get this to work:

Code: Select all

[r: rollDO("2d10:8:5","plastic red, plastic green","1")]
which currently only uses the plastic red

edit3: it appears that that too is getting more clear, using this

Code: Select all

[r: rollDO("2d10:8:5","plastic red, plastic green","1")]
you get:
rdColorList: plastic red, plastic red
which i've so far traced back to tparce who has this also, so the error is made in rollD0, wrong argument is passed on

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

Re: Visual Dice Rolling Overlay v3.x

Post by Jmr3366 »

This is with the updates from Longshot.
First couple tests seemed to work

[r: rollDO("2d10:8:5, 2d6:3:4","plastic red, plastic green","1")]

Works :)

EDIT
Put a copy up on onedrive too.
Attachments
Lib_DiceOverlay v3.7.3.1.rptok
New LibToken
(70.89 KiB) Downloaded 44 times

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 »

yeah i already fixed that part. working on the colors now, which are also faulty.

[r: rollDO("2d10:8:5","plastic red, plastic green","1")]

passes plastic red twice as argument, which it shouldn't

I understand why that choice was made though and the fix is REALLY simple but that would be a choice

here's the fix:
replace

Code: Select all

[h: macroArgs = "rolldo^"+rdResultList+"~"+rdBonusList+"~"+rdColorList+"~"+rSize+"~"+jDiceOrder+"^"+jDice
with

Code: Select all

[h: macroArgs = "rolldo^"+rdResultList+"~"+rdBonusList+"~"+iColor+"~"+rSize+"~"+jDiceOrder+"^"+jDice]
the original intent was to have the color codes per dice set not per die.

btw setting an exploding die and then with:
[r: rollDO("2d10:8:10","plastic red, plastic green","1")]
i again get an error!

Post Reply

Return to “User Creations”