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

Mirror Image in Combat

Trying to come up with a macro that queries the number of images the target has and then roll that number + 1 as a die roll. For example, the target has 4 images. The query input would be 4 and the macro would roll d5 to determine whether an image or the actual target was struck (i.e. a result of a "1"). Read through the Advanced Macro wiki and didn't find an answer there. Thanks.
I think I found my answer by trial and error. /w GM ?{# of Images} [[1d(?{# of Images}+1)]]
1606504134

Edited 1606504244
Kraynic
Pro
Sheet Author
If you have a spare token bar on that character, you could make a custom attribute like "images" and link it to that bar to make tracking the remaining images easy.  Then you could have a macro that used that value to generate your dice: [[1d[[@{Bob|images}+1]]]]. I suppose it could be done without making an attribute also.  Just use selected or target with the bar (alter for whichever bar you use: [[1d[[@{target|bar3}]]]]. Edit: I guess I misread and thought you already had a query but wanted to go about it a different way.  Oh well, glad you figured it out!