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] Another number-of-dice problem

Last time I had a similar problem, I was shown a work-around to do ceil() with number of dice. I'm hoping there's another workaround for my current situation. I have a macro where I need to compare the character's @variable to 10 and drop the higher one (or keep the lower one). If I use: [[ @{Character|variable}d6 ]] it works fine, but as stated, it has a maximum legal value of 10. Both of these: [[ ((@{Character|variable},10)kl1)d6 ]] [[ ((@{Character|variable},10)dh1)d6 ]] cause it to throw an error. Of course I can use the working version until I hit variable=10 and change it to a static 10d6, but I'd rather write macros that take care of themselves, so to speak. Is that possible here?
Forum Champion
At this time, the only way to get what you want is to use a regular roll and inline the drop/keep portion. /r [[{@{Character|variable}, 10}kl1]]d6

Edited 1404567842
Jason H.
KS Backer
Thanks for that! Works like a charm. Inline result would be prettier, but I prefer form over function function over form if I have to choose. Thanks again.
Off topic but closest I could find, and didn't want to start a new thread. So forgive me if this is poor form. Is there any reason: /w gm @{Aradan|character_name} - : [[d20+@{Aradan|?{skill|Perception} }-?{Modifier|0}]] isn't working as I hoped? Was wanting to use this as a general skills check for the character Aradan. It should prompt for a skill or default to Perception then make the roll. But it is telling me something along: d20+Aradan|Bluff-0=(15) it isn't actually resolving the @{character|?{variable}} any work around or am I asking too much of the dice roller? Again, sorry if I should post this in new thread, it just seemed like you had your answer and were knowledgeable and I didn't want to junk the forums with new threads. --Pad
It would seem the data from the character sheet is gathered prior to the user input, so from the looks of it, there's no way to do what you want. I've been trying to think of a way how to do it differently so it would work, but I can't figure anything out. I suppose it would be possible using the API but short of that, I don't think so.
Forum Champion
A query inside an attribute will not function.
Thanks guys! And there aren't any global variables? like $skill=?{skill|Bluff} that you can use across multiple macros?