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

MagicalSurges with Beyond20

Hi Yall- I am very interested in using the MagicalSurges script developed by @Nic. I've got a Wild Magic sorcerer in my campaign and it would really help to remember one less thing. <a href="https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308" rel="nofollow">https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308</a> However, it doesn't seem to work with Spells when they are initiated using Beyond20 (clicking button in DndBeyond character sheet). My guess is that the messages that come through to the chat are not actually associated with the character id in Roll20, so MagicalSurges doesn't see a matching character id, and thus doesn't fire.&nbsp; Any ideas on how to potentially tweak things to make this work? Perhaps instead have it check for a more rudimentary character name text string in the chat message, but still use the existing spell logic.&nbsp; Thanks!
1697206925
timmaugh
Forum Champion
API Scripter
A quick look at that script seems to show that it is watching for a portion of the message sent to be: charname=something Then it uses the "something" portion to look up the id to compare against the table it keeps. Does the message from DnDBeyond not include the charname portion? If not, and if that can't be added, there might be a way to modify the script to recognize a message coming from DnDB... but let's start with whether you can include a charname section in what gets sent.
Henry F. said: Hi Yall- I am very interested in using the MagicalSurges script developed by @Nic. I've got a Wild Magic sorcerer in my campaign and it would really help to remember one less thing. <a href="https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308" rel="nofollow">https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308</a> However, it doesn't seem to work with Spells when they are initiated using Beyond20 (clicking button in DndBeyond character sheet). My guess is that the messages that come through to the chat are not actually associated with the character id in Roll20, so MagicalSurges doesn't see a matching character id, and thus doesn't fire.&nbsp; Any ideas on how to potentially tweak things to make this work? Perhaps instead have it check for a more rudimentary character name text string in the chat message, but still use the existing spell logic.&nbsp; Thanks! Does it work if you roll from a created sorcerer character within Roll20? I just did a little testing and got it to work, and it looks like there's a few things that have to be configured just right. Are you using Nic's code 0.0.5&nbsp; here , or TheAaron's code here ? I couldn't get version 0.0.3 to work to add character names.&nbsp;&nbsp; Make sure it's version 0.0.5 (the top of the code lists 0.0.4, but you'll see "let version = '0.0.5'," in the code itself), To clarify on what timmaugh was suggesting: click on a roll from DDB, then go into the Roll20 chat window and press the 'up' key so that you get the input that was entered from Beyond20. It'll look something like this: /w gm &amp;{template:atkdmg} {{charname=SORCERERNAME}} {{rname=Fireball}} {{range=150ft. (Sphere 20ft.)}} {{desc=Components: V, S, M(a tiny ball of bat guano and sulfur)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[8d6]]}} {{dmg1type=Fire}} {{crit1=Crit: [[8d6]]}} {{save=1}} {{saveattr=Dexterity}} {{savedc=17}} {{normal=1}} Make sure that the name of the Character (the name of the character sheet) in Roll20 is exactly the same as whatever is in SORCERERNAME.&nbsp;&nbsp; However, if you are rolling from Roll20 itself, the 'Charname' is whatever name is currently being used on the Token (@{token_name}), not the @{character_name} attribute (which is the name on the character sheet). Also as an FYI, if you are making the roll as GM, you'll see the roll twice, because of how the code is written: &nbsp; &nbsp; &nbsp; &nbsp; if (!cantrip &amp;&amp; (spell_level &gt; 0 || msg.rolltemplate == 'spell')) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const roll = randomInteger(20); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!cantrip &amp;&amp; (spell_level &gt; 0 || msg.rolltemplate == 'spell')) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let chatMesg = ''; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chatMesg = `&amp;{template:simple} {{rname=Wild}} {{r1=${roll}}} {{normal=1}}`; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (whisper == undefined) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, chatMesg); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, `/w gm ${chatMesg}`); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, `/w ${msg.who} ${chatMesg}`); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } } The 'else' code sends a chat to the GM, and a separate message to the person who originated the message... so if the GM originated the message then it gets sent twice. There's definitely some refining that could be done with the script for error checking and optimization. For example, I created a temporary character to test things, and added them to the state object, then deleted the character and so now I see a blank entry for the output of 'Current Sorcerers'. There's no checking to see if an entry in the Current Sorcerers is deleted from the Journal.
Jarren said: Henry F. said: Hi Yall- I am very interested in using the MagicalSurges script developed by @Nic. I've got a Wild Magic sorcerer in my campaign and it would really help to remember one less thing. <a href="https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308" rel="nofollow">https://app.roll20.net/forum/post/6595391/script-release-magicalsurges/?pageforid=6610308#post-6610308</a> However, it doesn't seem to work with Spells when they are initiated using Beyond20 (clicking button in DndBeyond character sheet). My guess is that the messages that come through to the chat are not actually associated with the character id in Roll20, so MagicalSurges doesn't see a matching character id, and thus doesn't fire.&nbsp; Any ideas on how to potentially tweak things to make this work? Perhaps instead have it check for a more rudimentary character name text string in the chat message, but still use the existing spell logic.&nbsp; Thanks! Does it work if you roll from a created sorcerer character within Roll20? I just did a little testing and got it to work, and it looks like there's a few things that have to be configured just right. Are you using Nic's code 0.0.5&nbsp; here , or TheAaron's code here ? I couldn't get version 0.0.3 to work to add character names.&nbsp;&nbsp; Make sure it's version 0.0.5 (the top of the code lists 0.0.4, but you'll see "let version = '0.0.5'," in the code itself), To clarify on what timmaugh was suggesting: click on a roll from DDB, then go into the Roll20 chat window and press the 'up' key so that you get the input that was entered from Beyond20. It'll look something like this: /w gm &amp;{template:atkdmg} {{charname=SORCERERNAME}} {{rname=Fireball}} {{range=150ft. (Sphere 20ft.)}} {{desc=Components: V, S, M(a tiny ball of bat guano and sulfur)}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[8d6]]}} {{dmg1type=Fire}} {{crit1=Crit: [[8d6]]}} {{save=1}} {{saveattr=Dexterity}} {{savedc=17}} {{normal=1}} Make sure that the name of the Character (the name of the character sheet) in Roll20 is exactly the same as whatever is in SORCERERNAME.&nbsp;&nbsp; However, if you are rolling from Roll20 itself, the 'Charname' is whatever name is currently being used on the Token (@{token_name}), not the @{character_name} attribute (which is the name on the character sheet). Also as an FYI, if you are making the roll as GM, you'll see the roll twice, because of how the code is written: &nbsp; &nbsp; &nbsp; &nbsp; if (!cantrip &amp;&amp; (spell_level &gt; 0 || msg.rolltemplate == 'spell')) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; const roll = randomInteger(20); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!cantrip &amp;&amp; (spell_level &gt; 0 || msg.rolltemplate == 'spell')) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let chatMesg = ''; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chatMesg = `&amp;{template:simple} {{rname=Wild}} {{r1=${roll}}} {{normal=1}}`; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (whisper == undefined) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, chatMesg); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, `/w gm ${chatMesg}`); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, `/w ${msg.who} ${chatMesg}`); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } } The 'else' code sends a chat to the GM, and a separate message to the person who originated the message... so if the GM originated the message then it gets sent twice. There's definitely some refining that could be done with the script for error checking and optimization. For example, I created a temporary character to test things, and added them to the state object, then deleted the character and so now I see a blank entry for the output of 'Current Sorcerers'. There's no checking to see if an entry in the Current Sorcerers is deleted from the Journal. Thanks for the replies so far! Yes I'm using the 0.0.5 version from Nics Github. I have tested it for spells initiated from a character sheet within Roll20 and it does auto-roll the d20 for those. However, it is not auto-rolling from the rollable table if the d20 rolls a 1.&nbsp; So we have two issues: Spells from Beyond20 don't trigger the d20 auto-roll d20 auto-roll of 1 not triggering the rollable table via 'makesurge' Below is what came through in the chat from Beyond20 when initiated in DndBeyond. The character name is exactly the same (also need it to be exactly the same for the Beyond20 HP sync to work). I have also tested this for a character without an apostrophe in the name, ruling that out. It looks like the issue is instead the fact that 'spelllevel' is not included in the block. The script is looking for that in the 'checkSpell' function. Thoughts/ideas? ____________________________________________________ &amp;{template:dmg} {{charname=Gyk'Raal Wvrnili}} {{rname=Fireball}} {{range=150ft. (Sphere 20ft.)}} {{desc=Components: V, S, M(a tiny ball of bat guano and sulfur) Range/Area: 150ft. Duration: Instantaneous Description: A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one. The fire spreads around corners. It ignites flammable objects in the area that aren't being worn or carried. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[8d6]]}} {{dmg1type=Fire}} {{crit1=Crit: [[8d6]]}} {{save=1}} {{saveattr=Dexterity}} {{savedc=16}}
I'm on mobile so I can't check at the moment, but try troubleshooting with a character that doesn't have an apostrophe or &nbsp;a space in their name.
Jarren said: I'm on mobile so I can't check at the moment, but try troubleshooting with a character that doesn't have an apostrophe or &nbsp;a space in their name. Just troubleshooted and having the same issues for character with no spaces and no apostrophe