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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Macro help

Hi  I wan to write a damege macro which rolls a 1d6 against a variable target number which is the target Tougness+4 minus the attacker (selected) strength  something like: /r 1d6>4 + {@{target|T} - @{selected|S} + {weapon strength?|0}  also i want to add an expection to the minimum target number is 2. Ofcourse it is not working..... Anybody can help?
1471352366

Edited 1471353495
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You're close try this: /r 1d6>{(4 + {@{target|T} - @{selected|S}),2}kh1 + ?{weapon strength?|0}
task but that does not work either.... What i got now is: /r 4 + @{target|T} - @{selected|S} + ?{weapon strength?|0} which gives the the target number but without the minimal
The original is fine; you're just missing a question mark on the last query piece. /r 1d6>4 + {@{target|T} - @{selected|S} + ? {weapon strength?|0} Scott's suggestion is also valid, but the two methods will have different effects depending on what you're going for. If you want to roll a d6 and count a 4,5,or 6 as "1" success, add that "1" or "0" to the target's "T" attribute and then subtract your own "S" attribute from it, and then subtract a prompted "Weapon Strenght" value, your original does that. Scott's variation will add targets "T" attribute, subtract your own "S" attribute (or a static "2" if it's higher than the stat), and then add the "Weapon Strenght" prompt.   That result will determine which dice are counted as successes in the 1d6 roll.  (ie: If that ultimate result is a '3', the 1d6 will count 3 or higher as a success.
The Story about this: I'm co-gm-ing in a Mordheim skrimish game which was left by the original creator and It is needed to change the melee, shooting and wounding macros.  
1471365560

Edited 1471365701
Mátyás Czank said: macro which rolls a 1d6 against a variable target number which is the target Tougness+4 minus the attacker (selected) strength also i want to add an expection to the minimum target number is 2. Try this: /r 1d6>[[ {@{target|T} + 4 - @{selected|S}, 2}kh1 ]] + ?{weapon strength?|0}
Working perfectly thanks guys. If  I can have a couple more question: so if I only want test 1d6 against Target Tougness+4-attack strength min 2 would be: /r 1d6>[[ {@{target|T} + 4 - ?{attack strength?|0}, 2}kh1 ]] and if i want to ad an attacker strength or attack strength: /r 1d6>[[ {@{target|T} + 4 - ?{attack strength?|0|@{selected|S}|}, 2}kh1 ]] S stands for Strength T for Toughness
1471382251
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This section: /r 1d6>[[ {@{target|T} + 4 - ?{attack strength?|0|@{selected|S}|}, 2}kh1 ]] is a little wonky (probably just typos). But I think what you want is: /r 1d6>[[ {@{target|T} + 4 - ?{attack strength?|0} - @{selected|S}|}, 2}kh1 ]] or /r 1d6>[[ {@{target|T} + 4 - (?{attack strength?|0} + @{selected|S}|}), 2}kh1 ]] or /r 1d6>[[ {@{target|T} + 4 - @{selected|S}|}, 2}kh1 ]] if you meant to replace the query with the selected attribute call. Other than that, it looks good.
1471392941

Edited 1471393014
Mátyás Czank said: ?{attack strength?|0|@{selected|S}|} You might want to remove the extra | at the end of this dropdown Roll Query. A non-dropdown alternative would be ?{attack strength?|@{selected|S}}