PDA

View Full Version : Dice result



Xarxus
August 30th, 2023, 21:07
This is what I obtain with a 2d100 roll, one red/fumble. The plus (+) sign is wrongly positioned.
I think it happend only with d100.

LordEntrails
August 30th, 2023, 21:23
Ruleset? Extensions? Step to reproduce?

Xarxus
August 30th, 2023, 22:50
No extension, personalized ruleset.
This code
Debug.console("MESSAGE", rMessage)
Comm.deliverChatMessage(rMessage);

has this output (I divided it into several lines to show the part that I think is interested)
[8/30/2023 11:39:16 PM] s'MESSAGE' | { s'sender' = s'Xander', s'text' = s'[Check] Swim -30 difficulty', s'secret' = bFALSE, s'font' = s'systemfont', s'diemodifier' = #-30,s'dice' = {
#1 = { s'result' = #2, s'type' = s'r100' },
#2 = { s'result' = #-54, s'type' = s'd100' } },
s'icon' = s'portrait_gm_token', s'type' = s'abilitycheck' }

Moon Wizard
August 31st, 2023, 05:29
If you are talking about the "r10+0d100", this is the default behavior applied to a given roll if an dice.expr not defined. (i.e. dice are treated as having + sign; and their values are added together)

If you want a different behavior, you will need to provide the dice.expr you want to use.

Regards,
JPG

Trenloe
August 31st, 2023, 08:06
If you are talking about the "r10+0d100", this is the default behavior applied to a given roll if an dice.expr not defined. (i.e. dice are treated as having + sign; and their values are added together)

If you want a different behavior, you will need to provide the dice.expr you want to use.

Regards,
JPG
I think the problem is that r100 doesn't work properly (same for the other colored result dice 0 g100 etc.). It can be recreated in CoreRPG - use /roll 1r100 and it rolls 1r10. Use /roll r100+d100-30 and one tens die is rolled and you get similar to what's shown in post #1.

Xarxus
August 31st, 2023, 10:22
I did the test suggested by Trenloe and got this (CoreRPG, no extentions)

/roll 1d100 --> 1d100 (64)
/roll 1r100 --> 1r10 (8)
/roll 1g100 --> 1g10 (10)

Xarxus
August 31st, 2023, 10:31
Another try.

/roll 1d10+1r10+1g10 --> 10+4(red)+8(green) = 22
/roll 1d100+1r100+1g100 --> 40 and only 1 normal d100 was rolled

Moon Wizard
September 1st, 2023, 19:39
Ok, I looked into this a bit. The issue is that "r100" and "g100" are not official die types; but used as ruleset workarounds to specify colored icons in the chat window. Therefore, the client doesn't know that the r100 and g100 are percentile dice. You should not use the "colored" versions of the dice in /roll or /die commands.

There is a built-in way to set coloration on the die icons via the API, if you want to recreate something like that in your ruleset:


dice = {
{ "type" = "d100" },
{ "type" = "d100", iconcolor = "FF0000" },
{ "type" = "d100", iconcolor = "00FF00" },
expr = "1d100-1d100+1d100",
},


Regards,
JPG

Xarxus
September 2nd, 2023, 14:50
As far as I'm fine like this, it seems to me that the colors are a bit dark. I've tried
changing the hexadecimal values ​​without really being able to change the color of
the dice. At best I get shades of gray (maybe the first hex pair is the alpha channel?)

Xarxus
September 2nd, 2023, 15:11
This is the color difference between an iconcolor us (I used "FFFF0000" for red, "FF00FF00" for
green and "FF000000" for black) ad a /roll 1r10+1g10+1d10 command

Moon Wizard
September 2nd, 2023, 21:45
You can alternatively change the "icon" in the die result to the d10ricon or d10gicon instead.

The long-term solution is to change the default die icon to a light gray-scale graphic that is then shaded; but that's a much more complicated and intrusive change.

Regards,
JPG

Xarxus
September 3rd, 2023, 09:36
That's perfect!

With this code

{ #1 = { s'type' = s'd100', s'result' = s'5', s'icon' = s'd10ricon' },
#2 = { s'type' = s'd100', s'result' = s'-99', s'icon' = s'd10gicon' },
#3 = { s'type' = s'd100', s'result' = s'-46', s'icon' = s'd10icon' } }
i've got this