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

Help with indicating varying success levels in a macro

1602772941

Edited 1602773002
Hi, Just about to kick of a game of Dead Simple Sci-Fi rpg, been making macros for the skills, this is mostly going ok.  However, the rpg has varying levels of success, the player rolls 1d20 + skill - difficulty,  I have the following which does this &{template:default} {{name=@{selected|token_name} tests Agility}}{{Total=[[1d20+ @{selected|Agility}-?{difficulty|0}]]}} The rpg has varying success levels though lt 15 - failure gt/e 15  - success gt/e 20 - good success gt/e 30 - excellent success Is there a way to report the player's level of success by adding something to my macro? Hope that made sense :) Cheers Norman
1602778086

Edited 1602862971
David M.
Pro
API Scripter
EDIT - later solution in follow-up posts is much less labor intensive. Easy with api acces, but without... tougher. One thing that might work with quite a bit of setup: You could in theory make a bunch of rollable tables named #SkillResult with only one item each, where the # prefix would be all the potential results of your [[1d20+ @{selected|Agility}-?{difficulty|0}]] roll. So, for example, your 21SkillResult table entry would be "Good Success!". You roll tables with [[ 1t[TableName] ]], so substituting your formula for the table prefix would be: [[ 1t[[[1d20+ @{selected|Agility}-?{difficulty|0}]]SkillResult] ]] So your template would look something like: &{template:default} {{name=@{selected|token_name} tests Agility}}{{Result=[[ 1t[[[1d20+ @{selected|Agility}-?{difficulty|0}]]SkillResult] ]]}} If you wanted to see the actual rolls with mouse-over modifiers, the $[[0]] reference trick could help. So this could work &{template:default} {{name=@{selected|token_name} tests Agility}} {{Result=[[ 1t[[[1d20+ @{selected|Agility}-?{difficulty|0}]]SkillResult] ]]}} {{Roll=$[[0]]}} There could be a more clever solution with less setup time. Try it out with a single table and hardcoded roll result, like [[0d0+#]]SkillResult, where # is the Agility attribute, and use a difficulty of 0. See this example output for a 15SkillResult table: Changed my Agility to 21 to test another example using the 0d0+Agility-0 hardcode, with a 21SkillResult table
Thanks David, hmm doable, but, as you say, much setup, there'd also be the issue of low rolls, say 2+(skill 3)-(dificulty 6) which would be -1 (not very likely, but possible for low level characters, would a -1SkillResult tablename be valid? I'll have a play and see how much time I have.
1602850170
David M.
Pro
API Scripter
Yeah, I totally agree. Lots of work and it would clog your Rollable Tables section like crazy. It's just tough to accomplish without api access. The only upside is that it would work with any skills or other rolls that use the same tiered success pattern by just changing the input inline rolls. The -1 would still work (just tested), though that brings the potential # of tables to ludicrous levels. You'd have to really want that functionality to make it worth it! I would honestly probably just add a couple of rows in your template with the success descriptions, e.g. "15+ = Success", etc.  Hmm, there's also this thread that seems relevant. Might be able to adapt it somehow. You essentially have multiples of 5 for the degrees of success, but you'd have to normalize to 15. You'd probably still have to use tables to output the text you wanted, but it would likely only be one for each level of success, rather than every number in the universe. I'll fiddle with it a little bit, maybe something will come of it.
1602853996

Edited 1602854874
David M.
Pro
API Scripter
OK, how about this. Adapted the previous link, and essentially treating each multiple of 5 of the total roll (1d20+Agility-Difficulty) as an additional level of success. We normalize to 15 by taking the calculated levels of success (5=1success, 10=2successes, 15=3, etc.) by subtracting 2 from the result. Now, you would just need a much smaller handful of tables corresponding to the levels of success. So -1SkillResult (failure), 0SkillResult (failure), 1SkillResult (Success!), 2SkillResult (Good Success!), etc. So the roll template would be the following. Kind of an eyesore, but it seems to work: &{template:default} {{Result=[[1t[[[floor(abs([[ [[1d20+ @{selected|Agility}]]-[[?{difficulty|0}]] ]])/5)-2]]SkillResult]]]}} {{name=@{selected|token_name} tests Agility}}  {{Base Roll=$[[0]]}} {{Difficulty=$[[1]]}} {{Total Roll= $[[2]]}}  This might be easier to read? Same code. &{template:default} {{Result=[[1t[[[floor(abs([[ [[1d20+ @{selected|Agility}]]-[[?{difficulty|0}]] ]])/5)-2]]SkillResult]]]}} {{name=@{selected|token_name} tests Agility}}  {{Base Roll=$[[0]]}} {{Difficulty=$[[1]]}} {{Total Roll= $[[2]]}}  Here is the output for a couple of examples. This character's Agility is set to 15 (no idea if this is realistic in your system, but you get the idea).  You could change the order of the subordinate rows, if you wanted to put the Total Roll directly under the Result, for example. You could also use some template trickery to put the Result at the bottom, by putting the table roll on it's own instead of within double brackets, like this: &{template:default} [[1t[[[floor(abs([[ [[1d20+ @{selected|Agility}]]-[[?{difficulty|0}]] ]])/5)-2]]SkillResult]]] {{name=@{selected|token_name} tests Agility}}  {{Base Roll=$[[0]]}} {{Difficulty=$[[1]]}} {{Total Roll= $[[2]]}} {{Result=$[[4]]}} Example output: The wide rows are a result of the text "Excellent Success" being too long for a single row in the default template, and not because of the change in order. One of the css wizards out there could probably tell you how to reformat that, but that's not my bag :) EDIT - might require the Stylus extension to accomplish? But again, not my forte. That's the best I could come up with. Not sure how many tables you would still need (a fifth of the previous amount), so you would have to evaluate that to see if it was still worth it. Good luck!
1602855462
David M.
Pro
API Scripter
One last thing. You can (kind of) overcome the text length creating thick rows problem by omitting the "Result=" portion of the template, to make the result a single column output. However, it slides all the other rows to the right, as the default template right justifies the 2nd column by default. Not sure if this is any better, but just an option.
Awesome David!  works like a charm, thanks very much for your help.
1602862911
David M.
Pro
API Scripter
Great! That was a fun and interesting exercise!
1602898148
Oosh
Sheet Author
API Scripter
Nicely done