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

Wild Magic Surge

Hi, I am new to API scripting, and I am kind of stuck on the basics here. Let me outline what I want real quick. I have a Wild Magic Sorcerer, and I am trying to make his gameplay with the Wild Magic Surge Table as easy as possible. So what I would like is a Macro that he can run, that will give a command. That command will essentially roll a d20, check if its a 1, display the result regardless, and then add on a roll of the Wild Magic Table if the result is a 1. My idea was basically to have the script create a trait template output the info, using the template below. (Mocked up for general idea of use) &{template:traits} {{name=Wild Magic Check}} {{source=Character Building}} {{description= Rolling Wild Magic Surge: [[1d20]] Wild Magic Table Roll if 1}} I like the way this looks and I use it for a lot of my macros, so having this be the intended output would be amazing. Really I guess my question is, how do I craft output like this to display how I want? The actual logic of rolling and checking for a 1 is the easy part. I just need to know how to output right.
I use Powercards fpr pretty much anything, so my solution requires the powercards api. I don't even know if standard macros support conditionals. In powercards it would be somewhat like this: !power {{ --hroll|[[ [$Surge] 1d20]] --name|Wild Magic Check --leftsub|Source --rightsub|Subclass --Wild Magic Roll:|[ ^Surge.base] --?? [$Surge.base] = 1 ?? Wild Magic activated:| Roll on Wild Magic Table }} To actually roll on the wild magic Table you could use the recursive tables api with something like this: !rs [[ 1t[Wild-Magic] ]] to combine those two you can probably do something like !rs !power {{ --hroll|[[ [$Surge] 1d20]] --name|Wild Magic Check --leftsub|Source --rightsub|Subclass --Wild Magic Roll:|[ ^Surge.base] --?? [$Surge.base] = 1 ?? Wild Magic activated:| [[ 1t[Wild-Magic] ]] }} This is untested and out of the top of my head, and I probably made some stupid mistake, but you should get the principle.
Okay awesome! So this is working great. Like you said a few small changes needed to happen to make it work (no big deal, this was already a HUGE help) !power {{ --hroll|[[ [$Surge] 1d20]] --name|Wild Magic Check --leftsub|Source --rightsub|Subclass --Wild Magic Roll:|[^Surge.base] --?? $Surge.base == 1 ?? Wild Magic activated:|[[ 1t[Wild-Magic] ]] }} Recursive tables were not necessary. The double command of "!rs !power" didn't even run. "$Surge.base" didn't need to be in brackets. Double equals were required for the conditional "--?? $Surge.base == 1 ??" Thank you for the help. I might get addicted to these things now.
Wab said: Thank you for the help. I might get addicted to these things now. A real Danger...PowerCards just look so much better, than the standard templates, especially once you start customizing their looks. ^^ As I said...a bunch of really stupid mistakes, I always have them in the first versions of my macros...I probably spens more time fixing those stupid mistakes than actually writing macros xD But I'm glad you figured it out :)