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

Custom Sheet: None and macro

Hello there, I have tried to set up character sheets for Advanced Fighting Fantasy as none was available for the game. I am not used to macro and I was wondering how I could get a macro to test against a characteristic? So I wanted to roll 2d6 and had to roll under 10, what would the macro be? Thanks
1600549236

Edited 1600549267
David M.
Pro
API Scripter
Note sure if this is the easiest way, but this seems to work. Note <9 means less than or equal to 9. [[ {[[2d6]], [[10d1]]}<9 ]] This is a combination of target number rolls and grouped rolls, described here . The 10d1 will never be less than ten, will just return 0 or 1 success based on the sum of the 2d6 roll. Or, you could put it into a template, like  &{template:default} {{name=Add title here}} {{Result = [[ {[[2d6]], [[10d1]]}<9 ]] }}
1600550462
GiGs
Pro
Sheet Author
API Scripter
Just to clarify: is 10 your characteristic score, and you want to show success if you roll under that, or failure if you roll over? If that's the case, you can do /roll 2d6<10 or  [[2d6<10]] If you want to test against a named characteristic, like say strength, you can use /roll 2d6<@{selected|strength} [[2d6<@{selected|strength} In the last two cases, you would need a token representing a character, and when you have that token selected, the roll would get the linked characters strength score.
1600551721
David M.
Pro
API Scripter
When I try 2d6<10, it looks like it is testing each d6 against the target number. That's why I went through all the rigamaroll with the grouped roll above. I also thought the < meant "less than or equal to". Is that not the case?
1600552877
GiGs
Pro
Sheet Author
API Scripter
Oh yes, you;re right - its too close to my bedtime! In roll20 < does mean less than or equal to, but I was thinking OP was using it as a target to roll under, which in RPGs usually does mean "equal or under". By the way, a cleaner alternative to 10d1 is 0d0+10. This is because for some rolls when you use this, you'll see the ten 1s, and the output is not neat. In your roll its hidden inside a nested inline roll so wont show up, so it doesnt matter here - but I thought I'd mention it for future use.
Thanks GIGs and David. I have the same issue as David when I try to test the LUCK characteristic: /roll 2d6<@{LUCK} The macro is checking if each individual d6 his under the LUCK characteristic as opposed to the sum of both dice. Is there a way to test the total of the the 2 dice against LUCK?
1600553750

Edited 1600553842
David M.
Pro
API Scripter
Did you try my first suggestion? Adjusted for GiGs' "best practices" tip, it would be: [[ {[[2d6]], [[0d0+10]]}<@{LUCK} ]] EDIT - if you needed to roll UNDER the Luck value, and not equal to or less than, you would something like: [[ {[[2d6]], [[0d0+10]]}<[[@{LUCK}-1]] ]]
1600553974

Edited 1600554032
Thanks David. I get a 1 or 2 as an output. I need to roll less or equal than.
1600554352
David M.
Pro
API Scripter
Sorry, second "roll" should always be above the LUCK value, so it will always fail. Try: [[ {[[2d6]], [[ 0d0+ @{LUCK}+1]]}<@{LUCK} ]]
I get a 0 or a 1 as an output now.
1600555636

Edited 1600556174
David M.
Pro
API Scripter
Isn't that what you want? It is returning success (1) or failure (0). If you mouse over the result, it will display the actual roll (including the "dummy roll 11) EDIT - If you want to see the expanded view of the rolls instead of the condensed inline roll, you could just use /r {[[2d6]],[[d0+@{LUCK}+1]]}<@{LUCK}
1600556622
GiGs
Pro
Sheet Author
API Scripter
in roll20, when looking for success or failure, it will show 1 for success, and 0 for failure. If you expand to the full roll, like in David/s last part, it'll still show 0 or 1, but it will add the text "successes". By the way, you dont need to include those inner inline roll brackets. This will work: /r {2d6,d0+@{LUCK}+1}<@{LUCK} and [[ {2d6, 0d0+ @{LUCK}+1}<@{LUCK} ]] You might want to leave the brackets around the second inline roll for neatness, so that it shows as just a single number - you dont need to see the working there.
1600557224
David M.
Pro
API Scripter
Good call, GiGs! I almost never use grouped rolls, and seems like that makes it easier to read. Interestingly, though, it looks like if you include the brackets for one of the rolls, you must include for both or else nothing happens. Julien, you can also suppress the critical success/failure colors from showing up if you want by adding an impossible "cs" target to the rolls. All of this, added back into a template form for readability would give you something like &{template:default} {{name=Add title here}} {{Num Successes= [[ {2d6cs13,d0cs1+@{LUCK}+1}<@{LUCK} ]]}}
Thanks everyone! I am loving macros more and more!
1600596479
GiGs
Pro
Sheet Author
API Scripter
David M. said: Good call, GiGs! I almost never use grouped rolls, and seems like that makes it easier to read. Interestingly, though, it looks like if you include the brackets for one of the rolls, you must include for both or else nothing happens. Interesting, I didnt realise that. Now, in a grouped roll if you include a die roll, all items must be die rolls. And if it's just a base number with no roll, then all items in the group must also be numbers. I wonder why inline rolls are not being recognised as rolls - maybe they are being treated as numbers.