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

Earthdawn Macro help...

Greetings! I'm playing in an Earthdawn game and would like to set up a macro that will allow me to: enter a step number for the initial die roll enter a step number for Karma dice (if any) enter a modifier (if any) have the system display the total roll I know the syntax for making die rolls (incl. exploding die rolls), but I get hopelessly lost when I try to deal with nested macros & tables. I've also seen a number of posts where things like this are dealt with in API scripting (which I am wholly ignorant of). Is there a way to do what I'm looking to do without using API?  " Nope " is an acceptable answer... just hoping there's a more elegant way than making separate rolls and adding them up manually.
1591936001

Edited 1591936324
Oosh
Sheet Author
API Scripter
I'm not familiar with the game at all, but is something like this what you're after? &{template:default}{{name=Earthdawn Dice}}{{Step ?{Step selection|1,1=[[1d4-2| 2,2=[[1d4-1| 3,3=[[1d4} + ?{Modifier}[MOD]]]}}{{Karma Step ?{Karma Step selection|1,1=[[1d4-2| 2,2=[[1d4-1| 3,3=[[1d4} + ?{Karma Modifier}[KMOD]]]}} I've only put the first 3 steps in, but you get the idea. Is this roughly what it should do? Can those modifiers be pulled from a sheet, or should they both be the same number (not a separate karma mod)? Edit - probably want the karma step and the modifiers to default to "0" as well. Steps were taken from the Wiki, no idea if they're the right version!
That is remarkably close to what I'm looking for... I just need it to add the two rolls (the initial roll + the karma roll) together... and only a single option to enter a modifier.
1592012839

Edited 1592012980
GiGs
Pro
Sheet Author
API Scripter
There was a macro for this posted over on the roll20 discord a few days ago by admiralnlson. It's pretty scary: [[[[{1e3,14}<[[{?{Step},0}kh1%22]]+floor(([[{?{Step},0}kh1]])/22)]]d20!+[[{0,1,1,2,6,10}=[[{?{Step},0}kh1%11]]-{-1,1}=[[{?{Step},0}kh1]]+floor(([[{?{Step},0}kh1]]-3)/22)]]d10!+[[{0,5,9}=[[{?{Step},0}kh1%11]]+{1,2}=[[{?{Step},0}kh1]]+floor(([[{?{Step},0}kh1]]-3)/22)]]d8!+[[{-1,8}=[[{?{Step},0}kh1%11]]-{0,1,5,6}=[[{?{Step},0}kh1%11]]+{-1,1}=[[{?{Step},0}kh1]]+1]]d[[4+2*{4,8,9,10}=[[{?{Step},0}kh1%11]]+8*({2,7}=[[{?{Step},0}kh1%11]]*(1-{-1,2}=[[{?{Step},0}kh1]]))]]!-[[{1,2}=[[{?{Step},0}kh1]]*(3-[[{?{Step},0}kh1]])]]+?{Modifier?|0}]] Here's a gif of it in action (the gif doesnt include the modifier) Fair warning: this will be quite slow for large step amounts. If you need to include the dice roll in a query, this even more horrifying version is the one to use [[[[{1e3,14}<[[{?{Step},0}kh1%22]]+floor(([[{?{Step},0}kh1]])/22)]]d20!+[[{0,1,1,2,6,10}=[[{?{Step},0}kh1%11]]-{-1,1}=[[{?{Step},0}kh1]]+floor(([[{?{Step},0}kh1]]-3)/22)]]d10!+[[{0,5,9}=[[{?{Step},0}kh1%11]]+{1,2}=[[{?{Step},0}kh1]]+floor(([[{?{Step},0}kh1]]-3)/22)]]d8!+[[{-1,8}=[[{?{Step},0}kh1%11]]-{0,1,5,6}=[[{?{Step},0}kh1%11]]+{-1,1}=[[{?{Step},0}kh1]]+1]]d[[4+2*{4,8,9,10}=[[{?{Step},0}kh1%11]]+8*({2,7}=[[{?{Step},0}kh1%11]]*(1-{-1,2}=[[{?{Step},0}kh1]]))]]!-[[{1,2}=[[{?{Step},0}kh1]]*(3-[[{?{Step},0}kh1]])]] +?{Modifier?|0} ]]
1592013666

Edited 1592014852
Oosh
Sheet Author
API Scripter
Edit - rolled low initiative & slain by an HTML beast! Aha, so more like this, but obviously with all the Steps put in: &{template:default}{{name=Earthdawn Dice}}{{Step ?{Step selection|1,1=[[ (1d4-2)[S1]| 2,2=[[(1d4-1)[S2]| 3,3=[[(1d4)[S3] } + ?{Karma Step selection|1,(1d4-2)[KS1]| 2,(1d4-1)[KS2]| 3,(1d4)[KS3] } + ?{modifier|0}[MOD] ]]}} As a single roll it probably doesn't even need to be in a template, could just do a single line or emote if you'd prefer.
That's got it!! Many, many thanks!
... and I spoke too soon. Oosh, I built it out a bit more to include the die combinations up through step 10, plus adding the exclamation point to make the dice explode... In doing so, I seem to have broken it. It currently looks like this: &{template:default}{{name=Earthdawn Dice}}{{Step ?{Step selection|1,1=[[ (1d4!-2)[S1]| 2,2=[[(1d4!-1)[S2]| 3,3=[[(1d4!)[S3]| 4,4=[[(1d6!)[S4]| 5,5=[[(1d8!)[S5]| 6,6=[[(1d10!)[S10]| 7,7=[[(1d12!)[S7]| 8,8=[[(2d6!)[S8]| 9,9=[[(1d8!+1d6!)[S9]| 10,10=[[(1d10!+1d6!)[S10] } + ?{Karma Step selection|1,(1d4!-2)[KS1]| 2,(1d4!-1)[KS2]| 3,(1d4!)[KS3]| 4,4=[[(1d6!)[KS4]| 5,5=[[(1d8!)[KS5]| 6,6=[[(1d10!)[KS10]| 7,7=[[(1d12!)[KS7]| 8,8=[[(2d6!)[KS8]| 9,9=[[(1d8!+1d6!)[KS9]| 10,10=[[(1d10!+1d6!)[KS10] } + ?{modifier|0}[MOD] ]]}} Up through Step 3, the result looks like this: what you did worked... what I added (starting at Step 4 with a d6) didn't work... it looks like this: I'm baffled as to why... NOTE: Please, no heroic effort needed here... I'm not looking to suck time out of your day. I'm just trying to wrap my brain around it...
... just like that, the light of understanding is turned on. Realized what had gone wrong and made the necessary fixes. All is well. Again, many thanks!! 
1592022792

Edited 1592022898
Oosh
Sheet Author
API Scripter
Ah yep, so the bold bits need to go: &{template:default}{{name=Earthdawn Dice}}{{Step ?{Step selection|1,1=[[ (1d4!-2)[S1]| 2,2=[[(1d4!-1)[S2]| 3,3=[[(1d4!)[S3]| 4,4=[[(1d6!)[S4]| 5,5=[[(1d8!)[S5]| 6,6=[[(1d10!)[S10]| 7,7=[[(1d12!)[S7]| 8,8=[[(2d6!)[S8]| 9,9=[[(1d8!+1d6!)[S9]|10,10=[[(1d10!+1d6!)[S10]} + ?{Karma Step selection|1,(1d4!-2)[KS1]| 2,(1d4!-1)[KS2]| 3,(1d4!)[KS3]| 4, 4=[[ (1d6!)[KS4]| 5, 5=[[ (1d8!)[KS5]| 6, 6=[[ (1d10!)[KS10]| 7, 7=[[ (1d12!)[KS7]| 8, 8=[[ (2d6!)[KS8]| 9, 9=[[ (1d8!+1d6!)[KS9]| 10, 10=[[ (1d10!+1d6!)[KS10]} + ?{modifier|0}[MOD] ]]}} We're already inside the inline roll at this point, which is why there's no "Karma step X" output... we don't want anything popping out of the query that isn't part of the math at that point in the macro, including that extra set of unclosed [[ The only reason it works in the first half with the initial Step selection Query is that it's outside the roll calculation, so outputting that integer for the "Step X" part works without messing with the math. Feel free to get rid of all the carriage returns again if you like - Query breaks is one of the few places you can use them without breaking stuff, and makes it a bit easier to read someone else's code!
Very much appreciated! 
1592024231

Edited 1592024534
Oosh
Sheet Author
API Scripter
No problem! Oh, I should add that the exception to this: we don't want anything popping out of the query that isn't part of the math at that point in the macro is the labels inside single square brackets. [Text in here] will pop up in the mouse over information without breaking the math. Also, the one GiGs posted will allow higher Step values without having to hard code them, if that's helpful.