PDA

View Full Version : Creating a new spells module [3.5e/PFRPG]



Callum
July 30th, 2014, 10:13
To make a library spell module that merges the existing 3.5E spells with any new spells you wish to add, perform the following steps.


Make a copy of 3.5E-spells.mod (you will find this in the "modules" folder in your Fantasy Grounds Application Data folder).

Rename the copy to "3.5E-spells-mine.zip" (note this includes changing the file extension from .mod to .zip).

Unzip 3.5E-spells-mine.zip.

There are three files in 3.5E-spells-mine: client.xml, definition.xml and thumbnail.png. Open definition.xml with Notepad (or your editor of choice). It has six lines. Change the <name> from "3.5E Spells" to "3.5E Spells Mine" (or whatever), then save the file and close it.

Open the client.xml file. If you do not have a better editor, use Notepad (but I would recommend downloading and using the free Notepad++). On the fifth line, that starts <name type="string">, change the name to exactly what you changed the <name> to in the definition file (my suggestion was "3.5E Spells Mine"). It must match exactly, including case.

You need to stop the spell lists from doubling up when they're displayed in the Library. So change the fourth line of the client file from <d20spells static="true"> to <d20spellsMine static="true"> (or whatever). You also need to change the change the closing element (further down the file, right above </library>) to match, from </d20spells> to </d20spellsMine>.

Next you need to give all the lists of spells a unique name. To do that, find and replace every instance of "spelllists" with "spelllistsMine" (or whatever name you want). (NB. When mass replacing, it's a good idea to make a copy of the file beforehand, because you can really mess a file up with a mistake or typo, and it's often easier to start over than repair the mess.)

That last change broke the links in the <library> entries, since they are now referring to "spelllistsMine", but still pointing at "3.5E Spells". To fix that, for each <library> entry, from <bard> to <domains>, change the end of the <recordname> from "@3.5E Spells" to "@3.5E Spells Mine". The library links will now point to the lists in this module, rather than the original one. Make sure you don't change any other instances of "@3.5E Spells" - only those between the <library> and </library> tags.

Now scroll down to find the first spell entry, <acid arrow>. Move your cursor to the start of the next line under it, <acid fog>. Scroll down to the end of </zoneoftruth>, but before the closing </spelldesc> tag (this is a long way down - over half-way through the whole file). Hold down Shift and click at the end of </zone of truth>. You should now have every spell entry except the first selected. Press Delete to get rid of them, then save the file.
What have you done here? You've made a shell of the old library module. If you finished now, started Fantasy Grounds and activated both 3.5E Spells and 3.5E Spells Mine, you'd find you could still open spells in 3.5E Spells Mine and see the full spell descriptions. But didn't you just delete (almost) all the spells in 3.5E Spells Mine? You did, but you didn't delete the links in the spell lists that form the second half of the file - and these still point at the original 3.5E Spells module. If you deactivated the 3.5E Spells module, you wouldn't get the spell descriptions any more (and in the chat window you'd get a message saying something about the 3.5E Spells module being inaccessible). So as long as the 3.5E Spells library module is activated, all the original spells will be accessible from your new module.

The next step is to add your spell(s) to your new module. You kept Acid Arrow as an example, so start by changing all the elements of this to your first new spell. Mostly you should only change the bits between the tags (eg changing <name type="string">Acid Arrow</name> to <name type="string">Mage Armor, Greater</name>), but you will need to change the opening and closing tags themselves (eg <acidarrow> and </acidarrow> to <magearmorgreater> and </magearmorgreater>) - note that these tags need to be unique to each spell, which shouldn't generally be a problem if you're using the spell names, but it's something to keep in mind. If you're feeling confident, copy and paste the spell template and keep adding new ones, otherwise carry on with the following steps. You can always come back and add more spells later.

Next you need to add the new spell(s) to the appropriate class lists. Let's say I was adding Greater Mage Armor, a 3rd-level Sor/Wiz spell, and I've already input it into the <spelldesc> element, where I tagged it as <magearmorgreater>. Now I go down to <spelllistsMine> and find the nested <wizard> group which holds the <level3> spells. I want to insert my new spell in here. I'm going to follow the convention and insert the spell in the M listing, not the G. I scroll down and find where Greater Mage Armor should go - between <lightningbolt> and <magiccircleaginstchaos>. I copy and paste the <lightningbolt> entry so I have two copies of the entry, one after the other. Then I use the second <lightningbolt> entry as a template to make the link to the new spell, Greater Mage Armor. To do this, I change the element names from <lightningbolt> and </lightningbolt> to <magearmorgreater> and </magearmorgreater>. Next, I change the <recordname> to point at the new spell. In this example, I change "[email protected] Spells" to "[email protected] Spells Mine". Basically, I have just created a link to the spell description in this module (as with the library links in step 8, above).

Copy and paste this new link into any other class lists, wizard school lists, or cleric domains you need to add the spell to. (In the example above, that would include the <level3> section of the <conjurationschool> of the <wizardschools> lists.) Make sure you adjust the level number if the spell is granted at different levels in other classes.

Now save client.xml, close it, and zip the three files back together (client.xml, definition.xml and thumbnail.png). It is important you zip only the three files and do not include the folder the files are in. Rename the zip file "3.5Espellsmine.mod" (or whatever), including changing the .zip extension to .mod, then move it to the "modules" folder in your Fantasy Grounds Application Data folder.
You're now ready to run Fantasy Grounds and play with your new spellbook!

Bidmaron
July 31st, 2014, 04:29
A very nice step-by-step on a shockingly complex thing. Nice, Callum.

Callum
July 31st, 2014, 12:49
Thanks, Bidmaron. However, these instructions were originally written by Griogre, who thus deserves most of the credit. I later expanded, edited, and updated them, but the core of it is still his work!

Callum
August 1st, 2014, 17:04
These instructions can also be used to create other types of library modules - for feats, classes, or what-have-you - with minor adjustments.

gmkieran
August 4th, 2014, 15:27
Sticky and wiki! Definitely a resource that needs to be readily available.

Cheers!

Netjera
February 17th, 2015, 01:25
I managed to successfully do this with the PFRPG Spells Module (great directions, thanks!), but I'm having trouble applying it to the Magic Items Module. It's written slightly differently.

Line 3 simply says <library static="true"> instead of <library> followed by a second line with the library name and then the static reference. Since I didn't want to duplicate everything, I changed Line 3, and added Line 4, to read:

<library>
<CustomMagicItems static="true">

and made closing tags

</CustomMagicItems>
</library>

I followed all other directions exactly, changing the file name in the definition.xml file, and making all other changes into db.xml. However, when I add the module to my campaign, it shows up correctly, and it has the correct lists, but when you click on one of the lists, such as "Potions", it gives this error: Script Error: [string "common/scripts/windowtitlebar.lua"]:18: attempt to index local 'nodeTitle' (a nil value). Furthermore, the list is empty. No entries at all. This is true for all the lists.

Could someone tell me what I've done wrong, please? Thanks!

Netjera
February 26th, 2015, 07:12
Never mind, I figured it out. I changed the name of the pointer, as per the spells module directions, but failed to change the name of the corresponding reference. lol

JohnD
February 26th, 2015, 16:02
To make a library spell module that merges the existing 3.5E spells with any new spells you wish to add, perform the following steps.


Make a copy of 3.5E-spells.mod (you will find this in the "modules" folder in your Fantasy Grounds Application Data folder).

Rename the copy to "3.5E-spells-mine.zip" (note this includes changing the file extension from .mod to .zip).

Unzip 3.5E-spells-mine.zip.

There are three files in 3.5E-spells-mine: client.xml, definition.xml and thumbnail.png. Open definition.xml with Notepad (or your editor of choice). It has six lines. Change the <name> from "3.5E Spells" to "3.5E Spells Mine" (or whatever), then save the file and close it.

Open the client.xml file. If you do not have a better editor, use Notepad (but I would recommend downloading and using the free Notepad++). On the fifth line, that starts <name type="string">, change the name to exactly what you changed the <name> to in the definition file (my suggestion was "3.5E Spells Mine"). It must match exactly, including case.

You need to stop the spell lists from doubling up when they're displayed in the Library. So change the fourth line of the client file from <d20spells static="true"> to <d20spellsMine static="true"> (or whatever). You also need to change the change the closing element (further down the file, right above </library>) to match, from </d20spells> to </d20spellsMine>.

Next you need to give all the lists of spells a unique name. To do that, find and replace every instance of "spelllists" with "spelllistsMine" (or whatever name you want). (NB. When mass replacing, it's a good idea to make a copy of the file beforehand, because you can really mess a file up with a mistake or typo, and it's often easier to start over than repair the mess.)

That last change broke the links in the <library> entries, since they are now referring to "spelllistsMine", but still pointing at "3.5E Spells". To fix that, for each <library> entry, from <bard> to <domains>, change the end of the <recordname> from "@3.5E Spells" to "@3.5E Spells Mine". The library links will now point to the lists in this module, rather than the original one. Make sure you don't change any other instances of "@3.5E Spells" - only those between the <library> and </library> tags.

Now scroll down to find the first spell entry, <acid arrow>. Move your cursor to the start of the next line under it, <acid fog>. Scroll down to the end of </zoneoftruth>, but before the closing </spelldesc> tag (this is a long way down - over half-way through the whole file). Hold down Shift and click at the end of </zone of truth>. You should now have every spell entry except the first selected. Press Delete to get rid of them, then save the file.
What have you done here? You've made a shell of the old library module. If you finished now, started Fantasy Grounds and activated both 3.5E Spells and 3.5E Spells Mine, you'd find you could still open spells in 3.5E Spells Mine and see the full spell descriptions. But didn't you just delete (almost) all the spells in 3.5E Spells Mine? You did, but you didn't delete the links in the spell lists that form the second half of the file - and these still point at the original 3.5E Spells module. If you deactivated the 3.5E Spells module, you wouldn't get the spell descriptions any more (and in the chat window you'd get a message saying something about the 3.5E Spells module being inaccessible). So as long as the 3.5E Spells library module is activated, all the original spells will be accessible from your new module.

The next step is to add your spell(s) to your new module. You kept Acid Arrow as an example, so start by changing all the elements of this to your first new spell. Mostly you should only change the bits between the tags (eg changing <name type="string">Acid Arrow</name> to <name type="string">Mage Armor, Greater</name>), but you will need to change the opening and closing tags themselves (eg <acidarrow> and </acidarrow> to <magearmorgreater> and </magearmorgreater>) - note that these tags need to be unique to each spell, which shouldn't generally be a problem if you're using the spell names, but it's something to keep in mind. If you're feeling confident, copy and paste the spell template and keep adding new ones, otherwise carry on with the following steps. You can always come back and add more spells later.

Next you need to add the new spell(s) to the appropriate class lists. Let's say I was adding Greater Mage Armor, a 3rd-level Sor/Wiz spell, and I've already input it into the <spelldesc> element, where I tagged it as <magearmorgreater>. Now I go down to <spelllistsMine> and find the nested <wizard> group which holds the <level3> spells. I want to insert my new spell in here. I'm going to follow the convention and insert the spell in the M listing, not the G. I scroll down and find where Greater Mage Armor should go - between <lightningbolt> and <magiccircleaginstchaos>. I copy and paste the <lightningbolt> entry so I have two copies of the entry, one after the other. Then I use the second <lightningbolt> entry as a template to make the link to the new spell, Greater Mage Armor. To do this, I change the element names from <lightningbolt> and </lightningbolt> to <magearmorgreater> and </magearmorgreater>. Next, I change the <recordname> to point at the new spell. In this example, I change "[email protected] Spells" to "[email protected] Spells Mine". Basically, I have just created a link to the spell description in this module (as with the library links in step 8, above).

Copy and paste this new link into any other class lists, wizard school lists, or cleric domains you need to add the spell to. (In the example above, that would include the <level3> section of the <conjurationschool> of the <wizardschools> lists.) Make sure you adjust the level number if the spell is granted at different levels in other classes.

Now save client.xml, close it, and zip the three files back together (client.xml, definition.xml and thumbnail.png). It is important you zip only the three files and do not include the folder the files are in. Rename the zip file "3.5Espellsmine.mod" (or whatever), including changing the .zip extension to .mod, then move it to the "modules" folder in your Fantasy Grounds Application Data folder.
You're now ready to run Fantasy Grounds and play with your new spellbook!
Excellent instructions. Out of curiosity, how much would the above change if someone were to look at creating a custom spell module for Castles & Crusades?

damned
February 26th, 2015, 21:29
John - the instructions are pretty good for any CoreRPG based ruleset.
There is a d20 Spell Book module that works with CnC floating around somewhere.
You could peek in there too to compare notes.

JohnD
February 26th, 2015, 21:59
John - the instructions are pretty good for any CoreRPG based ruleset.
There is a d20 Spell Book module that works with CnC floating around somewhere.
You could peek in there too to compare notes.

Ah yes, good idea... thanks for that reminder. Unfortunately my memory isn't what it once was. :|

Farnaby
May 17th, 2015, 03:04
I've been looking through the xml file and it seems straightforward, but I'm having difficulty with one major thing.
Where are the spell effects? E.g. Color Spray

<colorspray>
<name type="string">Color Spray</name>
<school type="string">Illusion (Pattern) [Mind-Affecting]</school>
<level type="string">Bloodrage 1, magus 1, Sor/Wiz 1</level>
<components type="string">V, S, M (red, yellow, and blue powder or colored sand)</components>
<castingtime type="string">1 standard action</castingtime>
<range type="string">15 ft.</range>
<effect type="string">Cone-shaped burst</effect>
<duration type="string">Instantaneous; see text</duration>
<save type="string">Will negates</save>
<sr type="string">Yes</sr>
<description type="formattedtext"><p>A vivid cone of clashing colors springs forth from your hand, causing creatures to become stunned, perhaps also blinded, and possibly knocking them unconscious. Each creature within the cone is affected according to its HD.</p><p><i>2 HD or less:</i> The creature is unconscious, blinded, and stunned for 2d4 rounds, then blinded and stunned for 1d4 rounds, and then stunned for 1 round. (Only living creatures are knocked unconscious.)</p><p><i>3 or 4 HD:</i> The creature is blinded and stunned for 1d4 rounds, then stunned for 1 round.</p><p><i>5 or more HD:</i> The creature is stunned for 1 round.</p><p>Sightless creatures are not affected by <i>color spray</i>.</p></description>
<shortdescription type="string">Knocks unconscious, blinds, and/or stuns weak creatures.</shortdescription>
</colorspray>

So far so good, but when you add it to a character's spell list, it has a cast with a will save and 3 different effects and I can't find these anywhere in this xml file.
It's most frustrating. Can someone please help me out?

Trenloe
May 17th, 2015, 03:09
So far so good, but when you add it to a character's spell list, it has a cast with a will save and 3 different effects and I can't find these anywhere in this xml file.
It's most frustrating. Can someone please help me out?
There are no effects in the base spell modules. FG makes an attempt at parsing out effects when the spell is dragged to the PC/NPC sheet. As 3.5E/Pathfinder doesn't use a repeatable format for the spell descriptions (unlike 4E and 5E) this results in a lot of spells not having complete/fully accurate effects once they've been added to the PC/NPC sheet.

Farnaby
May 17th, 2015, 03:23
Hmmm, I see, that is problematic.
Do you think creating an extension would work?
Or setting up a character that has all the spells with the correct effects and dragging from them?

I'm only asking because there are now lots of spells missing and correcting spells after dragging from the spellbook is somewhat tedious.
OTOH, I'm learning my way round xml and how FG works. There's always a bright side. :-)

yeknom
October 28th, 2015, 09:27
Hi all,

Fairly new to Fantasy Grounds. I have tried my best to follow the instructions listed on the first page of this thread but I keep coming up with an end tag error, any suggestions on why this may be and what I should do to correct it?

Callum
October 28th, 2015, 09:51
Hi all,

Fairly new to Fantasy Grounds. I have tried my best to follow the instructions listed on the first page of this thread but I keep coming up with an end tag error, any suggestions on why this may be and what I should do to correct it?
What editor are you using to do the work? There are several free editors that should give you assistance with troubleshooting end tag errors.

Could you cut-and-paste the error and the relevant section of the file into a post here?

yeknom
October 28th, 2015, 13:00
What editor are you using to do the work? There are several free editors that should give you assistance with troubleshooting end tag errors.

Could you cut-and-paste the error and the relevant section of the file into a post here?

I am using Notepad++. I have figured out the error, I simply overlooked </i>, it is working now. Thanks for your reply though:)

Samarex
November 13th, 2015, 22:51
Callum or anyone that can answer it, I use this allot now so first thanks for putting it up, helped out allot.
But what I want to know.
This mod now depends on the base spell mod being loaded also (which makes sense) but is there a way to force include the base mod when you load the my spells
I know its not that hard to do in the game but Im working on some stuff that is going to include several mods and I want to make sure all the mods are open when I open mine.
Thanks

Lord Xtheth
March 9th, 2018, 21:11
I almost wish you could just right click the library space and "Create new" just like everything else. I suppose that'd be too easy for us non-programming users though.

Trenloe
March 10th, 2018, 14:10
I almost wish you could just right click the library space and "Create new" just like everything else. I suppose that'd be too easy for us non-programming users though.
I’m not sure what you’re asking for here. You can export to a module, select "read only" and the library entry lists for whichever data type you select during export will be created.

Lord Xtheth
March 10th, 2018, 16:21
I’m not sure what you’re asking for here. You can export to a module, select "read only" and the library entry lists for whichever data type you select during export will be created.
I mean creating a whole new library. Lets say I want to put "Focus" "Type" and "powers" libraries in Numenera. I'm very surpised that you can't just right click the library space, create a new library, get prompts for the fields you need, and just set one up that way. XML makes my brain want to crawl out my ear lol.

Trenloe
March 10th, 2018, 21:05
I mean creating a whole new library. Lets say I want to put "Focus" "Type" and "powers" libraries in Numenera. I'm very surpised that you can't just right click the library space, create a new library, get prompts for the fields you need, and just set one up that way. XML makes my brain want to crawl out my ear lol.
MW answered most of this in your other post.

Basically, this is something that would have to be done outside of the main Fantasy Grounds interface - as it is not just a case of an simple right-click to add a new record set to the underlying ruleset database structure. It needs to be embedded in the base ruleset itself - which you can't change through the FG interface. You'd need to imprison your brain in your skull and learn some XML! ;)

Slagmoth
August 8th, 2020, 02:49
Just out of curiosity is it possible to extend the DD PHB Deluxe for 5E in a similar way or can you point me in the direction of such instructions?

I want to be able to override the descriptions for a couple of spells as they are slightly different in my custom world.

Any help would be appreciated. Thanks

LordEntrails
August 8th, 2020, 03:05
Just out of curiosity is it possible to extend the DD PHB Deluxe for 5E in a similar way or can you point me in the direction of such instructions?

I want to be able to override the descriptions for a couple of spells as they are slightly different in my custom world.

Any help would be appreciated. Thanks
The 5E PHB is encrypted and can not be modified directly. You can though use it as a basis for creating your own PHB, but you will have a lot of work. I can think of 2 ways;
1) Create a development campaign, in that load the PHB, copy the entries you want, modify them. Export to module. Whenever you want you then will have to load both modules in your play campaign and know to use the modified entries since the originals will still be there.
2) load the PHB in your play campaign, unlock and edit the desired entries. This method will not allow you to transfer (easily) these changes to other campaigns.

Slagmoth
August 8th, 2020, 03:20
The 5E PHB is encrypted and can not be modified directly. You can though use it as a basis for creating your own PHB, but you will have a lot of work. I can think of 2 ways;
1) Create a development campaign, in that load the PHB, copy the entries you want, modify them. Export to module. Whenever you want you then will have to load both modules in your play campaign and know to use the modified entries since the originals will still be there.
2) load the PHB in your play campaign, unlock and edit the desired entries. This method will not allow you to transfer (easily) these changes to other campaigns.

Thanks for the reply.

I realized they were encrypted so I was trying to do overrides of the varying elements in the XML if that is possible. Obviously, they do that for their Windows classes when creating an extension. I thought that maybe the node for merging would be included inside those interactions as well.

The idea is something akin to the old way that they did dynamic webpages by replacing bits of the HTML with XML for display only.

I take it that Extension functions and files only affect .pak and the UI files?

LordEntrails
August 8th, 2020, 03:48
I'm missing something here...

Extensions (.ext) modify ruleset (.pak) code. The PHB etc are stored in module files (.mod & .dat). Modules get loaded after rulesets and extensions get loaded. Therefore you can't use a .ext or .pak file to modify a module file.

Slagmoth
August 8th, 2020, 04:26
That was what I thought but I had not come across a confirmation on that. That build order makes sense but makes me sad that I cannot do what I want in the game. I have a work around but it removes the possibility of .mod file being updated if that ever happens.

I may just have to throw together an application that will do some of that for me after I create the base .mod file for my house rules then.

It is just so annoying that there are so many duplications within this system. Especially true in Savage Worlds although one of the extensions I found helps that ruleset it is still a bit of a bone of contention for me in 5E.