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

Using +?{Modifier|0} to modify attribute in macro

1413180700

Edited 1413183816
I've been in a few campaigns now, mostly Warhammer 40k and I am wanting to have my macroes roll a d100 then check my characteristics (attributes). Currently I have this macro. /me swings his chainsword at the enemy [[d100<@{WS}]] the blow does [[d10+2]] damage. Which is simple enough, tests my Weapon skill and tells me if I fail/succeed with a 0 or 1. But I am wanting to use the +?{Modifier|0} thing so that if I have any buffs or debuffs it will modify my Weapon Skill. I have tried all different combinations and it doesn't seem to work correctly so I am thinking that its just not possible but I thought I would try to get help here first before I give up.
1413184330
vÍnce
Pro
Sheet Author
I don't think the compare operation < and > allow for the additional operation. At least I couldn't get it to work... You can do the comparison "visually" using something like; /me swings his chainsword at the enemy Roll: [[1d100]] WS: [[{WS}+?{Modifier|0}]] the blow does [[d10+2]] damage.
1413193690
Gen Kitty
Forum Champion
What happens if you try this? (I'm on laptop, laptop doesn't like the roll20 gametable or I'd test it myself) /me swings his chainsword at the enemy [[ d100 < (@{WS}+?{Modifier|0}) ]] the blow does [[d10+2]] damage.
1413194441

Edited 1413194515
Finderski
Pro
Sheet Author
Compendium Curator
GenKitty - it doesn't like the parens in that formula. The only way I've found to get this work is by using this: /me swings his chainsword at the enemy /r 1d100<[[@{WS}+?{modifier|0}]] the blow does [[d10+2]] damage. Because, as I understand it the, the evaluation requires a single number, so using the inline roll to add the modifier accomplishes that. Given that, I do think Vince has the better solution, because the output is a bit cleaner and easier to read. Just my opinion, though.
1413207672
Lithl
Pro
Sheet Author
API Scripter
You could subtract the modifier from the d100 instead of adding it to your weapon/ballistic skill. You'd get the same odds.
1413241100

Edited 1413241158
Gauss
Forum Champion
You cannot have multiple terms after an inequality. However, as Brian stated, you can rearrange the terms of the inequality and it will work fine. Note: you need to group the first half of the inequality in braces {} and not parenthesis (). This will do what you need it to: /me swings his chainsword at the enemy [[ {1d100-?{Modifier|0}}<@{WS} ]] the blow does [[d10+2]] damage.
Awesome it works now. Thank you for the help everyone.