RolePlay onLine RPoL Logo

, welcome to General RPoL

13:40, 28th March 2024 (GMT+0)

RuBB Dice Roller.

Posted by Denalor
Denalor
member, 110 posts
Tue 4 Dec 2018
at 17:41
  • msg #1

RuBB Dice Roller

Okay, so to ease handling via a mobile phone I have rigged the CharSheets to include dice roller codes, so you don't have to configure the Dice Roller itself

FAQ:
Example: [dice=1d20,2d4]
 (roll one twenty-sided die added to two four-sided dice)

[Example: dice=1d20+2 memo="To hit with long sword +2"]

The first example actually does not add the dice together
The second example lacks the "+" in the memo, i.e. "Reason to roll"

[Dice=1d8+1d4+1 memo="Broadsword Damage: 1d8+1d4+1" text="Broadsword Damage" record=yes]
Not only does it not take the dice at all, it also does not add the "Reason to Roll" properly, specifically it lacks all those "+"

[Dice=1d8,1d4+1 memo="Broadsword Damage: 1d8+1d4+1" text="Broadsword Damage" record=yes]
The "," instead of a "+" for Dice will now take the dice, but unfortunately you will have to add the numbers together yourself. Once you have the Hyperlink you can delete the "," and make a "+" instead, but that was not the purpose, right ?

  1. How do your add "+" in your reason to roll via code, i.e. memo ?
  2. What is the correct syntax to sum up various dice including fixed modifiers, e.g. 1d8+1d4+1
  3. Is there any way to make in code the "NPC Name:" for the dice roller via code ?

horus
member, 617 posts
Wayfarer of the
Western Wastes
Thu 6 Dec 2018
at 11:10
  • msg #2

RuBB Dice Roller

Let me take a crack at this:

quote:
  1. How do your add "+" in your reason to roll via code, i.e. memo ?
  2. What is the correct syntax to sum up various dice including fixed modifiers, e.g. 1d8+1d4+1
  3. Is there any way to make in code the "NPC Name:" for the dice roller via code ?


Question 1:  Try something like:

[dice=1d20+2 memo="Rolling to hit with a longsword plus 2"]

Question 2:  Not sure... let me dig on that.  Don't see a way to do it as you suggest, so I'm just gonna play with it a bit...

Okay, so the dice roller apparently does not support summing of differently-sided dice directly.  The way to go here would be to figure out the permutations and employ a table, or just break out your pocket abacus and do the arithmetic.

Take your example of 1d8 + 1d4+2.  To compute the number of possible permutations, multiply the number of sides of each die involved.  In this example, 8 X 4 would yield 32.  That gives you the number of possible results.

{If more than two dice are involved this method still works:  3d6 would be 6 X 6 X 6 or 216 permutations.  1d8 + 2d4 + 1d6 would be 8 X 4 X 4 X 6, or 768 permutations.}

The values of these results would range from (2 to 12) + 2 or from 4 to 14.

So your table would look like:

d8  d4  Sum  d32 equivalent
 1   1    2    1
 2   1    3    2
 3   1    4    3
 4   1    5    4
 5   1    6    5
 6   1    7    6
 7   1    8    7
 8   1    9    8
 1   2    3    9
 2   2    4   10
 3   2    5   11
 4   2    6   12
 5   2    7   13
 6   2    8   14
 7   2    9   15
 8   2   10   16
 1   3    4   17
 2   3    5   18
 3   3    6   19
 4   3    7   20
 5   3    8   21
 6   3    9   22
 7   3   10   23
 8   3   11   24
 1   4    5   25
 2   4    6   26
 3   4    7   27
 4   4    8   28
 5   4    9   29
 6   4   10   30
 7   4   11   31
 8   4   12   32


Now, just roll a d32 and consult the Sum column of this table, adding the 2 for the die modifier.

It would probably just be easier to accept the displayed results of a multi-typed roll, do the arithmetic by inspection, and use that for your result.

e.g., [dice=1d8,1d4+2 memo="add results together, please"]

might yield a result of, for example, 7 and 1.  That 1 would modify to a 3, so add 7 and 3 together to get 10.  (Note the dice roller shows the modified and unmodified values of all dice involved.)

Well, that was fun...

Question 3:  To do what I think you're asking, you'll need the character ID number for the NPC or PC in question.

Example:  [dice=d100 text="Roll Percentile Dice" rc=299435] [dice=d100 text="Roll Percentile Dice" rc=299435]

This would roll a percentile die as a character from one of my games (which game shall remain a mystery).

To find this magic number, view Character Details from within your game, and look at the URL displayed in your browser.  There will be a number preceded by &ci in there.  That number is the Character ID, and is unique across all of RPoL so far as I know.

If a GM is rolling on behalf of a character, replace the rc= option above with a bo= option followed by the character ID number.

Don't try to use bo= and rc= in the same roll - it won't work.

So it looks like the news is a mixed bag.  Hey, two outta three ain't bad.

Annnnd it's off to bed for me.  Gotta go to work tomorrow afternoon.
This message had punctuation tweaked by the user at 11:13, Thu 06 Dec 2018.
Denalor
member, 111 posts
Thu 6 Dec 2018
at 13:42
  • msg #3

RuBB Dice Roller

To clarify
#1
Yeah, well. Of course, there is a work-around.
Anyone know how to do the '+', though ?

#2
Umm, the idea is to make it all easier, right ? Via Mobile phone, right ? Checking tables won't exactly be easier, right :-) ?

#3.
rc or bo requires that you have that NPC.
I was targetting at not having that NPC in "The Cast".
For the various issues already discussed about "hidden NPCs" which, although mentioned in the same FAQ page as above, are not an Option.

Thanks anyway.
LonePaladin
member, 776 posts
Creator of HeroForge
Thu 6 Dec 2018
at 15:04
  • msg #4

Re: RuBB Dice Roller

Denalor:
Yeah, well. Of course, there is a work-around.
Anyone know how to do the '+', though ?

Maybe try replacing the plus sign with "+" (without the quotes).

+
Denalor
member, 112 posts
Thu 6 Dec 2018
at 15:31
  • msg #5

Re: RuBB Dice Roller

Unfortunatly not, had tried that, too

[Dice=1d8,1d4+1 memo="Broadsword Damage 1d8+1d4+1" text="Broadsword Damage" record=yes]
It inserts only 'Broadsword Damage 1d8&' into "Reason for roll"
MalaeDezeld
member, 95 posts
Thu 6 Dec 2018
at 15:45
  • msg #6

Re: RuBB Dice Roller

[Dice=1d8,1d4+1 memo="Broadsword Damage 1d8%2B1d4%2B1" text="Broadsword Damage" record=yes]

%2B is the code you are looking for.

In that case, the encoding used is url and not html.
swordchucks
member, 1521 posts
Thu 6 Dec 2018
at 15:54
  • msg #7

Re: RuBB Dice Roller

MalaeDezeld:
%2B is the code you are looking for.

Thank you for that.  I've had pretty much these exact same questions on occasion and having a real answer is great.
Denalor
member, 113 posts
Thu 6 Dec 2018
at 16:19
  • msg #8

Re: RuBB Dice Roller

In reply to MalaeDezeld (msg # 6):

Awesome, thanks.
...
...
does not work for challenge #2 :(
MalaeDezeld
member, 96 posts
Thu 6 Dec 2018
at 16:57
  • msg #9

Re: RuBB Dice Roller

You are right for #2.

After a few tests, I think that rpol can not do it currently.
horus
member, 618 posts
Thu 6 Dec 2018
at 18:47
  • [deleted]
  • msg #10

Re: RuBB Dice Roller

This message was deleted by a moderator, as it was against the forum rules, at 18:52, Thu 06 Dec 2018.
horus
member, 625 posts
Wayfarer of the
Western Wastes
Sun 9 Dec 2018
at 10:34
  • msg #11

Re: RuBB Dice Roller

MalaeDezeld:
[Dice=1d8,1d4+1 memo="Broadsword Damage 1d8%2B1d4%2B1" text="Broadsword Damage" record=yes]

%2B is the code you are looking for.

In that case, the encoding used is url and not html.


The code for - {minus} (just for completeness) would be %2D (tested this, I did.)

I'm more used to seeing / than % as an escape delimiter for ASCII code sequences, though.  Maybe that's what you were meaning by "url" encoding?

I'm curious, now, if "html" would mean unicode?

Thanks for bringing this to light.
MalaeDezeld
member, 97 posts
Mon 10 Dec 2018
at 21:46
  • msg #12

Re: RuBB Dice Roller

horus:
The code for - {minus} (just for completeness) would be %2D (tested this, I did.)

From my limited test, "-" did work as expected in the memo. Even "&" did.

And %22 for the quote " character if it is ever needed (in the memo).
" in the text section.

quote:
I'm more used to seeing / than % as an escape delimiter for ASCII code sequences, though. Maybe that's what you were meaning by "url" encoding?
I'm curious, now, if "html" would mean unicode?

No, those are completely different things.

URL is the technical term for the address of a web page. It has his own rules about how to interpret characters. Space characters are illegal and thus are replace with an "+". When rpol created the link for the dice roller, it doesn't replace the "+". And thus, when the user click on the link, and rpol reads the address, it sees a space and not a "+" as intended. That's why "+" need to be escaped (in the format that URL had define).

Html is the format for text web page (like all pages in rpol). And like URL, it has it own rules about how to interpret characters.

For how URL and html deal with characters over the ASCII range (which Unicode is a definition beside many others), it depends on everything: from your browser to their server. The only important thing is that all that use the same schema for encoding those characters.
horus
member, 627 posts
Wayfarer of the
Western Wastes
Tue 11 Dec 2018
at 08:37
  • msg #13

Re: RuBB Dice Roller

MalaeDezeld:
No, those are completely different things.

URL is the technical term for the address of a web page.


Sure:  Uniform Resource Locator

quote:
It has his own rules about how to interpret characters. Space characters are illegal and thus are replace with an "+".


I usually see spaces rendered in a URL as %20.  Let's see now...  Aha!  That %20 represents 20 in Hexadecimal which is, indeed, a plus sign.

quote:
When rpol created the link for the dice roller, it doesn't replace the "+". And thus, when the user click on the link, and rpol reads the address, it sees a space and not a "+" as intended. That's why "+" need to be escaped (in the format that URL had define).

Html is the format for text web page (like all pages in rpol). And like URL, it has it own rules about how to interpret characters.

For how URL and html deal with characters over the ASCII range (which Unicode is a definition beside many others), it depends on everything: from your browser to their server. The only important thing is that all that use the same schema for encoding those characters.


I had thought Unicode just extended the ASCII set to include international characters.  Maybe that was a mistaken notion?  No.  Unicode is a superset of ASCII that extends the number of characters to a potential 221.  Wow. That's a lotta characters.
MalaeDezeld
member, 98 posts
Tue 11 Dec 2018
at 18:14
  • msg #14

Re: RuBB Dice Roller

horus:
I had thought Unicode just extended the ASCII set to include international characters.  Maybe that was a mistaken notion?  No.  Unicode is a superset of ASCII that extends the number of characters to a potential 221.  Wow. That's a lotta characters.

It is true. The problem is that there is more than one standard on how to represent characters over the ASCII range in a ASCII compatible way. Older ones like ISO-8859-1 and Windows-1252 (which rpol use in its url parsing) competing with the (at least 3) standards for Unicode (UTF-8, UTF-16, ...).
horus
member, 628 posts
Wayfarer of the
Western Wastes
Tue 11 Dec 2018
at 18:49
  • msg #15

Re: RuBB Dice Roller

In reply to MalaeDezeld (msg # 14):

Yeah, how did that go?  Something like, "The trouble with standards is that there are so many of them."  Thanks.  I blame Microsoft for this -- it's standard procedure.
Sign In