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 Spellbook Mod v3.0 (ScriptCards) D&D 5E 2014

1754196799

Edited 1784050982
***** NEWER VERSION HERE ***** Find the Code HERE! Easy copy and paste link Feature List Vital Character Stats:  Displays the character's Spellcasting Ability, Spell Save DC, Spell Attack Bonus, and Maximum Prepared Spells at the top of the Spell Book.  Spellcasting Ability is also a button.  Clicking it displays all six ability scores, with the character's class and multiclass information shown beside the appropriate abilities. Selecting an ability changes the active Spellcasting Ability used by the Spell Book. Subclass Visualization:  Displays a unique class or subclass icon in the Spell Book header. Complete Spell Management:  The Spell Book normally displays prepared spells only. Click the arrow in the Cantrips header to open the character's full spell list. From the full list, spells can be prepared or unprepared directly from the Spell Book. Click the arrow again to return to the prepared spell list. Classes that do not use prepared spell selection, such as Warlocks, do not display the full-list toggle. Spell Slot Tracking:  Each spell level header displays the character's remaining spell slots. Use the plus and minus buttons to manually adjust available slots. Several different spell slot icon styles are available in Settings. Pact Magic and Multiclass Support:  Pact Magic slots are tracked separately from normal spell slots. If Pact Magic and normal spellcasting provide slots at the same spell level, the Spell Book displays a separate W slot row for the Warlock Pact Magic slots. Each slot pool has its own independent plus and minus controls.  Detailed Spell Entries:  Each spell entry can display the spell school icon, spell name, action type, concentration or ritual status, and the spell's Innate field. Action, Bonus Action, and Reaction markers can be enabled or disabled individually. Interactive Controls:  Spell entries include the appropriate Cast button, prepare or unprepare control, and Spell Details button. The Cast button uses the Roll20 character sheet's normal spell roll where applicable. Native Roll20 Spell Details: The open-book button displays the spell using Roll20's native spell output rather than a custom tooltip. Spell Details can be toggled between public output and a self-whisper directly from the Spell Book. Custom Spell Macros & Spell Mule:  A Spell Mule can be configured separately for each character from the Settings card. The Spell Mule is a normal Roll20 character containing Abilities used as custom spell overrides. Ability names should match the spell name with spaces replaced by hyphens. For example: Cure Wounds → Cure-Wounds. If a matching Ability is found, the Spell Book uses that Ability for the spell's Cast and Spell Details buttons instead of the normal Roll20 spell output. This allows complex or custom spell macros to be kept on one dedicated character instead of cluttering player character sheets. High-Speed Per-Character Cache: The Spell Book uses a split handout-based cache created separately for each character. Prepared spell lists are cached for fast loading, while full spell lists are built and stored by spell level. Full-list cache handouts are created only when they are actually needed. The cache automatically detects spell rows being added, removed, reordered, or having their preparation state changed. Only affected spell levels are rebuilt instead of rebuilding the entire Spell Book. The first time a large full spell list is opened, the Spell Book may display a short cache-building message. Later runs use the saved cache. Per-Character Settings: Spell Book settings are stored separately for each character. Changing themes, UI styles, colours, or slot styles does not require rebuilding the spell cache. Theming and Customization: The Spell Book includes twenty built-in book themes. The Spell Book UI theme can be selected independently from the book theme, and the Settings card also allows customization of: Spell colour Icon colour Action colour Bonus Action colour Reaction colour Action markers Spell slot style Spell Mule What doesn't this Mod Do? This Mod does not automatically deduct spell slots when a spell is cast. The main reason is custom spell macro compatibility. Many custom spell Mods and macros already handle spell slot deduction, and automatically deducting another slot from the Spell Book could result in slots being deducted twice. For now, spell slots are adjusted manually using the plus and minus controls in each spell level header. Automatic slot deduction may become an optional setting in the future. Installation Instructions Ensure that the ScriptCards Mod/API script is installed in your Roll20 game. Create a new Roll20 Macro or Character Ability. Copy the complete Spell Book Mod script into the Macro or Ability. If using a Character Ability, enable Show as Token Action . Select the caster's token and run the Spell Book. On first run for a character, the Spell Book automatically creates the cache handout it needs. Additional cache handouts are created later only if the character's spell levels require them. To configure a Spell Mule, open the Settings card and enter the exact name of the Spell Mule character. The Spell Book automatically detects normal spell-list and preparation changes. A Clear Cache button is also available in Settings if a manual rebuild is ever needed. Requirements Roll20 Pro with Mod/API access ScriptCards The official Roll20 D&D 5E 2014 character sheet Check out my profile for my other ScriptCard Mods.
1754196810

Edited 1784050335
For a more comprehensive instructions, visit my github  here.
1754198606

Edited 1754198747
Gauss
Forum Champion
Hi Timothy B.,  This is amazing!  Is there support for multi-classed characters with two (or more) spell DCs?  What about spells from items or special abilities (scrolls, staves, wands, class, or race abilities, etc.)?  Do you have special tracking for those? 
Gauss said: Hi Timothy B.,  This is amazing!  Is there support for multi-classed characters with two (or more) spell DCs?  What about spells from items or special abilities (scrolls, staves, wands, class, or race abilities, etc.)?  Do you have special tracking for those?  Thanks Gauss! It's a space issue, really. I suppose as a tooltip in the spell DC section at the top I could list any other DC's. I didn't even think about items, but that might be a nifty addon, again space is an issue as always. Racial abilities get more complicated as they can get very specific and filtering them out from other features might make this Mod larger than the allowable characters in a post.
1754200424
Gauss
Forum Champion
The reason I ask is that I already include item and ability spells in the 2014 sheet.  To prevent them from deducting spell slots the "innate" line is used. 
I wouldn't mind some feedback on this Mod, if I could get some volunteer testers. On my test game everything works fine, but when I switched to a game that I've been playing in for about 6 months or so, as a player, the method of writing to the template mule is failing. The number of times I need to escape special character is different in two different games.
1754270484

Edited 1754270530
Gauss
Forum Champion
Hit me up in Discord , we can talk about me stress testing it.  I don't know anything about the API Script side of what you have done, but I can put it through its paces easily enough. 
It seems like there is an incompatibility with one of the API Scripts installed by the MetaScriptToolBox script. One of the scripts is interfering with escaping special characters. I'm not exactly sure what to do about that other than letting people know that the incompatibility exists, as of this post anyway. The fix is to have four \ escape characters before each | vertical bars and remove all \ escape characters from [ and ] in the style information in the &defaultTemplate string. And then the 7th line from the bottom of the script, do the same thing only have eight \ escape characters before each | vertical bars and remove all \ escape characters from [ and ]. Don't do this fix if you don't have MetaScriptToolBox installed.
1754341206

Edited 1754416267
timmaugh
Roll20 Production Team
API Scripter
Hey, Timothy B.... Metascript Toolbox author, here. The interaction you describe is strange, since the Toolbox shouldn't be concerned with those backslashes if it isn't doing any work. So if you don't use metascript constructions, it shouldn't be interacting with the message at all. I've done a cursory search of your command line, but I don't see any metascript constructions. Have I missed them? Are you intending to use any?
1754357926

Edited 1754358096
No, there's no use of any of the metascripts in this mod. It's just the installation of one of the MetaScriptToolbox API scripts is causing the escape behaviour to change. I don't know which one exactly as I didn't do a very methodical check of each one. I'm going to do that tomorrow, though.
1754360953
timmaugh
Roll20 Production Team
API Scripter
I can save you time: it's ZeroFrame handling that escape character... the question is 'why'. I'll see if I can add you command to my 2014 test game. Are you running the Default Sandbox or the Experimental one?
Just running the default
1754365249

Edited 1754366567
Updated to 3.1 Used a simpler method to determine if ScriptCards_TemplateMule exists. I believe this should reduce load times a bit. It throws a Roll20 error to chat, but only while the template mule doesn't exist. Overhauled the way that custom font colors were being handled. Elements like the title can't change unless the information is written to the template mule at each color change. After updating, you'll have to go select a theme again and any custom colors will need to be input again.
1754400464

Edited 1754400546
Tried testing your script - getting the error below.  Tried again with a different game - no other scripts (and then when added the required script - same)   SyntaxError: Unexpected token '{'
Same issue with Jim found every \| and turned it into \\\\| went to the 7th line, the \\\\|\\\\| became \\\\\\\\|\\\\\\\\ I kept the \\{but deleted the inside\\] I assume that is what you meant Tim. 
Novercalis said: Same issue with Jim found every \| and turned it into \\\\| went to the 7th line, the \\\\|\\\\| became \\\\\\\\|\\\\\\\\ I kept the \\{but deleted the inside\\] I assume that is what you meant Tim.  Did it then work?
I'm sure you're probably installing it correctly, but I could have been clearer about installation instruction in the first post. So, just to make sure we're all on the same page I'll post the instructions here and edit the first post. 1. Ensure that you've installed ScriptCards in your game. 2. Create a character named ScriptCards_TemplateMule (exactly as shown, case sensitive and with an underscore). 3. Run the Mod the first time and it'll write the information to the ScriptCards_TemplateMule character. 4. Run the Mod again any subsequent time and it will just run the Mod. I'm also going to update the mod to version 3.1.1. Removed unnecessary escape of closing bracket ] from the template write. Moved the escaped characters to strings for easier editing if they're causing problems in games. I'm not sure this will do anything to alleviate the problems, but it certainly couldn't have been helping. There is no reason why this Mod shouldn't work on a game with only scriptcards installed. I suggest grabbing the code from my github from the "Easy copy and paste link" and make sure you're using a plain text editor; notepad, notepad++ etc. When I was testing with MetaScriptToolbox installed initially, I had to remove all bracket escapes, even the opening bracket. I'm having trouble testing now since it crashes altogether with Zeroframe installed, even though it didn't do that earlier today, so not sure what's going on there. For anyone having issues running this I've put the escaped characters in strings. The most common fix is the following. Change: --&Vbar||| To: --&Vbar|\\\\|\\\\| Then Change: --&VbarNew|\\\\|\\\\| To: --&VbarNew|\\\\\\\\|\\\\\\\\|
did not work before, tried this new one, did not work. Made the new edits, still crashing.
1754423734

Edited 1754423804
You're getting a syntax error or the sandbox is crashing? I've tested this on several test games with no problems other than the Zeroframe incapability. I even tried it on a 2024 game and it doesn't throw errors, it just displays no information in the spellbook.
Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again.  More info...  If this script was installed from the Mod Library, you might find help in the Community API Forum. For reference, the error message generated was:  SyntaxError: Unexpected token '{'
Very strange, are there any other API scripts installed?
1754425459

Edited 1754425474
yeah,  dont judge me bro, lol
1754425599

Edited 1754425683
I was trying spellbook with both meta on and off. I notice I have zero frame and you just recently mentioned that.. so that's probably the issue. tried it off, same error but might be coming from something else tho. 
It wouldn't be enough to turn MetaScriptToolbox off, you have to turn off Zeroframe specifically. However, those changes to the escapes worked with Zeroframe on yesterday. They're crashing for me today too. I'll have to do more testing.
1754427795

Edited 1754428254
I did find a typo, a missing few ; in a conditional in the template change code. But, fixing them still resulted in a sandbox crash. I rewrote them to be in-line conditionals and now it work with zeroframe installed. Updated to 3.1.2 Changed conditional to two in-line conditionals, now works with Zeroframe. EDIT: I should mention that you don't need to change any of the escapes or any other code for Zeroframe now.
Still getting same issue I got before, using 3.1.2 now - making no mods to it.  Have only ScriptCards and this... This is a Jumpgate gate - does that matter?  I guess not as you tried a 2024 game. My only extension is AdBlocker - turned it off - no change. using FireFox - if that matters - will not use Chrome.
1754434467

Edited 1754434634
Still getting  SyntaxError: Unexpected token '{'
I cannot replicate this error. I've installed all the API scripts I could from your list and the Spellbook still runs without errors. So, maybe it's one of the one's that I couldn't find?
The only other thing I can think of is if you might have custom spells? Maybe with special characters in them or something?
1754448609

Edited 1754451289
Edit: issue resolved
Yeah, that's most likely it. Probably nothing I can do about that. Is that the only one? What script is that?
Crisis averted, just a misunderstanding, everything is working now.
Novercalis said: Edit: issue resolved How?
I sent you a private message, Jim. I'll also be updating the original post for clarity when I get the chance tonight. 
Timothy B. said: I sent you a private message, Jim. I'll also be updating the original post for clarity when I get the chance tonight.  Thanks - I see.. I now set it as a Token macro for all characters which works well!
1754595698
timmaugh
Roll20 Production Team
API Scripter
Just confirming there is no issue with the Metascript Toolbox at this point (including ZeroFrame)? That's my understanding, but if I'm wrong, let me know and I can try to troubleshoot.
1754616710

Edited 1754707518
Yes, I've cleared it up. There is an undocumented format for conditionals I was using that Kurt showed me that allowed for multiple conditionals in one line. If you're curious, I used it like this:  --?";dnd5e;chloromancy;bloodwake;" -inc ";[&tmpChoice];"|[ --&Stretch|100% --&Repeat|no-repeat --]|[ --&Stretch|auto --&Repeat|repeat-y --]| It seems to work, but ZeroFrame didn't like it, it's somehow creating open brackets somwhere. It works fine when I switched it to this: --?";dnd5e;chloromancy;bloodwake;" -inc ";[&tmpChoice];"|&Stretch;100%|&Stretch;auto --?";dnd5e;chloromancy;bloodwake;" -inc ";[&tmpChoice];"|&Repeat;no-repeat|&Repeat;repeat-y But, like I said, it's undocumented, so I'm not sure if the former is appropriate at all. I'm guessing not, since we know the outcome.
1754706420

Edited 1754708369
Update to 3.2 Update to settings page, currently selected theme options are outlined by a glowing gold border. It helped to declutter as I didn't have to have sections to display what was currently selected. I took inspiration from a feature that Novercalis came up with. I've added optional Action, Bonus Action and Reaction icons to the spell listing. I've updated the first and second image in the first post to reflect the changes. You can turn on or off each action type on the settings page and also change them to a custom color. For example, if you just want Bonus and Reactions highlighted for ease of use, you can turn off just Actions. ***Important Update Information*** If you are updating from a previous version, please go into settings and click the reset button on all three new Action colors and toggle the Actions on, at least temporarily. This will create the fields on the character sheet so that there are no errors thrown to the console and will allow you to use the new feature if you'd like. Make sure to do this with each character that uses the spell book.
Update to 3.2.1 Changing the way the settings page handled displaying information introduced a bug where page number was blank when toggling actions on/off. Fixed using a conditional to determine if the page number is blank then go to page 1.
I apologize if anyone already updated to 3.2.1 today, but update to 3.3.0. Overhaul of the templates to allow them to use the entire width of the chat window. There's a lot more space for information now, and names and things aren't being cut off so soon. UPDATE NOTES: When you update, the spell book will display improperly. Please go into settings and reselect the theme you are using, this will not override any custom font colors, but will return the headers to the theme colors(just choose what you were using after you reselect the theme).
1755477981

Edited 1760233184
Updated to 3.3.1 Minor update, changed the header background image width to a static width from a dynamic one to deal with Firefox rendering HTML different than everyone else. Should be good across all browsers now.
Reserved for future update, coming soon.
1759578826

Edited 1759579089
This has stopped working now.  Nothing happens when click.  Not updated for the updates since was working 2 months ago, must be a Roll20 change in last 2 weeks? --/|Version     : 3.1.2 Updated to 3.3.1 same issue Hmm turned off /talktomyself and now works
<a href="https://wiki.roll20.net/Text_Chat#Talk_to_Myself_.28.2Ftalktomyself.29" rel="nofollow">https://wiki.roll20.net/Text_Chat#Talk_to_Myself_.28.2Ftalktomyself.29</a> Note: API commands (Pro subscription feature) will not be executed when /talktomyself is on. /talktomyself means that you see what you are t yping in chat, but it doesn't get sent out to the main chat. Because it doesn't get sent out to the main chat, it doesn't get sent to the Mod script server either.&nbsp;
Well, this is not API (Mod) but Macro and the issue returned during game even without /talktomyself being on.&nbsp; I suspect Roll20 is messing with the code again - and while doors now look and work far better than they did some things (as usual) got broken.&nbsp; Hopefully will settle down.
1760227101

Edited 1760227472
Updated to 3.4 The spellcasting ability is now also a button, clicking on it will send you to a selection of the character's stats, which when clicked will change the character's Spellcasting Ability. Beside each stat is the appropriate class or multi-class that is applicable to the character. For example, beside Intelligence it would list Wizard, Rogue, Artificer etc. as long as that is one of the character's classes. I also included Strength, Dexterity and Constitution. Even though these Stats are not usually related to a spellcasting ability, I decided to add them in case anyone was doing some crazy homebrew stuff or if they're using their spellbook for unconventional things, like items or racial/class abilities. Added four more themes, nothing too exciting.
I'm sorry if I'm being dense, but how does one perform installation steps 3 and 4?&nbsp; Do we just copy and paste the script into a macro and run it that way?
Yes, create it as a macro on the spellcaster's character sheet, name it whatever you want, Probably Spellbook or something similar and copy and paste it into the macro. Run it once to install the templates and fields on the character sheet. Do this for each character using the mod.