5e Spell Library - Addon for Melek's Simple 5e Framework

Framework(s) for D&D 5e.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Merudo »

Spells can be notoriously tricky to consult, keep track of, and cast. This Spell Library addon for Melek's Simple 5e Framework aims to provide a powerful framework to manage spells in a 5e game.

Features:

- Contains nearly every spell for the game, including those from the PHB, SCAG, and XGtE.
- Spells can be quickly searched for by name, by level, by source, or by class
- Spells can be learned by any token, after which the spell can be consulted through the token's Spell Book
- Spell preparation can be kept track of with a simple mark at the left of each spell name
- Clickable links in the spell description, to trigger saving throws, ability checks, damage rolls, conditions, and more on the selected targets
- Each spell can be cast through either Intelligence, Wisdom, or Charisma, for which the correct DC will be calculated

Instructions:
  1. Put the spell Lib:SpellLibrary token on a map, and drag the "Spell Library" and "Spellbook" macros to the Campaign Panel
  2. Impersonate the token you wish to use to cast spells
  3. Click on "Spell Library", browse spells, and add them via the "Learn" button on the right of each spell
  4. Click on "Spellbook" macro, and check your spells. You can prepare them by clicking the dot on the left.
  5. To cast, click on the "+" sign on the left of the spell to read the spell description. Select the tokens that will be affected, and click on the keyword to trigger the effect (saving throw, skill check, etc)
The classic Fireball spell.
Image
Spell Library, containing 786 spells
Image
Spell Book of a token
Image
Clicking on the saving throw automatically rolls it
Image
Rolling the saving throw for Acid Splash
Image
Change Log
Update 1.4.2 (5/28/2020)

- The sort order within a token's spellbook will now be remembered next time the spellbook is opened again. The order is stored in the variable "SpellbookOrder"

Update 1.4.1 (5/17/2020)

- Fix bug where rolling for damage would fail if no tokens were targeted
- Remove lone quote being printed to chat if changing the casting stat of a spell not known

Update 1.4 (5/15/2020)

- New feature: damage prompts to the GM! GMs will now receive a prompt in the chat when a damage link is clicked on a spell while targets are selected. The GM can change how much damage each target should receive, and press the DMG button to confirm. All targets will take the damage automatically. Feature can be disabled in Config, and requires MapTool 1.7 to work.
- Corrected a few spells having duplicated condition links
- Fix MapTool hanging when using the token editor with the Spell Library
- New link "Macro" under "Share" to create a shortcut macro to a spell on a token. The shortcut's color represents the school of the spell.

Update 1.3 (5/10/2020)

- Add Artificer to the list of class filters
- Fix spell material component not being displayed
- Fix caster image not being displayed when not impersonating a character
- Add new system to add Custom Spells! Spells are added through the "Add Custom Spell" macro, and modified and deleted through the "Modify Custom Spell" macro.

Update 1.2 (5/7/2020)

- Add Configuration menu. Currently only used to specify when a token should receive a Spellbook macro
- Fix clicking on the column name of a subtable sorting the spells
- Fix spells with apostrophe in their name not working
- Fix spells so upcasting to level 9 now possible
- Fix slight error in upcasting damage calculation
- Change upcasting spells to display the rolls for the base spell and upcasted bonus separately
- Change Saving Throw / Checks / Attacks to display the spell DC if no target are selected
- Change spell attacks to display the damage of a critical hit
- Library now available on GitHub

Update 1.1 (5/4/2020)

- Fix Spell Library and Spellbook macro to execute immediately when clicked
- Add a Spellbook macro to tokens when they learn their first spell
- Add "Share" button in each spell description, which prints a link to the spell in the chat
- Change upcasting links so that casters can choose the level they wish to cast a spell at
- Fix saving throws and skill checks if the token is not properly configured for Melek'ss framework

On Github
Attachments
Lib_SpellLibrary_v1.4.2.rptok
(386.67 KiB) Downloaded 1238 times
Lib_SpellLibrary_v1.4.1.rptok
(385.57 KiB) Downloaded 145 times
Lib_SpellLibrary_v1.3.rptok
(382.14 KiB) Downloaded 121 times
Lib_SpellLibrary_v1.1.rptok
(374.73 KiB) Downloaded 117 times
Lib_SpellLibrary_v1.rptok
(373.07 KiB) Downloaded 124 times
Last edited by Merudo on Thu May 28, 2020 4:30 pm, edited 8 times in total.

User avatar
digiacom
Cave Troll
Posts: 44
Joined: Thu Sep 27, 2018 3:00 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by digiacom »

This is incredible. Played with it yesterday and my group immediately started using it.

To make the saving throws work even better, I've updated the 'Convert 5e Monster Token' macro to correctly pull save and skill proficiency bonuses into the system when run on Bobifle's drop-in monster tokens.

I've Included this as a recommended add-on in my updated Version 2.0 post right below the main download. Those fireballs will be easier to cast then ever! ;)
viewtopic.php?f=8&t=28308
a.k.a. Melek on Discord.
Check out my Simple 5e Framework!

User avatar
rogue_ronin
Kobold
Posts: 7
Joined: Tue Apr 21, 2020 3:16 pm

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by rogue_ronin »

So awesome.

Is there a Github project?

Aloha.

OokOok
Kobold
Posts: 15
Joined: Wed Nov 13, 2019 12:27 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by OokOok »

Merudo:

Thanks so much for your great spellbook drop-in. If you are seeking input for enhancement ideas, I offer the following:

1) If casting a Concentration spell and prior spell cast was also Concentration, offer caster a dialog along the lines of "Casting <spell2> will disrupt your concentration of <spell1>. Is that OK?" Response might be Y/N, or even Y/N/not relevant. (Maybe spell1 was cast so far in the game past that it would no longer be active anyway). No need to enforce anything - this is just a handy reminder to the caster that the last spell cast ALSO required concentration.

2) When casting Spell X, consult a table (which can be edited) and - if that spell appears in the table - the table describes a) states to auto-apply to the caster and target (different values); b) light table effects to auto-apply to caster and target (again, different tables), c) token to be placed on map under caster's control. For example, assume the effects table looked something like this (using pseudo-JSON):
{"Barkskin":{"casterState":"concentation","targetState":"barkskin","casterLight":"",""targetLight":"","token":""},
"Cloud of Daggers":{"casterState":"concentation,otherState","targetState":"","casterLight":"",""targetLight":"","token":"Cloud of Daggers.rptok"},
"Fairie Fire":{"casterState":"concentation","targetState":"fairie fire","casterLight":"",""targetLight":"ffire","token":""}}

If I cast Barkskin, I automatically get the Concentration state added to me. Whoever I cast it on - might be myself(!) - gets the Barkskin state.

If I cast Cloud of Daggers, I get BOTH Concentration state and otherState (whatever that is - this is to illustrate the idea that there might be multiple states to assign), AND the Cloud of Daggers token (which we assume exists somewhere in my library) is placed on the map so it can be moved around as a bonus action in subsequent rounds.

If I cast Fairie Fire, I get Concentration, the target gets the FF state (which is probably a ring around the token) PLUS is assigned a Light Source of "ffire", which I'd define in my Lights table (perhaps under a "Spell Effects" heading)? In this example, I'd define some kind of 10' radius aura as per the spell's description.

I think these enhancement (particularly #2) would make spellcasting so much easier since the effects could be automated.

If these suggestions are something that you'd like to consider...I've been working on analysis of PHB and XGE spells and would be happy to provide anything (from the raw analysis up through JSON tables) if that would be helpful.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Merudo »

OokOok wrote:
Tue May 19, 2020 7:14 pm
Merudo:

Thanks so much for your great spellbook drop-in. If you are seeking input for enhancement ideas, I offer the following:

1) If casting a Concentration spell and prior spell cast was also Concentration, offer caster a dialog along the lines of "Casting <spell2> will disrupt your concentration of <spell1>. Is that OK?" Response might be Y/N, or even Y/N/not relevant. (Maybe spell1 was cast so far in the game past that it would no longer be active anyway). No need to enforce anything - this is just a handy reminder to the caster that the last spell cast ALSO required concentration.

2) When casting Spell X, consult a table (which can be edited) and - if that spell appears in the table - the table describes a) states to auto-apply to the caster and target (different values); b) light table effects to auto-apply to caster and target (again, different tables), c) token to be placed on map under caster's control. For example, assume the effects table looked something like this (using pseudo-JSON):
{"Barkskin":{"casterState":"concentation","targetState":"barkskin","casterLight":"",""targetLight":"","token":""},
"Cloud of Daggers":{"casterState":"concentation,otherState","targetState":"","casterLight":"",""targetLight":"","token":"Cloud of Daggers.rptok"},
"Fairie Fire":{"casterState":"concentation","targetState":"fairie fire","casterLight":"",""targetLight":"ffire","token":""}}

If I cast Barkskin, I automatically get the Concentration state added to me. Whoever I cast it on - might be myself(!) - gets the Barkskin state.

If I cast Cloud of Daggers, I get BOTH Concentration state and otherState (whatever that is - this is to illustrate the idea that there might be multiple states to assign), AND the Cloud of Daggers token (which we assume exists somewhere in my library) is placed on the map so it can be moved around as a bonus action in subsequent rounds.

If I cast Fairie Fire, I get Concentration, the target gets the FF state (which is probably a ring around the token) PLUS is assigned a Light Source of "ffire", which I'd define in my Lights table (perhaps under a "Spell Effects" heading)? In this example, I'd define some kind of 10' radius aura as per the spell's description.

I think these enhancement (particularly #2) would make spellcasting so much easier since the effects could be automated.

If these suggestions are something that you'd like to consider...I've been working on analysis of PHB and XGE spells and would be happy to provide anything (from the raw analysis up through JSON tables) if that would be helpful.
I agree all of these would be great to implement.

However, my library is designed to be a "drop-in" for Melek's framework. This mean defining new states, halos, or light sources is outside the scope of the library.

You can ask Melek to ceate these states/halos/lights/etc., and if he does, I'll do my best to have the spells assign them.

OokOok
Kobold
Posts: 15
Joined: Wed Nov 13, 2019 12:27 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by OokOok »

Merudo wrote:
Wed May 20, 2020 8:31 am
However, my library is designed to be a "drop-in" for Melek's framework. This mean defining new states, halos, or light sources is outside the scope of the library.

You can ask Melek to ceate these states/halos/lights/etc., and if he does, I'll do my best to have the spells assign them.
Fair enough...and a bit of a poser for me, since I'm using this as a drop-in for Rod's framework! He mentioned that he's giving your code a close look and considering whether he can substitute your stuff for his. In fact, if there were a way your code could support generic attribute mapping (i.e. some way for the user to define that YOUR thing called - just making up names here - intMod = MY thing called intelligenceMod) your module is already pretty much perfect for ANY 5e framework. You'd, of course, default stuff for Melek's FW, but others could still drop into their FW, redefine the mapping, and viola! Of course, attribute mapping is a different topic and I don't want to muddy the waters too much...

My thought was that user-editable tables = your module may deliver with Melek-centric settings but actually still remains FW-agnostic under the hood. I agree that you don't want to create states/lights/halos, etc...but a configurable lookup table allows ME to define the end states/lights/halos/etc and allows me to let the spells use whatever I decide to build. It also remains expansion-ready to support spells yet-to-be-defined. So if you deliver a Melek-ready module that has Melek-specific refs like this made-up one: "{"Fairie Fire":{"casterState":"concentation","targetState":"fairie fire","casterLight":"",""targetLight":"ffire","token":""}}" AND a table editor, others are totally free to redefine that into "{"Fairie Fire":{"casterState":"superduperconc","targetState":"color ring","casterLight":"",""targetLight":"glow","token":""}}". You don't have to build/distribute the superduperconc state, the color ring state, nor the glow aura def - that's on the other guy to worry about.

Personally, I think your module is so well-implemented that it deserves to be considered the de facto solution to doing spells in a 5e FW. If I had the skills to design a FW - which I most assuredly don't - I'd start by say, "well, spellcasting is already taken care of, so what's next?" Hence, my thoughts are really all revolving around how to extend what you've done in ways that are still FW-agnostic.

Of course, I understand that my ideas = asking someone else to do work. That's MY special skill, honed to a fine edge after years of being an IT manager. :D So I totally get it if this still doesn't align with how you conceive of your drop-in and you don't want to pursue it further.

Illydth
Kobold
Posts: 3
Joined: Sat Jun 20, 2020 4:21 pm

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Illydth »

Merundo:

Ok, so you and I probably need to hop on a chat somewhere for about 15 minutes.

I've got a new framework that's about to be released to the community doing pretty much exactly what OokOok is asking for in his part 2: It takes a spell effect that is being cast and sets states (both campaign and trackable spell states) for those spells being cast.

It's an attempt to get around the problem of there being 478 spells in D&D5e (or some other hundreds in pathfinder, etc.) with well over 1/4 of them setting some kind of state that isn't an official D&D 5e state (think Mage Armor, Stoneskin, etc.).

I, too, am implementing a spell library for 5th Edition of 478 spells...same ones you are.

* The first problem is, we've both chosen a different format for the JSON we're using to track and implement these same spells.
* The second problem is we've chosen to store that format in different locations: you on your spell token, me through a MapTool Table.

You and I are basically doing the same thing from two different sides of the same coin: Your library is implementing castable spells while mine is implementing trackable spells. I even have some easy to use APIs in my framework that yours could end up calling to set those states without you having to do pretty much any additional work (when someone "casts" a spell you'd make a call to one API to set whatever states the database says it should set and my framework takes over from there).

And yes, i'm using Simple 5e as my base as well, and working with Melek regarding some additional states to make this all work.

At the very least, I'd like to have a conversation with you about the JSON format you're using and how/where you're building it from. Even if we choose to stay separated on WHERE we store our spell data for our formats at least we'd be using the SAME data. However, if we can come together on the WHERE as well, it would allow people to potentially implement the frameworks for different systems.

I look forward to a short conversation to talk through this with you. Let me know if you're interested.

Rese
Kobold
Posts: 4
Joined: Tue Jun 30, 2020 1:12 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Rese »

I am getting errors when I try to use the spell library and spell book macros. I just downloaded the most recent version, in case something had broken. I am using the Malek's Simple 5e 2.1 framework campaign file as the base map, and copied the token there. It had worked last week.

When I select only the spell library and click the spell library macro, I get the full list of spells. If I copy the macros to the campaign window select a copy of "standard token", and click the Spell Library button in the campaign window, I get the following errors, and no spells are shown.
ReferenceError: Can't find variable: vCast
ReferenceError: Can't find variable: QuoteSymbol

If I impersonate the copy of "standard token, select the spell library, and click the spell library macro, it shows the spells, but doesn't have a learn button, even when expanded to maximum width.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Merudo »

I can't reproduce the error. Could you share the campaign?

Rese
Kobold
Posts: 4
Joined: Tue Jun 30, 2020 1:12 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Rese »


Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Merudo »

Rese wrote:
Fri Jul 03, 2020 1:47 pm
https://drive.google.com/file/d/1NtN3RY ... sp=sharing is the campaign file I'm using.
In Campaign Properties, you have defined a "*@Spells" field that interferes with the spell library.

Remove that field and it works.

Rese
Kobold
Posts: 4
Joined: Tue Jun 30, 2020 1:12 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Rese »

Thank you, Merudo!

pecardouzo
Kobold
Posts: 1
Joined: Tue Sep 08, 2020 1:26 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by pecardouzo »

Hey, can anyone give a tip on how you might add a bit of code to make it decrement a Custom Counter so we can also already handle spell slots?3

Thanks!

User avatar
Maccwar
Cave Troll
Posts: 94
Joined: Sun Oct 12, 2008 9:22 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Maccwar »

Really love this Add-on. Thanks for all your efforts.

Are you planning to add any of the new material from TCoE as well?

Rodek
Kobold
Posts: 3
Joined: Sat Mar 06, 2021 11:01 am

Re: 5e Spell Library - Addon for Melek's Simple 5e Framework

Post by Rodek »

Hello. Help please.
I followed the instructions on how to use the token, but all I got was this error message.
Ficha librería "Lib:SpellLibrary" desconocida.
Error trace : Spell Library@Lib:SpellLibrary <<< Spellbook@campaign

What can I do?

Post Reply

Return to “D&D 5e Frameworks”