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

Variable number of dice without user input

Hi all, I'm trying to create a macro that rolls a number of attacks based on the npc's remaining health. I thought I almost had it but I need a way to roll a variable number of dice without user input. this is the current code im working on: [[(round(@{selected|npc_HP|current}/@{selected|HP|hitdice})) d4]] but it can easily be simplified to: [[NUMB d4]] where NUMB is the number of dice I want to roll. I know its possible to pass the value via a user input box (eg: ?{user number?|=1})) but is it possible to generate this number on the fly?
[[ [[round(@{selected|npc_HP}/@{selected|hitdice})]]d4 ]] So long as @{npc_HP} and @{hitdice} are Attributes on the Character linked to the selected Token, these adjustments should make what you are working on functional. Please let us know whether this answers your question.
Yes, thank you that seems to have done the trick. Thanks very much, that was driving me crazy!