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

The Wild Surge rolling

I have a two part wild magic surge thing going on.  It starts with this: &{template:simple} {{rname=Wild Magic Surge}} {{r1=[[d20cs>[[@{selected|bar3}]]]]}} {{normal=1}} {{Phaba=Phaba}} What needs to happen is that if the roll is less than the number (that we manually change each time) in bar 3, it tells us that a wild surge happens.  Then I have a table that the player can roll on and it randomly chooses a result from that table. Question:  Can I have it auto roll from that table of the target number is reached?
Macros can’t do any conditional or if -> then logic. So the two best options for you would be to create a second macro for the actual Wild Magic Surge and have that as a button that can be clicked at the bottom of the roll output. Or you could add it so it always gets rolled and displays with the roll, but you only act on it if the target roll is reached.  If you have a Pro subscription you could use an API script to automate the if -> then logic and only display the Wild Magic Surge if the target is reached. 
Thanks,  I do have two things going on here.  One is just a macro that rolls to see if the number in bar 3 is equal to or greater.  If it is, the surge goes off.  Then the player hits the Wild Surge macro to roll on the surge table. I was just hoping to combine them.  If the roll is equal to or greater, it then rolls from the table.
You don't need conditional logic however. Through the use of "target number/successes" roll modifier you can generate a 0 or 1 and then use that number to roll the wild surge table. So you either do 1t[wild-surge], which rolls on the table, or 0t[wild-surge] which just returns 0. I don't know the D&D templates that well but this should work &{template:simple} {{rname=Wild Magic Surge}} {{r2=[[ [[{[[1d20cs>[[@{selected|bar3}]] ]],0}>[[@{selected|bar3}]] ]]t[wild-surge] ]]}} {{r1=$[[1]]}} {{always=1}} {{Phaba=Phaba}} I believe it'll show your roll with cs colouring in r1 and in r2 show a wild surge roll if your roll meets or exceeds @{selected|bar3} otherwise show 0. You will need to change the table name to what it actually is in your game.
Excellent, that works.  It does pull up quite a long (entire chat window) inside the simple template of what the surge effect is. Now I need make it emote that rather than full long dialogue. thank you so much.
The first example is what i've done, and the second is the one you've done for me. I'm hoping to emote the result to keep it condensed.
I've got it down to this: &{template:default} {{name=Wild Magic Surge}} {{r2=[[ [[{[[1d20cs>[[@{selected|bar3}]] ]],0}>[[@{selected|bar3}]] ]]t[Wild-Magic] ]]}} {{r1=$[[1]]}} But I don't really need it to say R2 or R1, or be all yellow.