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

Challenging Macro

1511603964

Edited 1511605342
I'm working on a prototype system, trying out a few different systems of rolling. I'm attempting to create a macro which can auto-generate the necessary dice pool based on only two inputs, but getting it to do so correctly seems to be beyond me. Maybe I'm just really dumb. Maybe I can't think right at 4am. Either way, I hope someone else can succeed where I cannot! Here's how it goes... Two values to input. Stat , which varies from 1 to 5. Skill, which varies from 0 to 5. Every point in Stat gives you one d10 to roll. Every point in Skill upgrades your dice or adds another dice. If your Skill is less than or equal to the Stat, it upgrades a d10 into a d20. If your Skill exceeds your Stat, the first point of excess will give you an extra d10, and the second point changes that d10 into a d20. This process repeats itself. So to give examplesof what SHOULD result from input... 1 Stat 0 Skill should result in 1d10. 1 Stat 1 Skill should result in 1d20. 1 Stat 2 Skill should result in 1d20+1d10. 1 Stat 3 Skill should result in 2d20. 1 Stat 4 Skill should result in 2d20+1d10. 1 Stat 5 Skill should result in 3d20. 2 Stat 4 Skill should result in 3d20. 3 Stat 3 Skill should result in 3d20. 4 Stat 2 Skill should result in 2d20+2d10. 5 Stat 1 Skill should result in 1d20+4d10. 5 Stat 3 Skill should result in 3d20+2d10.
i would look into how the old world of darkness sheets handle checks that might get you close you could also wait for a Sheet wizard to come by.
1511641416

Edited 1511673323
Give this a shot: /r [[ {?{Stat|1|2|3|4|5}, ?{Skill|0|1|2|3|4|5}}kl1 + floor({?{Skill} - ?{Stat}, 0}kh1 / 2) ]]d20 + [[ abs(?{Stat} - ?{Skill}) % 2e[[{{?{Stat}}, {-1}}>?{Skill}]] ]]d10
That seems to work fantastically! Definitely seems a bit beyond me, I can't quite understand all the individual parts yet, so my ability to replicate it or mod it will be limited, but ... thanks so much!
1511673883

Edited 1511674642
The number of d20's rolled equals the minimum of Stat and Skill (i.e. {?{Stat}, ?{Skill}}kl1) plus half the number of any excess skill points, rounded down (i.e. floor({?{Skill} - ?{Stat}, 0}kh1 / 2)). The number of d10's rolled either equals the difference between Stat and Skill (i.e. abs(?{Stat} - ?{Skill})) when Stat ≥ Skill, or equals 1 when the Stat < Skill and the number of excess skill points are odd (i.e. abs(?{Stat} - ?{Skill}) % 2). The "e[[{{?{Stat}}, {-1}}>?{Skill}]]" appended to the "% 2" turns the 2 into a 20 when Stat ≥ Skill, which prevents the modulus from affecting the difference.