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

Macro dice rolling... zero dice!

1630595494

Edited 1630601410
Soooo, I've set up a macro for the basic dice mechanic of a game I'm developing.  It's a d10 dice pool system with a target number of 5 or less.  Some dice are regular dice, while some dice (called feat dice) have exploding 1's.  Here's the macro so far:  /roll ?{number of Regular dice}d10<5 + {?{number of Feat dice}d10!1}<5 This works fine... until either of the values entered by the user are zero. It's entirely possible, even likely, that a player will have all regular and no feat dice. It's far less likely but entirely possible that the player will roll all feat dice and no regular dice.  The macro just doesn't work when either of the values entered is zero.  CORRECTION: The macro works only when the FIRST number is zero. If the second number is zero it returns no result for the dice roll.  Is there a clever way around this? On a related note, during especially epic encounters the GM may call on a player to roll the "Story Die" as well, which doesn't effect the dice pool results, but throws extra shenanigans into the mix, a bit like the Genysis system. This die has custom faces- four blank and six narrative symbols. For the sake of argument lets call one of these "Complication" I've created a roll table for this. It works fine.  I would love to be able to set up a "cinematic roll" macro which rolls both the regular macro described above AND  a roll on this roll table, and spits out the result on the same line. So  Four successes + "Complication".  Is there a way to do this? I read the "nesting macros" section and couldn't make much progress. I can get it to return both results with a single click, but they're on different lines, so not as easy to read at a glance Thanks in advance for any and all help! Totally new to all this Macro stuff. 
1630601578
timmaugh
Pro
API Scripter
It might be the braces  around your second roll (the feat dice). That shouldn't be needed, and was getting in my way as I tried various formatting iterations of your command. This works: [[?{Number of Regular dice|5}d10<5cs<5cf>11 + (?{Number of Feat dice|5}d10!1<5cs<5cf>11) ]]?{Roll Story Die|No, |Yes, + [[1t[StoryDie]]]} ...no matter if I put 0 in for either of the options. I converted it to an inline roll to let me do more on the line, like asking whether to roll against the StoryDie table. *That* roll is in a query, so it only happens if you hit "Yes"... you'll just have to make sure your table entries make sense for what you're showing (for instance, if you have a blank entry, this like will look like it ends in the '+' character... might not be what you're looking for. Also, since I switched to an inline roll, I included the success and failure commands to get your roll tip to format properly (green for successes, red for failures). I set the failure at 11 since I'm not sure 10 actually means anything in your game. If it does constitute a failure, change the 11s to 10s. If you want a more templated output, seeing the individual parts more clearly, here is the same thing as a roll template: &{template:default}{{name=Roll Outcome}}[[ [[?{Number of Regular dice|10}d10<5cs<5cf>11]]+[[(?{Number of Feat dice|10}d10!1<5cs<5cf>11)]] ]]{{Base Roll=$[[0]]}}{{Feat Roll=$[[1]]}}{{Total=$[[2]]}}{{Story Die=?{Roll Story Die|No,Not requested|Yes,[[1t[StoryDie]]]}}} This version reports that the Story Die wasn't requested, if you don't ask for it. Here's a screenshot of the outcome:
Hey Tim- thanks so much for your efforts, and advice. I have indeed  used the second version, which works beautifully. looking at the code it's all dutch to me, but that doesn't matter! 6-10's are fails (or at least, they are not successes) so I did as you suggested and changed 11 to 10. I'm assuming the way you've controlled the colour highlighting is with the cs (colour success?) and cf (colour fail?) commands? Not absolutely necessary but really cool to know. Thanks! Now, the version you've made does what I need, buuuuuutttttt.... it doesn't show the workings out. It's not a big deal, but I find my players really do like seeing what their dice results were, and especially, how many exploders they got! Is this particularly difficult to implement in the above macro? As I said, it's not that big a deal, so if it's particularly tricky or requires API scripts then we don't need it. but if it's not difficult to show the dice results as well, that'd be my preference. 
1630673391
timmaugh
Pro
API Scripter
For inline rolls (rolls coded between double bracket closures: [[ ... ]]), you see the individual dice by hovering over the roll in the chat and reading the roll tip. If you mean that you'd like to show the dice the way a message does when you start the roll with /r or /roll, then that method cannot be combined with a roll template, the way I did in the second example. In fact, when you mix numeric dice with a text output from the table in those sorts of rolls, the text drops out of the final total. You have to read it from a line up: However, you can't do that if your dice rolling is success based -- you can't mix success and sum rolls. One path that is open to you is to turn on 3d Dice, under the gear icon in the upper right above the chat panel. That way, the players see the dice rolling, and can quickly scan the results. Also, if there is any explosion, those dice hit the table-top with a slight delay, so the players have a clear indication that "this is my initial batch" and then... "Oh, that was an explosion"... and then "Oh, double explosion"... and then "Who's lucky tonight? This guy." and then... You get the picture.
Thanks again Tim- 3D dice would be the perfect solution, but it's nice to see a hover-over also works. Perfect! I'll get on with playtesting then :D :D!!