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

Is there a way to perform n{d10+6}?

I've been messing around with my attack macros, and this is what I've put together so far: Full Attack dealing [[{{d20+17+?{Attack|0}}>@{target|AC},{d20+12+?{Attack|0}}>@{target|AC},{d20+7+?{Attack|0}}>@{target|AC}}*{d10+6+?{Damage|0}}]] damage. This rolls all three of my attacks vs the target's AC, totals the successes, then multiplies the sum by my damage roll. It works, sort of; at the moment the best I can manage is to multiply a single damage roll by the number of hits. My goal is to roll the damage roll once for each hit, so it would output 2d10+12 rather than (1d10+6)*2. Is there any syntax that would allow me to do this? EDIT: Basically, the attack rolls can be replaced by X, making the macro portion I need aid with X*{d10+6+?{Damage|0}}
1421945419

Edited 1421945501
Well couldn't you just break it down into individual inline rolls within the same macro? [[{{d20+17+?{Attack|0}}>@{target|AC}}*{(d10+6+?{Damage|0})}]],[[{{d20+12+?{Attack|0}}>@{target|AC}}*{(d10+6+?{Damage|0})}]],[[{{d20+7+?{Attack|0}}>@{target|AC}}*{(d10+6+?{Damage|0})}]] This will output 3 different values on the same line, then you simply need to add them up. FYI... I couldn't test the above because I didn't have a system setup with that AC target, but tested this with raw numbers and it seems to work. So you may need to check the various { and } to make sure they are setup properly. This will output say "15, 0, 9", meaning the first and third attack hit.
Yeah, that's how I have it running currently, but lately I've been experimenting with condensing it into a single value.
Unless one of the other macro guru's have an idea, then I don't believe it is possible without writing an API script. The problem is that you want to roll on an attack individually (creating a value), then be able to add the results of that value giving a single result. You can't really nest rolls within rolls... and you have the additional complexity of using a comparison, which adds it's own challenges.
That's what I thought. Fortunately, it doesn't impact the functionality, it was purely an aesthetic choice. Thanks for the response!
1421947709

Edited 1421947737
Lithl
Pro
Sheet Author
API Scripter
If I understand you correctly, you're wanting {d10+6+?{Query}} performed N times? Why not just use Nd10 + N * (6 + ?{Query}) Please let me know if I've misunderstood your request.
1421949295

Edited 1421949691
N is determined by the number of successes, which may allow for Nd10 (I think it would work) but that result isn't maintained to allow for the " + N * (6 + ?{Query}) " portion, would it?
1421949788
Lithl
Pro
Sheet Author
API Scripter
No, it wouldn't be.
1421951639
Sungrass
Plus
Sheet Author
{Nd10+X}>Y will work like you want it to. Rolls N number of d10s, adds X to each of them and compares the result to Y.
1421952851

Edited 1421952896
@Calle - Unless I am misunderstanding you, I don't believe this will help the use case. In this case he is checking an attack roll vs. a targets armor class (AC) 3 times, each attack roll that is greater than the AC counts as a success. Then he wants to use each success to automatically roll "1d10+6+?{damage mod|0}", then he wants to add all of the damage together to get a single damage result. I don't think he can do all of what he wants in a single macro... but again maybe someone has an innovative idea around solving this.
1421955059
Sungrass
Plus
Sheet Author
It will tell him how many attacks succeed. That number can be used to determine the number of damage dice to roll. This doesn't do all of it, but it eases the process slightly. Something like /roll {[[{Nd20+X}>Y]]d10+Z}>0 will roll all the damage dice. What it won't do is add Z to the damage dice or total them up, but I think this is far as you can get with a macro.
I am guessing he is playing 3.5/Pathfinder based on the math. Sure, I see what you are saying, but the problem is Z is also dependent on the number of successes because each attack does 1d10+Z, so even if you use N as the number of successes you would need to do Nd10+(N*Z), which can't be done in the macro.
1421956083
Sungrass
Plus
Sheet Author
Yes, that is the problem. The Z is mostly there as a mental note rather than fill any mathematical function. Again, this is a partial solution, not a complete one.