[phpBB Debug] PHP Warning: in file [ROOT]/ext/spaceace/ajaxchat/controller/chat.php on line 220: Trying to access array offset on value of type bool
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4149: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3027)
The Unseen Servant forums • multiple dice
Page 1 of 1

multiple dice

Posted: Sun Dec 21, 2014 12:30 am
by bloodymage
I want to roll 18 d20's. Not [18d20], but discrete rolls.

Re: multiple dice

Posted: Sun Dec 21, 2014 3:17 am
by dmw71
bloodymage wrote:I want to roll 18 d20's. Not [18d20], but discrete rolls.
You can do this:
Set 1: [1d20],[1d20],[1d20],[1d20],[1d20],[1d20]
Set 2: [1d20],[1d20],[1d20],[1d20],[1d20],[1d20]
Set 3: [1d20],[1d20],[1d20],[1d20],[1d20],[1d20]

Re: multiple dice

Posted: Sun Dec 21, 2014 5:12 am
by Alethan
There is a limit of 6 different roll functions, represented by the open and closed square brackets, per dice rolling action, which is why dmw71 shows it as three separate actions with six rolls in each action.

Re: multiple dice

Posted: Sun Dec 21, 2014 2:17 pm
by Alethan
Alethan wrote:There is a limit of 6 different roll functions, represented by the open and closed square brackets, per dice rolling action, which is why dmw71 shows it as three separate actions with six rolls in each action.
Sorry, I shouldn't answer forum questions after driving for five hours and then having Guinness.

It is a length limitation and not the number of dice rolling commands in a roll.

(Thanks for the nudge, Dave.)

Re: multiple dice

Posted: Sun Dec 21, 2014 3:03 pm
by Keehnelf
If all the dice rolls are targeting a specific number, you can also use [18d20sX], where X is the number needed. It will auto-tally the number of successful rolls.

This is quick but comes with a LOT of limitations:

1. For attack rolls, it's impossible to tell when rolls are 1s or 20s.
2. If there's a factor you don't consider in advance, or your math is slightly off, it's impossible to figure out how many successes you would have had with a slightly different target number.
3. If it matters which roll represents which roller, you need additional rolls to work out correlating the results which is almost as much work as the long string.

The main area I've seen this technique be useful is saving throw rolls of a large number of functionally identical npcs.

Since we're on the topic, how difficult would it be to add a verbose output that lists all the results using the [XdYsZ] format?

Re: multiple dice

Posted: Tue May 30, 2017 2:12 pm
by Starbeard
This is sort of related:

In a perfect world, it'd be really nice if there were a specific, single dice code that would allow us to see the individual results of each die in the group.

For example, in the Tunnels & Trolls game I'm running players often roll 2d6+modifiers, but get to roll again if they roll doubles. Right now we have two options:
  • "[2d6+17]"… but that doesn't let us see whether doubles were rolled.
  • "[1d6] [1d6] +17"… but that doesn't add up the results for easy computing.
Trying to combine the two causes the dice roller's spleen to rupture: [1d6+1d6] = 4+1000000 = 1000004

Ideally, something like "[count 2d6+17]" would be perfect for adding up the dice and showing the individual results. However, even something like [1d6+1d6+17] would do just fine.

Re: multiple dice

Posted: Tue May 30, 2017 4:42 pm
by ToniXX
This is interesting. I probably could code something like this, but I gotta admit that it will have to be low on my list of things to do.

Also interesting is how the roller responds to your [1d6+1d6] macro. I can't quite explain that but at least it doesn't break the code, just ruptures the spleen ;)

Re: multiple dice

Posted: Tue May 30, 2017 5:28 pm
by dmw71
ToniXX wrote:...just ruptures the spleen ;)
Or this:
https://www.youtube.com/watch?v=lvl_lfNyHuM :lol:

Re: multiple dice

Posted: Wed May 31, 2017 2:57 am
by ToniXX
dmw71 wrote:
ToniXX wrote:...just ruptures the spleen ;)
Or this:
https://www.youtube.com/watch?v=lvl_lfNyHuM :lol:
Bwahahahaha!

Re: multiple dice

Posted: Sat Aug 26, 2017 2:44 pm
by Zhym
It seems like I want to roll six dice often, but I can't add much text and still have room to include six rolls. For example, this works:
  • [1d20] [1d8]/[1d6] [1d20-2] [1d6]/[1d4]
But this doesn't:
  • Cutlass: [1d20] [1d8]/[1d6] [1d20-2] [1d6]/[1d4]
Much less what I really want, which is something like
  • Cutlass & Boarding Axe (THAC0 20): [1d20] [1d8]/[1d6], [1d20-2] [1d6]/[1d4]
Would it be a lot of trouble to increase how long a roll can be?

Re: multiple dice

Posted: Thu Sep 28, 2017 8:27 pm
by Eris
Zhym wrote:It seems like I want to roll six dice often, but I can't add much text and still have room to include six rolls. For example, this works:

<snip>

Would it be a lot of trouble to increase how long a roll can be?
I second this request!

Of course, I'd really like the dice roller to include if/then/else logic so I could enter something spreadsheet like:

Adama swings his sword and [if d20>8, "hits for " 1d6 " damage", "misses!"]

Re: multiple dice

Posted: Fri Sep 29, 2017 4:15 pm
by ToniXX
Zhym wrote:It seems like I want to roll six dice often, but I can't add much text and still have room to include six rolls. For example, this works:
  • [1d20] [1d8]/[1d6] [1d20-2] [1d6]/[1d4]
But this doesn't:
  • Cutlass: [1d20] [1d8]/[1d6] [1d20-2] [1d6]/[1d4]
Much less what I really want, which is something like
  • Cutlass & Boarding Axe (THAC0 20): [1d20] [1d8]/[1d6], [1d20-2] [1d6]/[1d4]
Would it be a lot of trouble to increase how long a roll can be?
Increasing the length of a roll would be doable, but it may take a fairly major change to the code and the database. I'd have to change the results field from a regular, 255 length text field to a memo field. This might slow things down and drastically increase the database size.

I've also kicked around the idea of simply adding a second 255 length text field to hold the back half of longer macros, and then concatenating the two fields to display the results. I'll have to mull this all over for a bit and re-examine the code.
Eris wrote:Of course, I'd really like the dice roller to include if/then/else logic so I could enter something spreadsheet like:

Adama swings his sword and [if d20>8, "hits for " 1d6 " damage", "misses!"]
This is also an interesting concept. I'm sitting here trying to figure out how to implement it, though. The syntax would have to fit into how current macros work, and the 'if/then/else' syntax would have to be very rigid. But, adding new syntax would make the resulting macro longer, thus necessitating the first point of having longer macros in general.

Any ideas on the syntax? Unfortunately, it can't be as simple as the example Eris made above. It would have to be something similar but more like:

Adama swings his sword and [if 1d20>8 then 'hits for ' [1d6] ' damage'; 'misses'] where the 'then' has to be present, as does the the ';', which acts as the 'else'. But, I'm not sure about having dice macros within dice macros...

Re: multiple dice

Posted: Fri Sep 29, 2017 4:36 pm
by dmw71
ToniXX wrote:I've also kicked around the idea of simply adding a second 255 length text field to hold the back half of longer macros, and then concatenating the two fields to display the results.
I would caution against changing the data type, but think your idea of a second field would be really helpful!
ToniXX wrote:"Adama swings his sword and [if 1d20>8 then 'hits for ' [1d6] ' damage'; 'misses'] where the 'then' has to be present, as does the the ';', which acts as the 'else'."
If the syntax would be required to be provided by the player in the macro... I don't know? That might just create more issues.

With so many different games being played now, I'm sure the roller is being used for far more than simply to-hit and damage rolls, or d20 checks. Unless the current role functionality can be preserved, and the new functionality be added as an extra feature, I would be careful before tinkering with this too much. It would be nice, no doubt, but risky to implement.

Re: multiple dice

Posted: Fri Sep 29, 2017 4:53 pm
by ToniXX
dmw71 wrote:I would be careful before tinkering with this too much. It would be nice, no doubt, but risky to implement.
The more I think about it the more I agree on this point. Thanks for your input, Dave.

Re: multiple dice

Posted: Fri Sep 29, 2017 5:04 pm
by dmw71
ToniXX wrote:The more I think about it the more I agree on this point. Thanks for your input, Dave.
THere are some creative people in here, and I might have some thoughts of my own on it, but I'd be kind of shooting in the dark without knowing what is and what isn't possible.

Getting the second field would definitely be nice, though.

Re: multiple dice

Posted: Fri Sep 29, 2017 6:05 pm
by Alethan
In order for that specific macro to work, you'd have to know your target's AC.

So... maybe a somewhat useful function for a DM? But not really for a PC.

I suppose it would have other applications, but...

(Keeping in mind I am a usability analyst and my day job is to design software interface that is user friendly and efficient...)

Is it really easier to make a roll that has to follow somewhat obscure formatting (to any non-programmers or software developers) and that relies on data you might not have in order to save having to wait a few second after the To Hit roll to know if you need the Damage roll? And, depending on the roll, you might not even know if that roll is needed because, once again, you don't know the target AC.

I think a much easier solution would be to just make your To Hit and Damage rolls in the same roll. Easily done, as long as you don't add too much descriptive text.

The DM determines if your roll hit. If it does, then he applies the damage roll. If not, then he ignores the roll.

I just don't think the added complexity of the required formatting is going to save anyone any time or make the dice roller more efficient.

Re: multiple dice

Posted: Fri Sep 29, 2017 9:47 pm
by Zhym
Yeah, it's a neat idea, but I can't think right now of a situation in which you'd want to have conditionals in a roll that wouldn't be easily solved by just including rolls that might not be needed.