Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Maximizing dice in an repeating skill field

Hi, I'm trying to create a roll that maximizes the dice, for a critical. the problem is that I would like to do that in a repeating field that the players enter the weapon damage in.  Damage is in the form of 1d8+1.  thanks
1604036663
GiGs
Pro
Sheet Author
API Scripter
The fact that its in a repeating field doesnt affect how you'd do this. Just have an attribute to store the damage roll in, and then refer to that attribute name in the button value for the actual roll. Maximizing the damage on a critical is the real challenge - you cant do this with a normal macro. Since youre making a custom sheet, you can make a rolltemplate that checks if the roll is critical, and prints out the max. You'd need to have the max stored in a property. The easiest way to do that is to have the players enter the max, too, in another input.
1604072836
Finderski
Pro
Sheet Author
Compendium Curator
GiGs said: Maximizing the damage on a critical is the real challenge - you cant do this with a normal macro. Since youre making a custom sheet, you can make a rolltemplate that checks if the roll is critical, and prints out the max. You'd need to have the max stored in a property. The easiest way to do that is to have the players enter the max, too, in another input. Or, assuming the damage dice are entered on the character sheet already, use a sheet worker to store the max damage for that weapon and then just pass it along in the macro. :) Just trying to keep you busy with sheet worker tips/hints/guidance, GiGs. ;)
1604073343
GiGs
Pro
Sheet Author
API Scripter
Finderski said: GiGs said: Maximizing the damage on a critical is the real challenge - you cant do this with a normal macro. Since youre making a custom sheet, you can make a rolltemplate that checks if the roll is critical, and prints out the max. You'd need to have the max stored in a property. The easiest way to do that is to have the players enter the max, too, in another input. Or, assuming the damage dice are entered on the character sheet already, use a sheet worker to store the max damage for that weapon and then just pass it along in the macro. :) Just trying to keep you busy with sheet worker tips/hints/guidance, GiGs. ;) :) I didnt suggest that because it gets quite tricky to handle the different ways damage dice might be written. It's doable, but complex, and prone to error. I have in fact several times recommended that people store damage dice with three inputs of type="number": one for number of dice, one for die size, and one for extra modifier. That avoids the complexity and the many potential errors that come from letting players enter the damage as text in forms like "1d8+1", is really easy for players to enter when the sheet writer formats those inputs well, and is really simple to make the code work in a sheet worker OR an autocalc field. People have been resistant to that approach because, I guess, they think creating 3 inputs instead of one is more work, or is clunky, or whatever, without thinking about how crazy complex and error prone the code is when you don't do it that way, and you can use styling to make the 3 inputs really smooth so that players dont think of them as separate controls. The point is: if you arent going to do it with 3 inputs, the next best method is to provide a box for players to enter the maximum. That is way easier than trying to handle damage strings entered by players, which will have many different possible formats, and extract a maximum from that. I bet you weren't expecting me to jump on my soapbox after that post, hehe.
1604076325
Finderski
Pro
Sheet Author
Compendium Curator
GiGs said: Finderski said: GiGs said: Maximizing the damage on a critical is the real challenge - you cant do this with a normal macro. Since youre making a custom sheet, you can make a rolltemplate that checks if the roll is critical, and prints out the max. You'd need to have the max stored in a property. The easiest way to do that is to have the players enter the max, too, in another input. Or, assuming the damage dice are entered on the character sheet already, use a sheet worker to store the max damage for that weapon and then just pass it along in the macro. :) Just trying to keep you busy with sheet worker tips/hints/guidance, GiGs. ;) :) I didnt suggest that because it gets quite tricky to handle the different ways damage dice might be written. It's doable, but complex, and prone to error. I have in fact several times recommended that people store damage dice with three inputs of type="number": one for number of dice, one for die size, and one for extra modifier. That avoids the complexity and the many potential errors that come from letting players enter the damage as text in forms like "1d8+1", is really easy for players to enter when the sheet writer formats those inputs well, and is really simple to make the code work in a sheet worker OR an autocalc field. People have been resistant to that approach because, I guess, they think creating 3 inputs instead of one is more work, or is clunky, or whatever, without thinking about how crazy complex and error prone the code is when you don't do it that way, and you can use styling to make the 3 inputs really smooth so that players dont think of them as separate controls. The point is: if you arent going to do it with 3 inputs, the next best method is to provide a box for players to enter the maximum. That is way easier than trying to handle damage strings entered by players, which will have many different possible formats, and extract a maximum from that. I bet you weren't expecting me to jump on my soapbox after that post, hehe. Perhaps it's a non-issue for me, because I agree with you, I use three inputs for those very reasons. LOL ;) I've used regex in the past to parse those formulas, but I'm no expert with regex and it gave me a migraine for a week...:-/
1604077419
GiGs
Pro
Sheet Author
API Scripter
Finderski said: I've used regex in the past to parse those formulas, but I'm no expert with regex and it gave me a migraine for a week...:-/ You can use regex, but you (the generic you, not you specifically) are making the assumption that the damage code will be properly formatted. This is not a safe assumption when letting users enter text. Never mind handling dice rolls that may or may not include modifiers, and some modifiers will be + and others -, and some people will enter "1d8+1" and others will enter "D8". All of these are solvable, but its a lot easier just to build the sheet with 3 inputs (and you do - very sensible!) so you dont have to deal with that :)
Thanks all for the quick reply. GiGs I like the simplicity of your original idea. -J
1604119638
GiGs
Pro
Sheet Author
API Scripter
Great :)