RolePlay onLine RPoL Logo

, welcome to RPoL Development

05:22, 29th March 2024 (GMT+0)

More dice rolleer questions!

Posted by DarkLightHitomi
DarkLightHitomi
member, 611 posts
Fri 25 Jul 2014
at 14:55
  • msg #1

More dice rolleer questions!

Since you won't include unpublished game systems in the dice roller, can you share the basic code for the roller? I want to include a roller on my site to make the rolls easier, but I haven't done anything remotely like it and have no idea where to even start on trying to make such a thing. I should be able to modify it once I can see how it works though.
bigbadron
moderator, 14526 posts
He's big, he's bad,
but mostly he's Ron.
Fri 25 Jul 2014
at 15:17

Re: More dice rolleer questions!

Sorry, that would be a "no".  The code for the entire site belongs to jase.

There are plenty of other sites which offer dice rollers, and the like, for free.  A Google search should turn up a few.
DarkLightHitomi
member, 613 posts
Sat 26 Jul 2014
at 02:46
  • msg #3

Re: More dice rolleer questions!

The trick is finding one that records the rolls on the site with at least an attached description. Oh and I would have to be able to modify it so it can easily roll multiple different sided dice with a single totaled result while displaying the individual rolls.

And a bonus if I can include negative die sizes and the ability to count mis/fortune gained from dice rolling min or max. Though this is a bonus cause it is not that big of a thing, in fact negative dice are  only used by objects or constructs. Fortune is used more commonly but is likely a pain to code, but is simple to track if the individual rolls are shown.

I so far have only found rollers that do less then rpol, and haven't found any source code for just the roller much less one that records the results. And getting it usable on the web with recorded and displayed rolls is the part I need help with. I need my players to be able to use it.

Unless jase wants a challenge and will accept an exception to the published only rule.
jase
admin, 3376 posts
Cogito, ergo procuro.
Carpe stultus!
Sat 26 Jul 2014
at 03:15

Re: More dice roller questions!

In reply to DarkLightHitomi (msg # 1):

If you haven't done any coding then you'll have no luck deciphering the mess that is my Perl code.

As for adding a custom roll to the dice roller, it depends what it is and how simple it is.  I'm sure magic 8 ball isn't an official system, but it seemed useful so I popped it in.

Yours does seem rather complicated and specialised, and though I'd love to help; if I customise the roller for you then I've got to be fair to the other members and customise it for them if they ask.
LoreGuard
member, 549 posts
Sat 26 Jul 2014
at 03:29
  • msg #5

Re: More dice roller questions!

What if Jase were to create a generic option to allow mixing die types and negatives?

As an example, using a generic, with multipliers including negatives you could support Alternity.  A roll such as d20+d4 or d20-1d4.  It could sum the result for you and you could record all roll and deal with any specifics for special roll values.
Just a thought.

I.e. Such a customization might support the published system Alternity but might also contribute to other custom systems being more supported.
This message was last edited by the user at 03:32, Sat 26 July 2014.
DarkLightHitomi
member, 615 posts
Sat 26 Jul 2014
at 06:04
  • msg #6

Re: More dice roller questions!

Really, just being able to roll multiple different sized dice at the same time and add them together would be enough.

The game system itself uses rolls of 3-5 dice, and adds them for a total (to be compared to a number).

Fortune points are earned when a die lands on it's maximum or minimum value, but this aspect is simple enough for players and myself to track on our own if we can see the individual dice results as well as the total.

Or
The first two will always be rolled, though the skill, specialist, and circumstance dice may be a D0.
Die 1: The luck die, always a D12.
Die 2: Applicable attribute (objects can have this negative, but very rarely rolled).
Die 3: Applicable skill (or second attribute for saves)
Die 4: Specialist Die
Die 5: Circumstance Die, can be positive or negative

The first die is always a D12, then two or three dice are sized based on the characters attributes and skill, then the final die is the circumstance die (basically bonuses or penalties determine the size of the circumstance die and whether it is positive or negative.)

---
I have never seen perl, but I found C++ to be simple and very easy, and was helping fellow classmates on day one.

Mostly I just don't know enough about the web to embed something (if embedding C++ is even allowed). But I expect the code to be easily deciphered with but a small amount of research, if I can see some code (I have yet to see code that I couldn't easily decipher), whether that code is yours or someone else's. I just haven't found someone else's code yet.

In fact, I have only seen one other roller that even records the results (well web rollers anyway), and it uses email and links for each result, which is troublesome. (and I can't see it's code either)

---

If you can do even the addition of dice in the custom box, that would be awesome. If not, I'll keep looking (which I will probably do anyway)

Suggestions,
Perhaps add the ability to use a special symbol between two dice expressions to add their results, I.E. 1D12 & 2d4 & 1d6, would add the results of them together and still be able to be separated by commas, for multiple rolls.

Then you can either use a separate symbol for a negative expression, or you might be able to simply allow a negative number of dice depending on how you parse the expression and how the code functions. I.E. -2d4 for -2 four sided dice, aka the same thing as minus 2D4.

I.E. 1D12 & 2d4 & 1d6, would add the results of them together and still be able to be separated by commas for multiple separate rolls.



Together it might look like "1D12 & 1D8 & 1D6 & -1D4, 1D12 & 2D8" would give the results of a D12 plus D8 plus D6 minus D4 as the first roll, and then a D12 plus 2D8s for the second roll.
bigbadron
moderator, 14527 posts
He's big, he's bad,
but mostly he's Ron.
Sat 26 Jul 2014
at 06:35

Re: More dice roller questions!

You can already roll different sized dice as a single roll, though you have to do the math yourself.  Use the manual input field at the top right of the roller.

quote:
Dorian, rolled 1,5,13,21 using d12,2d4+2,3d6,d27 ((1,2,1,1,6,6,21))

DarkLightHitomi
member, 616 posts
Sat 26 Jul 2014
at 06:44
  • msg #8

Re: More dice roller questions!

Yep, but it is still doing the math oneself, and since every roll is multiple dice of different sizes, it can kinda become a tiring thing rather quickly.
jase
admin, 3377 posts
Cogito, ergo procuro.
Carpe stultus!
Sun 27 Jul 2014
at 03:59

Re: More dice roller questions!

It's always been my intention to allow additions and subtractions in the roller, there's a fair bit I need to finish in the current version, I'll see how I go for time and energy.

I've also harboured the idea of being able to denote your own rolling mechanics, but that'll probably be a little while off.
jase
admin, 3378 posts
Cogito, ergo procuro.
Carpe stultus!
Mon 28 Jul 2014
at 01:16

Re: More dice roller questions!

The beta site now has the ability to roll dice additions and subtractions.  Feel free to test and let me know if there are any problems.

quote:
Narrator rolled 88,14 using 5+1d200+3-2d100+2,2d6+1d4+1 ((188,53,57,6,6,1)).

Genghis the Hutt
member, 2268 posts
Just an average guy :)
Mon 28 Jul 2014
at 06:33
  • msg #11

Re: More dice roller questions!

Could we maybe get a semicolon between sets, since the list of dice rolls has a comma in between each one?  For instance (example is bolded and colored for emphasis):
Narrator rolled 88,14 using 5+1d200+3-2d100+2,2d6+1d4+1 ((188,53,57;6,6,1)).
DarkLightHitomi
member, 620 posts
Mon 28 Jul 2014
at 07:13
  • msg #12

Re: More dice roller questions!

Neat. That will make my game much easier to play.
jase
admin, 3380 posts
Cogito, ergo procuro.
Carpe stultus!
Tue 29 Jul 2014
at 08:21
  • msg #13

Re: More dice roller questions!

In reply to Genghis the Hutt (msg # 11):

Good idea, has been added in.
CraziFuzzy
member, 1 post
Mon 18 May 2015
at 15:08
  • msg #14

Re: More dice roller questions!

Not sure if it makes sense to necro this old post, but it seems it might be related.  I'm wondering if tags could be added to each section of the dice-string.  basically, if every character that is not recognized as a dice string could be reproduced in the result.  Something like:

<blue>1d20+4 attack</blue>, <red>1d6+2 damage</red>

CraziFuzzy rolled 14 attack, 5 damage using 1d20+4 attack, 1d6+2 damage ((10;3)).

I haven't seen your code, obviously, so don't know how trivial this would be. I have built a dice roller that does this, but it is vba (in excel), not perl, so may not translate over too easily, and is also not currently as capable as yours (as far as being able to drop lowest and such).
This message was last edited by the user at 17:54, Mon 18 May 2015.
Maidenfine
member, 100 posts
Tue 19 May 2015
at 01:36
  • msg #15

Re: More dice roller questions!

I'm pretty sure you can choose a color for your results. Not two, so you wouldn't be able to do exactly what you put there, but you could still color-code.
CraziFuzzy
member, 2 posts
Tue 19 May 2015
at 07:16
  • msg #16

Re: More dice roller questions!

Maidenfine:
I'm pretty sure you can choose a color for your results. Not two, so you wouldn't be able to do exactly what you put there, but you could still color-code.

My goal (and example) passed everything through, not just the color tags, so you get the descriptive words in there as well.
Sign In