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 .
×

Tim's Spiritual Weapon Mod v2 (ScriptCards) D&D 5E 2014

1777851722

Edited 1778294298
Hi All, This is version 2 of my Spiritual Weapon ScriptCards Mod for the Roll20 2014 D&D 5E character sheet. *** Quick Copy and Paste Link *** *** Quick Copy and Paste Link *** What Does This Mod Do? This Mod displays the Spiritual Weapon spell in chat and lets the player cast it by selecting the spell slot level they want to use. When cast, it summons a Spiritual Weapon token beside the caster, spends the selected spell slot, and updates the SpiritualWeapon NPC's token action attack to match the slot level used. The Mod includes a built-in weapon selection menu with 157 Baldur's Gate 3 weapon tokens, plus a collection of miscellaneous token options for less serious tables. You can also set the weapon to random, choose a specific weapon, use a custom token image from your Roll20 library, give the Spiritual Weapon a custom name, a custom FX, and a custom Jukebox sound. The chat card also includes the spell information, an open-book button to send the spell output to chat, and a gear button to open the weapon settings menu. The Spiritual Weapon token has a token action Spiritual Weapon attack that is dynamically created based on what level the spell was cast. What's New in v2? Major Rewrite and Cleanup    The Mod has been heavily rewritten and cleaned up to bring it more in line with my newer ScriptCards Mods, especially Find Familiar and Summon Beast. The script flow, setup logic, reentrant buttons, and settings handling should now be cleaner and more reliable. New Weapon Settings Menu   The weapon selection menu has been rebuilt. You can now choose from the full weapon library, select a random weapon, or open the Custom Token menu. Custom Token and Custom Name Support  Custom token setup is now more flexible. You can set a custom Roll20 image URL and a custom name separately, so you can rename a normal selected weapon without needing to replace its token image. Random Weapon Improvements  Random weapon selection has been cleaned up so it only selects from valid weapon entries and no longer has to repeatedly reroll invalid results. Visual and Usability Improvements  The card layout, button menus, back buttons, setup messages, and token preview displays have all been cleaned up. Installation Install ScriptCards in your game. Create a character named `ScriptCards_TemplateMule`. Create an NPC character named `SpiritualWeapon`. Add the Spiritual Weapon script as a an ability on your caster's character sheet (or spell mule if you use one). The script can be found by clicking the Quick Copy and Paste Link below. Select the caster's token and run the script once to write the template and NPC data. Run the script any subsequent time, and it will just run the Spell script. *** Quick Copy and Paste Link *** Optional Turn Order Feature This feature will add the Spiritual Weapon token to the turn order when the spell is cast. It will then count down each round from 10 and when it reaches 0 will delete the Spiritual Weapon token from the map and turn order. Turn Order Installation Create a new character called ScriptCards_Triggers exactly as shown. Create a new ability on the character called change:campaign:turnorder  exactly as shown. Add the code below or from the link to the new ability you created. Restart the game's sandbox. Link to Optional Turn Order Feature !scriptcards {{ --/|{& skip} --/|========================================================================== --/| Script Name : Spiritual Weapon Turn Order Cleanup Trigger --/| Version : 1.0.0 --/| Author : Timothy Beasley --/| Trigger : change:campaign:turnorder --/|========================================================================== --/| This trigger is used by Tim's Spiritual Weapon Mod. When a summoned --/| Spiritual Weapon token reaches the end of its duration in the turn --/| tracker, this trigger removes it from the turn tracker and deletes --/| the token from the map. --/| --/| Requires a character named ScriptCards_Triggers with an ability named: --/| change:campaign:turnorder --/| Restart the sandbox after adding this to ScriptCards_Triggers --/|========================================================================== --#hidecard|1 --#debug|0 --~CurrentActor|turnorder;getcurrentactor --?"[*[&CurrentActor]:character_name]" -ne "SpiritualWeapon"|Done --~CurrentActorPR|turnorder;findtoken;[&CurrentActor] --?[&CurrentActorPR] -gt 0|Done --&sfx|[*[&SW_TokenID]:swsoundfx] --?"[&sfx]" -ne ""|[ --a|[&sfx] --]| --vpoint|[*[&CurrentActor]:t-left] [*[&CurrentActor]:t-top] [*[&CurrentActor]:swfxtype]-[*[&CurrentActor]:swfxcolor] --~|object;token;remove;[&CurrentActor] --:Done| --X| }}
So is this suppose to summon a token into the VTT map like the find familiar script? if so - that part isnt working for me. so I already have the spellscript mule character for your other stuff. I created a NPC sheet and renamed it to SpiritualWeapon and I added the script to my cleric. I ran the script and I see the messages in chat. I went to the setting, selected Maul. I clicked on the book and got a spell description. Then I finally hit at what level am I casting this spell. I click on 2nd and nothing happens. I also see no images. when I clicked on Maul, I did not get a follow up like your picture, select a maul. In fact, I do get the notification in chat "select your maul" but no images, just the Back button.
Ok, weird, maybe I broke it on upload to GitHub or something. I'll check tonight.
1778115776

Edited 1778116564
I'm curious, is the Find Familiar script working in your game? &nbsp;Github Find Familiar Link. It uses the same method for images. This Mod is working for me. Test to see if you have access to the image of the maul token in the following URL. <a href="https://files.d20.io/images/409077949/kMTFu728yEn4tLK6JJc4mA/original.webp?2705815" rel="nofollow">https://files.d20.io/images/409077949/kMTFu728yEn4tLK6JJc4mA/original.webp?2705815</a> If you can't access that image, then I'm worried that somehow permissions have changed to access user libraries.
Changelog 2.0.1 Token Image Fix &nbsp;Changed the format of the token image URL. Novercalis, I'm hoping it works now, give it a shot and let me know.
Hey just got back as for the update - It breaks the sandbox For reference, the error message generated was:&nbsp; TypeError: Cannot read properties of undefined (reading 'get') at 1-CLICK: Fetch [Tab 31]:685:119 at Array.filter (&lt;anonymous&gt;) at getToken (1-CLICK: Fetch [Tab 31]:685:18) at 1-CLICK: Fetch [Tab 31]:1551:101 at String.replace (&lt;anonymous&gt;) at handleInput (1-CLICK: Fetch [Tab 31]:1299:39) at Func.fetch [as func] (1-CLICK: Fetch [Tab 31]:1716:29) at 1-CLICK: ZeroFrame [Tab 34]:881:25 at Array.forEach (&lt;anonymous&gt;) at runLoop (1-CLICK: ZeroFrame [Tab 34]:878:34) As for Find Familiar - I added it to this game and the images are all broken and thus nothing gets summoned. It did work 2-3 weeks ago, when I was a player and walked through the DM how to install it both script cards and the findfam script. That game is no more, so I cant check it no more.&nbsp;
1778212348

Edited 1778212557
Changelog 2.0.2 Added ZeroFrame Compatibility Fix &nbsp;Added a {&amp; skip} marker on a ScriptCards comment line so ZeroFrame/Fetch will ignore the ScriptCards macro instead of trying to parse it and crashing the API sandbox. Improved Random Weapon Selection &nbsp;Random weapon selection now rolls the weapon category first, then rolls within that category. This prevents categories with lots of tokens from being disproportionately likely. Added Miscellaneous Tokens to Random Selection &nbsp;Since random selection is now category-based, Miscellaneous tokens can be included without overwhelming the normal weapon results. Fixed Spiritual Weapon Crit Damage Scaling &nbsp;The NPC mule’s attack now updates attack_crit to match the number of d8s used for the selected spell slot. General Code Cleanup and Bug Fixes Novercalis, the sandbox crashing is related to the Zeroframe API, it's the same issue that we had with the Spell Book Mod earlier. The first listed fix will have fixed this, and hopefully the URL's are fixed. I'm hoping someone else who's tested this Mod can confirm that the images are showing up ok.
1778280272

Edited 1778280414
it is now working properly Tim! Thank you Edit: However the FindFamiliar images are broken, so it is unable to summon and cast
1778293903

Edited 1778302802
Changelog 2.1.0 Added Custom FX and Sound &nbsp;Added a new button in the settings to allow any of the established Roll20 FX to be set on the fly, as well as the Jukebox sound track. Optional Turn Order Feature &nbsp;Added a turn order feature which will add the Spiritual Weapon Token to the turn order when the spell is cast, it will count down from 10 each round and once at 0 will delete the Spiritual Weapon Token. This is optional because it requires extra setup steps, which are in the original post. Bug Fixes &nbsp;More bug fixes, I think I found them all now. Update Note &nbsp;If you want the cleanest update, delete your current SpiritualWeapon NPC character and make a new one. Or, you can go into the new FX settings and choose select them so that the attribute is created on the SpiritualWeapon NPC character. It's not entirely necessary, but it'll throw errors to the sandbox console if the attributes don't exist.