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

I'm trying to build some Mordhiem macros but I'm very new to writing macros.

1572738733

Edited 1572738964
Basically what I need to figure out how to do is write a macro that does 1d6 if the result is greater than x than y. Is something like this possible? If you're familiar with Mordhiem then you have an idea what I'm trying to do I hope. If it is possible to have the x be modified then that would be ideal. For example. 1d6 if ?>4 then y with ? being filled in by a pop up box or something. 
1572745254

Edited 1572745279
Pat S.
Forum Champion
Sheet Author
With the standard dice roller, it is not possible to do "if than" mechanics but you can probably use an API script (you are a pro sub but you would have to be the game creator also) that is already written or have it written (or write it yourself) to perform this function for you.
I am the game creator and I have no idea how to do that 
1572745665
Mike deBoston
Compendium Curator
I think you need the API for conditionals, but if you have two possible results for a die roll, create a macro that shows the die roll and both results. The player can read and choose the correct result and ignore the other.
1572756402

Edited 1572756926
Mike deBoston
Compendium Curator
I read this again and I think you want to ask the user for X, then roll a d6 and see if it is larger than X. /roll 1d6>?{target number} Will print '0 successes' if they missed it, or '1 success' if they rolled the target number or more. (The > symbol really means >= in this case.) or [[1d6>?{Target number}]] Will print 0 or 1. Now, suppose if you succeed you do 3d8 damage. You can multiply successes (0 or 1) by 3d8, so if you fail the damage is 0, succeed it's 3d8: [[ [[1d6>?{Target number}]] * 3d8 ]] I'm not sure why, but the d6 will not be shown in the 3d dice roll, but the 3d8 will roll on the table. But if you hover over the results, you can see how the roll was calculated.
1572768730

Edited 1572770931
GiGs
Pro
Sheet Author
API Scripter
James B. said: Basically what I need to figure out how to do is write a macro that does 1d6 if the result is greater than x than y. Is something like this possible? If you're familiar with Mordhiem then you have an idea what I'm trying to do I hope. If it is possible to have the x be modified then that would be ideal. For example. 1d6 if ?>4 then y with ? being filled in by a pop up box or something.  It would be easier to give concrete solutions if you filled in more details. What is the roll before the if, and what is the roll after the if? What will your desired output look like? Mike's suggestion might be the best way, so an API script might not be needed. If it is, we could make one - but we'd need all the very specific details.
I think his script will work here. I'm trying to give it as best as I can explain it.