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

Macro for Attack that scales with level

If you query the level for the damage of an attack, can you use this same level input for the crit? I am building an attack for Shadow Blade and found a great damage macro from the keithcurtis in this older thread:&nbsp; <a href="https://app.roll20.net/forum/post/8047746/need-a-macro-for-shadow-blade#newtopic" rel="nofollow">https://app.roll20.net/forum/post/8047746/need-a-macro-for-shadow-blade#newtopic</a> So, for the Attack Damage, I have: ?{Level|2nd,2d8|3rd,3d8|4th,3d8|5th,4d8|6th,4d8|7th plus,5d8} My question is can I use this same input for the Crit?&nbsp; My DM does max damage for crit roll, so would it work to put this in the Crit? ?{Level|2nd,16|3rd,24|4th,24|5th,32|6th,32|7th plus,40} Meaning, would it just ask once for the level and calculate damage (and if a crit, max the secondary crit roll)?&nbsp;&nbsp;
1597004352
GiGs
Pro
Sheet Author
API Scripter
A query with the same name must always give the same output so you cant do it exactly like that. You should be able to do this (disclaimer: I dont use that sheet, so havent tested it): in damage: ?{Level|2nd,2|3rd,3|4th,3|5th,4|6th,4|7th plus,5}d8 and in critical, something like: (?{Level|2nd,2|3rd,3|4th,3|5th,4|6th,4|7th plus,5}*8)
Got it.&nbsp; Thanks!&nbsp; I appreciate the help.&nbsp; Now, I just need to roll a crit to test it :-)
1597040290
Oosh
Sheet Author
API Scripter
By the way, you don't need all the options listed on every use of the Query. ?{Level}*8 Will work fine in the crit field, as both fields are part of the same macro. Now, I just need to roll a crit to test it :-) Change the crit range to 2 to save yourself some clicking :)
1597075312

Edited 1597075368
GiGs
Pro
Sheet Author
API Scripter
Oosh said: By the way, you don't need all the options listed on every use of the Query. ?{Level}*8 Notice that there isnt a 1:1 correspondence between level and the level factor, which is why I left all the options in. OH! I realise now what you are saying. Yes, good point, you dont have to repeat the full query every time, just the title will do.
Oosh said: By the way, you don't need all the options listed on every use of the Query. ?{Level}*8 Will work fine in the crit field, as both fields are part of the same macro. Ah.&nbsp; I gotcha.&nbsp; You don't need to prompt for the level in the crit field, since the macro already has the value.&nbsp; I was thrown off like GiGs also since Level is not the level but the Value of level selected.&nbsp; So, got it now!&nbsp; Thanks both of you.&nbsp; And also, thanks for the tip on changing critical range to test it out.&nbsp; Very helpful!
1597088482

Edited 1597089465
Well, now that I can test the crit reliably, using the Level in the crit field doesn't work.&nbsp; Instead of taking the value of Level and multiplying by 8 for the crit, it takes the # of d8 from Level and multiplies by 8.&nbsp; So for Level = 2, instead of taking 2*8, it is taking 2d8 * 8 for the crit.&nbsp;&nbsp; Right now, I have this working but I have to query the spell level twice, once for damage and again for crit calculation.&nbsp; Using the same variable for both simply doesn't work.&nbsp; That would be nice, but it's just one extra click to get the right number, so it'll work for now. damage: ?{Level|2nd,2|3rd,3|4th,3|5th,4|6th,4|7th plus,5}d8 critical: (?{Crit|2nd,2|3rd,3|4th,3|5th,4|6th,4|7th plus,5}*8)
1597089629
GiGs
Pro
Sheet Author
API Scripter
That's cnfusing - is critical damage normally a fixed multiple of x2 or whatever, on that sheet? One thing you could do is use the description field, but it'll show up on every attack. You'd need to wrap any rolls in inline brackets [[ ]].
1597091181

Edited 1597092283
OK.&nbsp; I'm an idiot.&nbsp; I had my original syntax for damage which hard-coded the xd8 which is why this was getting passed to the crit calculation.&nbsp; Once I fixed the damage calculation to what I *thought* I had and what you suggested, everything works.&nbsp; Sorry for the confusion and churn and thanks a ton for the guidance and help!