Page 2 of 6

### Re: Dice Roller

Posted: Mon Nov 06, 2017 3:33 pm
zorni wrote:
Mon Nov 06, 2017 3:14 pm
Pen & Paper RPGs have values for many talents. Let's say, physical strength. 5, for example, is like a child, 12 is a normal man and over 15 is a warrior.
If the player wants to apply a talent, he has to take a sample with a D20. The game master can modify this depending on how difficult the task is.
For example, the warrior wants to lift a 75kg stone. It's no easy task, so the master modifies this specimen by 3: the physical force is 15, the Modification 3, so the Warrior has to make the specimen 3 more difficult, that's a 12, so he rolls a D20 and succeeds in rolling a 1-12. If he's above that, he won't make it through rehearsal.
I see. Is that only about + and -, or also multiplications, divisions and other stuff?

### Re: Dice Roller

Posted: Mon Nov 06, 2017 3:36 pm
Ger wrote:
Mon Nov 06, 2017 2:59 pm
...so I extracted these basic requirements:
1. Be able to put some BBcode specifying the number of dice and how many sides each dice has
2. Showing and protecting the result
3. Allow only dice rolls belonging to the post, unless you're quoting someone else
4. Prevent edits and such
Yep, that's about it for a basic implementation.

It needs to allow for things like:
`[ROLL]2d4+5[/ROLL]`
`[ROLL=Morck Cures Dregs]2d8+3[/ROLL]`

If a bit more advanced, it would allow a special Dice (which is like 90% of rolls in a PbP) and a more complex parsing:
1d20+4;1d6+4+2d6
Used like this (an attack action also requires a damage result in case the attack succeeds):
`[ROLLATK=Aragorn Sneak Attack on Orc #1]1d20+4;1d6+4+2d6[/ROLLATK]`
With a result of:
Aragorn Sneak Attack on Orc #1
.....Attack: 14+4 → 18
.....Damage: 3+4+6 → 13

(I used dots because I can't use white-spaces or a tab in a forum post - but "...." is a tab!)

You can (obviously) use the Standard Dice notation for the rolls - there might even be existing libraries that provide functions for that - like on GitHub

In any case, if you wish to go forward, I can help out in testing or other questions you might have (dice related!)
THANKS!!

RiTz21

P.S. `[ROLL]` would be a much better tag than DICE! (and not break my old forum which has lots of outdated [DICE] all over the place... )

### Re: Dice Roller

Posted: Mon Nov 06, 2017 3:56 pm
RiTz21 wrote:
Mon Nov 06, 2017 3:36 pm
If a bit more advanced, it would allow a special Dice (which is like 90% of rolls in a PbP) and a more complex parsing:
1d20+4;1d6+4+2d6
Used like this (an attack action also requires a damage result in case the attack succeeds):
`[ROLLATK=Aragorn Sneak Attack on Orc #1]1d20+4;1d6+4+2d6[/ROLLATK]`
With a result of:
Aragorn Sneak Attack on Orc #1
.....Attack: 14+4 → 18
.....Damage: 3+4+6 → 13
Isn't this just basically 2 rolls?
You can (obviously) use the Standard Dice notation for the rolls -
Wow
I do some board games like these, never realised there were so many options
P.S. `[ROLL]` would be a much better tag than DICE! (and not break my old forum which has lots of outdated [DICE] all over the place... )
I can imagine I would support both and simply create some kind of settings page that allows for selecting one of them... Not sure yet. I will probably end up supporting the most common usage.

### Re: Dice Roller

Posted: Mon Nov 06, 2017 4:44 pm
Ger wrote:
Mon Nov 06, 2017 3:56 pm
Isn't this just basically 2 rolls?
Yes, but it would have the advantage (for 90% of rolls) of every player using the same template for rolls... that would be sweet (hence the extra tag `[ROLLATK]` to denote the attack action. Note that ALL version of Dungeons & Dragons + many many d20 derivatives have attacks that are a sequence of two rolls. Of course, `[ROLL]` has to be working first before adding the secondary `[ROLLATK]`!
Ger wrote:
Mon Nov 06, 2017 3:56 pm
I can imagine I would support both and simply create some kind of settings page that allows for selecting one of them... Not sure yet. I will probably end up supporting the most common usage.
If you keep `[DICE]`, I just hope it will work with the many `[DICE]0[/DICE]` let over on my forum from the days of DiceMod!

RiTz21

### Re: Dice Roller

Posted: Mon Nov 06, 2017 4:53 pm
If I'm able to share "my" dice ext with you, you'll be able to re-import the old [dice] rolls, to the new ext.

We paid special attention to that, because we didn't want to destroy 88000 rolls, we had in the past

### Re: Dice Roller

Posted: Mon Nov 06, 2017 5:04 pm
zorni wrote:
Mon Nov 06, 2017 4:53 pm
If I'm able to share "my" dice ext with you, you'll be able to re-import the old [dice] rolls, to the new ext.

We paid special attention to that, because we didn't want to destroy 88000 rolls, we had in the past
Thanks!!
I'm ok though - I already upgraded to 3.2.1 and the old DiceMod tables are all deleted... the only thing left are the lost [DICE] tags in the PbP forums. I *could* restored they from an old backup, but it's not worth the effort (they are not really needed... My worry is more that they could cause issues with a new dice extension that uses `[DICE]` for the bbcod, as opposed to `[ROLL]`)

RiTz21

### Re: Dice Roller

Posted: Mon Nov 06, 2017 5:06 pm
In this case they shouldn't. BBcodes only will ne reparsed, if the posting will be edited and saved.

### Re: Dice Roller

Posted: Mon Nov 06, 2017 5:18 pm
zorni wrote:
Mon Nov 06, 2017 5:06 pm
In this case they shouldn't. BBcodes only will ne reparsed, if the posting will be edited and saved.
Is there a way to 're-parse' the bbcodes?
I ask because I had MANY bbcodes not working after upgrading to 3.2.1 from 3.0.14 ... and although I finally fixed all of them (reference), I noticed that they are not parsed.

RiTz21

### Re: Dice Roller

Posted: Mon Nov 06, 2017 5:21 pm
The Support Tool Kit has an option for reparsing BBCodes.
https://github.com/AlexSheer/phpBB3.2-STK

### Re: Dice Roller

Posted: Mon Nov 06, 2017 5:22 pm
RiTz21 wrote:
Mon Nov 06, 2017 5:18 pm
zorni wrote:
Mon Nov 06, 2017 5:06 pm
In this case they shouldn't. BBcodes only will ne reparsed, if the posting will be edited and saved.
Is there a way to 're-parse' the bbcodes?
I ask because I had MANY bbcodes not working after upgrading to 3.2.1 from 3.0.14 ... and although I finally fixed all of them (reference), I noticed that they are not parsed.

RiTz21
Yes, that is possible through the CLI interface. I'm on the phone now, but search for "phpbbcli reparse bbcode", that should point you in the right direction.

### Re: Dice Roller

Posted: Mon Nov 06, 2017 6:01 pm
So "my" Ext is open source. How should we handle that, ger? I'm not sure if it's the best idea just to post a public DL link, cause as I said before, there's no documentation or support.

### Re: Dice Roller

Posted: Tue Nov 07, 2017 7:32 am
zorni wrote:
Mon Nov 06, 2017 6:01 pm
So "my" Ext is open source. How should we handle that, ger? I'm not sure if it's the best idea just to post a public DL link, cause as I said before, there's no documentation or support.
Well, usually I just put everything on Github, but I understand you don't want that.

Is it OK I PM you my email address so you can send me a private download link? I won't just be throwing it online, just use it for inspiration to create my own extension.

### Re: Dice Roller

Posted: Tue Nov 07, 2017 8:04 am
So I talked with my team and we will provide a public download. So everybody can do whatever he/she want's with it.

Here you go. http://www.dsaforum.de/app.php/dlext/?v ... &df_id=220

Have fun!

### Re: Dice Roller

Posted: Tue Nov 07, 2017 8:37 am
zorni wrote:
Tue Nov 07, 2017 8:04 am
So I talked with my team and we will provide a public download. So everybody can do whatever he/she want's with it.

Here you go. http://www.dsaforum.de/app.php/dlext/?v ... &df_id=220

Have fun!
Just out of curiosity, since we (me and javiexin) ported the Dicemod for 3.1 and I do have the version for 3.2 already in my pipeline I was curious to compare the 2 logics, under a developer's point of view ..but:

your D/L doesn't work here. Could it be a question of permissions?

Thx.

### Re: Dice Roller

Posted: Tue Nov 07, 2017 8:39 am
Could you test again pls? I changed a setting