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

Why isn't this macro working?

Hey, I'm just wondering why this macro isn't working. I've got two macros here: This one works: [[ ({@{casterlevel})d6 ]] -> Gives proper output, i.e. if my @{casterlevel} is 16, it rolls a 16d6. However, this one doesn't: [[ ({@{casterlevel},10}kl1)d6 ]] -> It gives a result of 10. I've tried some things to work it out but I'm just not getting it. I'm trying to make it so that it never rolls over 10d6, even if my casterlevel is 20 or whatever. I think I'm just missing something really obvious.
1526307745
The Aaron
Pro
API Scripter
{@{casterlevel},10}kl1 Assuming casterlevel is 16, this is working correctly.  kl1 is "Keep Low 1", effectively making 10 the maximum possible value.  10 is lower than 16 and is thus kept instead of the 16.  kh1 is "Keep High 1" would choose the 16 as being higher than 10, thus making 10 the minimum possible value.
1526308419

Edited 1526308859
The Aaron said: {@{casterlevel},10}kl1 Assuming casterlevel is 16, this is working correctly.&nbsp; kl1 is "Keep Low 1", effectively making 10 the maximum possible value.&nbsp; 10 is lower than 16 and is thus kept instead of the 16.&nbsp; kh1 is "Keep High 1" would choose the 16 as being higher than 10, thus making 10 the minimum possible value. But it is not rolling it by d6, which the former example does. It should be rolling a 10d6; it does not. It just outputs "10". Edit: Here's the "roll" it does, for reference:&nbsp; <a href="https://i.imgur.com/PYPCVkU.png" rel="nofollow">https://i.imgur.com/PYPCVkU.png</a> If my casterlevel is 8, it will output 8. If it's 6, it'll output 6. If it's 20, it'll output 10. If it's 10, it'll output 10. This is in contrast with the original macro, which does roll properly, but then the problem becomes that it outputs a 16d10 if my casterlevel is 16. And I just don't understand why it's not rolling properly when I tell it to kl1 out of "@{casterlevel}" and "10".
1526308743

Edited 1526308802
The Aaron
Pro
API Scripter
OH!&nbsp; Sorry.. misunderstood the issue. Try: [[ [[{@{casterlevel},10}kl1]]d6 ]] (That will teach me to skim forum posts and reply!&nbsp; It was right there in the last paragraph. =D )
Oh, man, thanks a lot! That works perfectly! By containing the "kl1" part in it's own "roll" which then is part of a roll containing the d6, it works. While simple, I could never have realized that on my own. Thanks so much!
1526315553
The Aaron
Pro
API Scripter
No worries!