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 .
×

Macro question

1487522045

Edited 1487523773
My question is: I want to use this function [[1d20>10]] on bigger macro is it possible? Here is my macro [[floor((1d40)+(1d(@{agi}*2)))]] > [[floor((1d40)+1d(@{target|Target1|agi})+1d(@{target|Target1|def}))]] **It rolls 1d40+1dAgility*2 vs 1d40+1dAgility+1dArmor to check if i made a hit** And result is like 20 > 10 But i also have crit chance checker and dmg in this script, so its a bit huge and it would be much better if it would show 1 if hit and 0 if miss or something similar. So i want to use this function [[1d20>10]] or  something similar so it would show if i landed a hit or no, is it possible? THX for help!
1487524176

Edited 1487524247
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, you just need to add another layer of inline roll brackets: [[ [[floor((1d40)+(1d(@{agi}*2)))]]>[[floor((1d40)+1d(@{target|Target1|agi})+1d(@{target|Target1|def}))]] ]] Edit: and remove the spaces around the > symbol.
Hmm i tried it but it haven't worked ill try it again one moment.
1487524358

Edited 1487524522
I have tried what you have posted and result it shows 10  BTW if ledt side is simpel it works for exampel if on the left side is just 1d40
1487524603

Edited 1487524951
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
yeah, I just tried that, and I would have thought it would work, but apparently not. A work around is to turn the result of your two rolls into other rolls: [[ [[floor((1d40)+(1d(@{agi}*2)))]]d1>[[floor((1d40)+1d(@{target|Target1|agi})+1d(@{target|Target1|def}))]]d1 ]] EDIT: A better way is to use the grouped roll formatting actually (don't know why I didn't try that first): [[ {floor((1d40)+(1d(@{agi}*2)))}>{floor((1d40)+1d(@{target|Target1|agi})+1d(@{target|Target1|def}))} ]] EDIT the second: Also, not sure why you're using the floor function here. This is all addition and multiplication. Even if your agi or def attributes can have decimal points in them, the decimal point will be dropped by virtue of being part of a XdY, so you could actually write this much cleaner as: [[ {1d40+1d(@{agi}*2)}>{1d40+1d(@{target|Target1|agi})+1d(@{target|Target1|def})} ]]
macros is much bigger i just copied main part yep for it floor is not needed) THX ill try it
1487528260

Edited 1487530130
Hmm it says SyntaxError: Expected [0-9] but "{" found. Edit [[1d40>[[1d40+1d@{target|Target1|Agi}+1d@{target|Target1|Def}]] ]] This works fine, but then i try putting left side in {} it makes error even with simple stuff like {1d10+1d10}, but {1d10+10} works and it is really strange... I think it doesn't want to do 2 rolls in {} if it has > after it and i have 0 ideas how to fix it Edit 2 If i use [[ {1d10+1d10}>1]] it says  Only one roll expression is allowed in a single sub-roll expression success check Maybe someone can help coz i really have no idea how to fix it...
1487535970

Edited 1487536004
If i use [[ {1d10+1d10}>1]]   Shouldn't the {} be()?
1487537859

Edited 1487537941
al e. said: If i use [[ {1d10+1d10}>1]]   Shouldn't the {} be()? Try, it still doesn't work, even if you use [[ (1d10+1d10)>1]]
1487538568

Edited 1487538685
This should work: [[ {1d40 + [[1d(@{agi}*2)]]}>[[1d40 + 1d@{target|agi} + 1d@{target|def}]] ]] or /r {1d40 + [[1d(@{agi}*2)]]}>[[1d40 + 1d@{target|agi} + 1d@{target|def}]]
WOW that's all i had to do? i tried sooo many ways THX now battle will be much nicer!