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

Confused about 5e Wild Magic Surge API

1632842893

Edited 1632842974
Joel
Pro
We have a wild magic sorcerer joining the game for the first time. As I researched ways to automate the Wild Magic Surge rolls, I kept reading comments like "not without the API" and "you need to have the API". I can't figure out what API people are talking about. I do have a pro account and I use a few APIs, but I am by no means very versed in them. We use the 5eOGL character sheet. I looked through all the APIs that are listed in the game's set up page, but none seem to fit. I successfully added nmrcarroll's MagicalSurges.js from github and it does roll a d20 every time the sorcerer casts a level 1+ spell, but when the result is a 1, it does not automatically generate any surge from the wild magic effects rollable table. So I guess my question is two part... is there something like an "official" API for this that everyone is probably referencing when they say "the API"? Any idea which one it is? And secondly, maybe the MagicalSurges.js API is just fine, and there is something I need to do/change so that it will automatically retrieve a result from the rollable table when the d20 =1. Thanks for any guidance. 
1632846538

Edited 1632846646
You are more confused with the feature then the API it seems.  Wildmagic surge is designed to run linked to the other feature "Tides of Chaos."  And more importantly, WMS only fires when a leveled sorcerer spell is cast, not when a sorcerer casts any leveled spell.  If they are multiclassed, the sheet cannot tell that their cure wounds from cleric is not a sorcerer spell.  I don't know what API you are running but all you really need is a lil macro and a built rollable table.  WMS needs the DM's input to know its suppose to fire, setting it to automatic is impossible without omitting a ton of conditions.  Furthermore, WMS automatically happens when Tides is currently expended, you get tides back and the WMS just happens, no d20 roll required, its automatic.  When you cast a leveled spell and Tides is not expended, THEN the "DM can" have the player roll a d20, if they Roll a 1  on a d20, then they can roll on the WMS table to see what happens.  I don't know what API you are talking about but I for one, would not use an API for that feature.  I instead built a rollable table, built a macro to fire it, added in the feywild shard macro as well, and over time my players have approached me with custom new effects that I have just added on to the end of the WMS table over time.  
If you are gonna use any API for the WMS feature it'd probably be Recursive tables or table import to cut corners and import other DM's WMS tables.  
1632847113

Edited 1632849015
Joel
Pro
I am familiar with those aspects of WMS, and ToC, but in this instance the sorcerer will only be casting Sorcerer spells, and the d20 will be rolled every time he casts a leveled spell to see if a WMS effect is called for.  The code of the API is doing what I expected, it is rolling a d20 every time a leveled spell is cast by the sorcerer. That is built into the API. However, on a result of 1 it appears that the API is supposed to automatically roll on the WMS table and put the results in chat (or /w to the GM). That's the part that does not seem to be working as intended. When it rolls a 1, no WMS is generated from the rollable table, so someone needs to manually do so. From the code, I get the feeling it is supposed to automatically parse the rollable table for you and output the results to either the public chat or as a whisper to the GM. Since that might be straying outside the domain of this forum, I'll move my questions about this specific API over to the API forum. If anyone else has thoughts on "the API" that people might be referencing, I'd be happy to try another one.
1632906168

Edited 1632906514
90% of the surges are going to fire automatically regardless of the d20 roll.  I feel like you don't understand the core mechanic of the class.  The d20 is only when the sorcerer casts a leveled spell and their tides of chaos is not expended, so typically this will happen on round 1's before the sorcerer has cast their cantrip attack/spell attack and is forced to shield or counterspell, or when its not combat and the sorcerer needs to cast some non combat spell.  If their tides is down, and a leveled spell is cast, there is no DM discretion, the player surges no d20, roll a d100 that happens fullstop.  (The sorcerer can also be inefficiently built without attack roll spells and cantrips thereby making tides never fire and making WMS only work off of d20 rolls) The API I think you are referring to does not make the table for you.  It makes the name of the table, but you have to go in and add every single entry for it.  If you did not make your rollable table entries then its going to constantly spit out an empty entry or nothing as the rollable table only has a name, no sides.   Like the table export api, these apis are awesome but we're all afraid to share each others work here cause technically its sharing the books in rollable table format and none of us want to be yelled at by the forum moderators.  The author probably made it a blank table so that you could table export the real one in or make it from scratch copying it over.  If they had gone with a custom table then that would have been harder to scrub off and put in the RAW table for users so he probably opted for an empty table.  
1632923808

Edited 1632925443
Joel
Pro
I understand what you are trying to say but that's not what we're trying to do here. It's immaterial to the question I have, but this particular sorcerer will have to roll the d20 every time they cast a leveled spell, period. If the d20 results in a 1, it should pull the random effect from the rollable table and present it in the chat automatically. That's it. As far as how Tides of Chaos works, there is complete DM discretion, not only because of the basic understanding that the DM always has discretion, but it is written directly into the Tides of Chaos that "the DM can have you roll on the Wild Magic Surge table immediately after you cast a sorcerer spell of 1st level or higher." But again, in our case it does not matter, the sorcerer is going to roll a d20 every single time they cast a leveled spell. Which is why this API seems perfect for our use. The API can see that this sorcerer is in its array, it can check if the spell cast was leveled or a cantrip, if it was leveled then it rolls the d20 and displays the result in chat, and it is my understanding that it should also display an effect from the effects table when the d20 result is a 1.  I know the API does not make the table for you. It did create the table with one dummy entry, as it was supposed to, and I went ahead and immediately filled it with all 50 effects and deleted the dummy effect, as I was supposed to. The table works on its own, it works when you manually enter the API commands to draw from it. The only thing not working is for the API to automatically draw an effect when the d20 result is a 1. Since this is more about the API now, I have asked my question on a different forum specific to APIs.