PDA

View Full Version : Wild Magic Auto Roll (DnD 5E)



jammaster
May 14th, 2021, 18:13
Hello. After a while playing as a wild magic sorcerer, I got annoyed of how forgetful I am about my wild magic rolls (it has already affected the plot of my campaign), so I decided to write an extention to fix this problem.

EDIT: This plugin is in maintenance mode and will likely not be updated. I highly recommend taking a look at a mod that does the same but better: https://www.fantasygrounds.com/forums/showthread.php?74705-Automatic-Wild-Magic-Surge-Extension

This extension is for D&D 5E

How it works
This extension will automatically roll Wild Magic for you when you cast a spell of level 1+ (either cast attack of an effect). For it to be active, you need to have a feature called "Wild Magic Surge" (in the Abilities tab).

How to configure it
If you want, you can set the odds of the wild magic roll happening. You can do this by opening the extention file like you would a normal zip file, then edit file named "config.lua" and edit the odds by setting the number according to your wishes (Percentage between 0 and 100). Then reload fantasy grounds.

Bear in mind that this is my first extension, and I may have made some mistakes in the code, so feel free to make pull requests with improvements. The repository can be found at https://bitbucket.org/JamMaster/wildautomagic/src/master/.

Zacchaeus
May 14th, 2021, 19:42
I'm going to assume this is for 5e?

jammaster
May 14th, 2021, 19:51
Yes, apologies, I assume i should have included in the title?

Zacchaeus
May 14th, 2021, 19:54
Well somewhere :)

vaughnlannister
May 15th, 2021, 06:52
Cool thanks :)!!!

superteddy57
May 15th, 2021, 06:54
MOD: Updated title with ruleset to be used

matjam
May 15th, 2021, 21:58
Note that WMS is often misinterpreted that you roll this on every spell cast.

The rule says the DM "can" have the player roll to see if the surge happens, and then if it does, roll on the WMS table. Not "must".

Suggest adding an option to allow the DM to configure how often he wants WMS rolled, maybe as a percentage chance.

It's amazing how often 5% happens if you roll every time :P

jammaster
May 16th, 2021, 13:11
Oh wow you are correct! We have a house rule that I should roll it every time so I completely forgot about this. Either way, I added a way to configure the odds of rolling. If you instead want the DM himself to decide when to roll, then the extension is inherently useless.

Also, I wanted the odds to be rolled by the DM, but even after a couple times of testing, the waiting got really old (you have to wait for a d20 roll by the DM, and then roll wild magic, feels like an eternity). The odds are done using math.random, and you can see your result in the debug console if you are interested.

damned
May 16th, 2021, 15:09
You might want to add something like:

math.randomseed( os.time());

before you do your math.random otherwise the seed is always the same...

jammaster
May 16th, 2021, 15:22
Its literally on the second line of the campaign/scripts/button_power_action_override.lua :D. Although it runs every time an action button is added to the windows as opposed to just once. If you know a better, do tell :)

plap3014
June 27th, 2021, 16:49
Hi, i have the following MOD install, and would like to know how to make it work with your extension?

https://www.dmsguild.com/product/335322/Untamed-Magic-Fantasy-Grounds

and add the DC check?

47936

Please let me know.

plap3014
June 27th, 2021, 22:52
Hi,

i have load your extension and change the odds for 100, but when i click on a spell of level 1 or 2 it is not going on the table:47935

i'm not sure what i'm doing wrong

jammaster
June 27th, 2021, 23:07
Hi, i have the following MOD install, and would like to know how to make it work with your extension?

https://www.dmsguild.com/product/335322/Untamed-Magic-Fantasy-Grounds

and add the DC check?

47936

Please let me know.

It is possible to roll a DC check automatically, but not to add the level of the spell, since that is not known in FG for some reason.

I could take a look at building a special version of the addon for this but it's definitely some custom work you're asking for

plap3014
June 27th, 2021, 23:11
It is possible to roll a DC check automatically, but not to add the level of the spell, since that is not known in FG for some reason.

I could take a look at building a special version of the addon for this but it's definitely some custom work you're asking for

Thanks for your reply

jammaster
June 27th, 2021, 23:11
Hi,

i have load your extension and change the odds for 100, but when i click on a spell of level 1 or 2 it is not going on the table:47935

i'm not sure what i'm doing wrong

You don't need to change anything if you want 100%, the extension comes shipped with those odds. I'm not sure why your spell isn't triggering it though. Those seem like normal spells. How are you casting them?

plap3014
June 27th, 2021, 23:15
click on the dice beside the spell:

47937

arcanjl
June 27th, 2021, 23:41
Does it show in the chat that it is rolling? if it is hidden then that explains why it appears to not be working for me :)

plap3014
June 28th, 2021, 01:54
hi, no is not appear, and in the table show result is on

Bonkon
July 14th, 2021, 08:25
Good Day JamMaster :)
Love the idea of this extension. I have a player with a Wild Magic Sorcerer and we decided he will roll any time a level one or higher spell is cast (Much like your campaign). We also decided there was not enough randomness during play (We have only had 2-3 surges so far and the characters are 5th level) so we decided to increase the odds. Now he will surge on a 1, 7, 14, or 20.

When a levelled spell is cast it rolls and outputs the d20 roll in the chat window with [WILD MAGIC]. I was assuming that if it landed on the appropriate number it would roll on the table.

Is there a way to link the roll to a table directly? (I do have Tasha's open and there is a table named Wild Magic there, but it does not call it up).

Thanks :)

jammaster
July 14th, 2021, 08:32
Good Day JamMaster :)
Love the idea of this extension. I have a player with a Wild Magic Sorcerer and we decided he will roll any time a level one or higher spell is cast (Much like your campaign). We also decided there was not enough randomness during play (We have only had 2-3 surges so far and the characters are 5th level) so we decided to increase the odds. Now he will surge on a 1, 7, 14, or 20.

When a levelled spell is cast it rolls and outputs the d20 roll in the chat window with [WILD MAGIC]. I was assuming that if it landed on the appropriate number it would roll on the table.

Is there a way to link the roll to a table directly? (I do have Tasha's open and there is a table named Wild Magic there, but it does not call it up).

Thanks :)

Hi!
There is a way to do this, however i chose not to because of how different every single group handles the surges. In our group i check boxes every time i don't trigger it, making it more probable every time. Some groups trigger it on 1 and 20. You trigger it on some other numbers. I wanted the extension to solve the problem of forgetting to roll it, without forcing how and when the wild table is rolled. I may consider doing it if there are enough people that want it.

wframe
August 30th, 2021, 16:35
Hi!
There is a way to do this, however i chose not to because of how different every single group handles the surges. In our group i check boxes every time i don't trigger it, making it more probable every time. Some groups trigger it on 1 and 20. You trigger it on some other numbers. I wanted the extension to solve the problem of forgetting to roll it, without forcing how and when the wild table is rolled. I may consider doing it if there are enough people that want it.

I would definitely like it to roll on the Wild Magic table automatically. I have my players roll for every spell of level 1 or higher and I often forget.

Leprekorn
September 6th, 2021, 11:15
Hey could you adapt this so when a nat 1 was rolled on a skill check, attack or ability check that a table was auto rolled?

nephranka
January 24th, 2022, 13:44
There seems to be a conflict with Kit'N'Kaboodle. When I use the mini button to heal it throws an error.

jammaster
January 25th, 2022, 19:57
There seems to be a conflict with Kit'N'Kaboodle. When I use the mini button to heal it throws an error.

I tried reproducing this but I really dont know how to use this plugin. Nothing works to add an action from a potion like I assume you did

nephranka
January 25th, 2022, 21:09
I tried reproducing this but I really dont know how to use this plugin. Nothing works to add an action from a potion like I assume you did

I can zip up a campaign folder for you if that would help?

jammaster
January 25th, 2022, 22:45
I can zip up a campaign folder for you if that would help?

Very much, or at least a link on how to work the extension to build the effect you have, or instructions how you did it. I'm too stupid to find it within reasonable time.

nephranka
January 25th, 2022, 23:18
Very much, or at least a link on how to work the extension to build the effect you have, or instructions how you did it. I'm too stupid to find it within reasonable time.

Email sent. Thanks!

jammaster
January 27th, 2022, 18:59
Email sent. Thanks!

Fixed, and newer version uploaded. It was because this "spell" didnt really have a level, which makes sense since its a potion. However the same may happen for spells from items that in fact should trigger a surge (https://rpg.stackexchange.com/questions/131710/can-a-sorcerer-spell-cast-from-a-magic-item-trigger-a-wild-magic-surge). If that were to happen the Kittywhatever extension has to fix it. They have to properly attach the spells level to the button.

nephranka
January 27th, 2022, 20:40
Its literally on the second line of the campaign/scripts/button_power_action_override.lua :D. Although it runs every time an action button is added to the windows as opposed to just once. If you know a better, do tell :)

It is working now as you describe. I will upstream the info about spell level for KNK. Thank you for the work.

nephranka
January 27th, 2022, 21:08
I do note that only using the "cast" button activates WMS and the ATK/SAVE buttons do not nor does any "effect" button. Maybe this is working as intended but it would exclude spells like magic missile?

jammaster
February 6th, 2022, 12:25
I do note that only using the "cast" button activates WMS and the ATK/SAVE buttons do not nor does any "effect" button. Maybe this is working as intended but it would exclude spells like magic missile?

Thats kind of intended. WMS should be triggered when the character casts a spell, not when saving or attacking. Since WMS is a sorcerer feature and their effects are almost exclusively caused by spells, the effect buttons should also trigger it. If not, then they have been probably written incorrectly. You can try to tests this with the slow spell NOT from the Kittystuff plugin. To confirm that there is an issue with the effect, you can take a look in the console (/console in chat) and there should be a message saying that the button has no spell level and thus does not trigger a WMS.

When it comes to stuff like Magic missile, its one of the exceptions and i would need to look into it more. If there arent too many of those maybe Ill hardcode them in a table of exceptions or something similar.

Sorry for the late answer, Ive been very busy recently

nephranka
February 6th, 2022, 14:01
Thats kind of intended. WMS should be triggered when the character casts a spell, not when saving or attacking. Since WMS is a sorcerer feature and their effects are almost exclusively caused by spells, the effect buttons should also trigger it. If not, then they have been probably written incorrectly. You can try to tests this with the slow spell NOT from the Kittystuff plugin. To confirm that there is an issue with the effect, you can take a look in the console (/console in chat) and there should be a message saying that the button has no spell level and thus does not trigger a WMS.

When it comes to stuff like Magic missile, its one of the exceptions and i would need to look into it more. If there arent too many of those maybe Ill hardcode them in a table of exceptions or something similar.

Sorry for the late answer, Ive been very busy recently

No worries. I will review and test then report back. Thanks!

MrDDT
February 6th, 2022, 18:48
I do note that only using the "cast" button activates WMS and the ATK/SAVE buttons do not nor does any "effect" button. Maybe this is working as intended but it would exclude spells like magic missile?

Why would you want it any other way? Because if it applied with every save roll, spell attack roll, effects etc, it would roll the WMS many times for 1 spell.

nephranka
February 7th, 2022, 01:24
Why would you want it any other way? Because if it applied with every save roll, spell attack roll, effects etc, it would roll the WMS many times for 1 spell.

Because some spells don't require a "cast" like magic missile or spells we code ourselves and as a result don't trigger WMS. Also, you said "roll" I did not. I am referring to using the mini buttons.

MrDDT
February 7th, 2022, 02:15
Because some spells don't require a "cast" like magic missile or spells we code ourselves and as a result don't trigger WMS. Also, you said "roll" I did not. I am referring to using the mini buttons.

I get what you saying now. I thought you were saying "cast" as in the clickie to the left of the spells.

This ext only works on effects and cast. Whereas I personally think it shouldn't only work on the left clickie cast or have options the other way.

I use this ext rarely as only a couple people ever use Wild Magic Sorcs. I load it up when it does, I don't mind that it shows extra wild magic rolls because I just ignore them and I know the rules. I like the reminder. I also use the older version which rolls on damage, effects and casts (not the clickie to the left either).

nephranka
February 8th, 2022, 02:42
Thats kind of intended. WMS should be triggered when the character casts a spell, not when saving or attacking. Since WMS is a sorcerer feature and their effects are almost exclusively caused by spells, the effect buttons should also trigger it. If not, then they have been probably written incorrectly. You can try to tests this with the slow spell NOT from the Kittystuff plugin. To confirm that there is an issue with the effect, you can take a look in the console (/console in chat) and there should be a message saying that the button has no spell level and thus does not trigger a WMS.

When it comes to stuff like Magic missile, its one of the exceptions and i would need to look into it more. If there arent too many of those maybe Ill hardcode them in a table of exceptions or something similar.

Sorry for the late answer, Ive been very busy recently

Looks to be working as you said. The thing that through me off was that using the effect button does not throw a die for WMS (like it does with cast). It just auto rolls it and outputs it to chat.

Thanks!

GEONE
August 11th, 2022, 17:25
Hey, I made an extension that does something very similar, but it rolls a wild magic surge check when the 'cast spell' button is clicked instead of the 'CAST/SAVE' button. This means spells like magic missile can work too.

https://www.fantasygrounds.com/forums/showthread.php?74705-Automatic-Wild-Magic-Surge-Extension

https://i.imgur.com/tYrSbUp.png

https://i.imgur.com/WJ7ufoy.gif

It also is fully customizable in-game, just by editing the text in the feature on your character sheet. You can change the table it rolls on, the dice that are rolled for the check, and what result triggers a wild magic surge.

https://i.imgur.com/fDVuAUU.gif