PDA

View Full Version : PFRPG Spell Description Formatting



bmos
July 19th, 2020, 15:20
This extension modifies the character-specific copies of spells (accessed via their actions tab) to allow fully-formatted descriptions including italics, tables (detect magic is a great example), links, etc.

Screenshot showing stock v3.3.11 vs my extension:
37865

Extension Homepage, README, and Codebase (https://github.com/bmos/FG-PFRPG-Spell-Formatting)
FantasyGrounds Forge (https://forge.fantasygrounds.com/shop/items/30/view)
Ext Files and Changelog (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases)
License Information (https://github.com/bmos/FG-PFRPG-Spell-Formatting/blob/master/LICENSE.md)
Bug Tracker and Suggestions (https://github.com/bmos/FG-PFRPG-Spell-Formatting/issues)

To avoid my threads taking over the PF1e subforum, I publish most updates in my combo thread (https://www.fantasygrounds.com/forums/showthread.php?60308-bmos-extensions) (with only major updates in this individual thread which is primarily for discussion and bug reports). To ensure you're kept informed of future updates, either subscribe to that thread (for updates to all my extensions) or create a GitHub account and follow the specific repository of each extension you use. Or just check the releases linked in the first post of the thread periodically.

LordEntrails
July 19th, 2020, 18:23
Nice work :)

And thanks for explicitly stating your license terms, really appreciate it and sure others do as well.

Zacchaeus
July 19th, 2020, 18:37
Wasn't this issue just fixed in the latest update?

Kelrugem
July 19th, 2020, 19:06
Wasn't this issue just fixed in the latest update?

The issue normally was that formattings added extra spaces and paragraphs after the formatting got erased, and that got indeed fixed now in 3.3.11 :) But, when I understand bmos correctly, then bmos's extension even keeps the formattings while they are still erased in the native code :) (just tested: Tables for example still are replaced with pure text in the native code)

bmos
July 19th, 2020, 19:09
The issue normally was that formattings added extra spaces and paragraphs after the formatting got erased, and that got indeed fixed now in 3.3.11 :) But, when I understand bmos correctly, then bmos's extension even keeps the formattings while they are still erased in the native code :) (just tested: Tables for example still are replaced with pure text in the native code)Exactly.

I actually didn't know that part was getting fixed in 3.3.11 (oops! hehe), but the formatting is still an improvement.
The other great thing about it is being able to include links in those spells that say "functions as _____ except" so you can look up the 'dependencies' quicker.

Kelrugem
July 19th, 2020, 19:13
Exactly.

I actually didn't know that part was getting fixed in 3.3.11 (oops! hehe), but this is still a big improvement for my games.
The other great things is being able to include links in those spells that say "functions as _____ except" so you can look up the 'dependencies' quicker.

Cool :D

Though links normally still worked, the links are just places at the very bottom then for some reason :D But I really like that tables still look like tables, that is the most important for me :D

dllewell
July 21st, 2020, 01:08
Thank you. Very useful.

darrenan
July 21st, 2020, 16:24
Are we expected to rename the .zip to .ext ourselves? I didn't see any other download options in the link provided.

bmos
July 21st, 2020, 16:31
Are we expected to rename the .zip to .ext ourselves? I didn't see any other download options in the link provided.ah, a client called in the middle of re-uploading. thanks, fixed :)
EDIT: I posted a new version to improve the experience for spells that are dragged in before installing the extension. No more blank boxes!

EDIT: aug 4 2020
new version: https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.1.5

dllewell
August 27th, 2020, 17:19
I found an interesting little glitch.

I have added some links to a number of the spells from the PFRPG - Spellbook and when those spells are dragged to the character sheet those links show up twice.

It's a very minor issue ... both links work correctly. But wanted to at least point it out.

You can see this in the latest version of the spellbook (4.2). Some spells that you can see this in are - Enlarge Person, Hollow Blade, and Honeyed Tongue

38859

Kelrugem
August 27th, 2020, 17:36
I found an interesting little glitch.

I have added some links to a number of the spells from the PFRPG - Spellbook and when those spells are dragged to the character sheet those links show up twice.

It's a very minor issue ... both links work correctly. But wanted to at least point it out.

You can see this in the latest version of the spellbook (4.2). Some spells that you can see this in are - Enlarge Person, Hollow Blade, and Honeyed Tongue

38859

Yeah that is indeed normal, the native code of FG already preserves the links, but a little bit different. It first erases the link in the text itself but recreates it at the bottom as in your screenshot :) This extension though preserves the links in the text and all the other formattings, leading to the doubled link :)

bmos
August 27th, 2020, 20:06
I didn't have an example of an official spell that used links (has anyone seen one they didn't make themselves before dllewell's work?), so I totally forgot to hide that!
Tuesday's update will hide the duplication under the formatted description.

dllewell
September 18th, 2020, 23:35
Hey bmos,
I've got an interesting one for you.

The Spell Formatting Extension conflicts with Kelgurem's Save Versus Tag Extension when used by the PFRPG - Spellbooks module.

Specifically the auto population of the 'School' and 'Other properties and tags' doesn't happen when the Spell Formatting Extension is loaded.

If you want to see it in action look at the Acidic Spray spell.

The cast action xml for that spell is:
<actions>
<cast>
<onmissdamage type="string">half</onmissdamage>
<savetype type="string">reflex</savetype>
<type type="string">cast</type>
<stype type="string">spell</stype>
<school type="string">Conjuration</school>
</cast>
</actions>

Note that the <school> tag has a value but the <othertags> tag does not - in fact there is no <othertags> tag.

If I drag this spell onto the character action sheet when 'Save Versus Tags' is loaded but 'Spell Formatting' is NOT loaded then the 'School' and 'Other properties and tags' fields are correctly populated in the Cast action.
39488

If I do the same thing when 'Spell Formatting' IS loaded then the 'School' and 'Other properties and tags' fields do not get populated.
39489

Something else I found while testing, that may, or may not, help with troubleshooting.
If I remove all the actions from the xml (not just the cast action ... all the actions) then a cast action is automatically created and the 'School' and 'Other properties and tags' fields are correctly populated even when the 'Spell Formatting' extension IS loaded.

bmos
September 18th, 2020, 23:53
...The Spell Formatting Extension conflicts with Kelgurem's Save Versus Tag Extension when used by the PFRPG - Spellbooks module...Wow! That's so comprehensive! Thank you :)
I have a theory as to why why this is happening and, if I'm right, the fix should be pretty easy.

EDIT: I've submitted the spell formatting improvement code to Kelrugem for inclusion in Save Versus Tags (and the other extensions which include it).
This thread will stay up for those who want to use it without Kel's extensions.

Kelrugem
September 25th, 2020, 13:34
Oh, I completely forgot to update here: bmos provided me his code such that I can integrate it into save versus tags which should solve the incompatibility of save versus tags and spell formatting :) But I had no time so far too look at the code at the moment, but soon (TM) hopefully :)

dllewell
September 25th, 2020, 15:20
You are both awesome. Thank you.

bmos
September 25th, 2020, 15:25
You are both awesome. Thank you.Right back at you :)

Kelrugem
September 25th, 2020, 15:46
You are both awesome. Thank you.

thanks, too :)

Kelrugem
October 8th, 2020, 23:12
Oh, I completely forgot to update here: bmos provided me his code such that I can integrate it into save versus tags which should solve the incompatibility of save versus tags and spell formatting :) But I had no time so far too look at the code at the moment, but soon (TM) hopefully :)

Sadly, I was not yet able to look at this; I really have a lot of stress right now, but the thesis takes longer and longer and longer sadly :D At the same time I need to find a job afterwards and it sadly looks like that I need to live several months without salary until the PhD is done (since academic salaries are sadly often limited in time, which becomes stressful when the task is more difficult than anticipated); I hope I can fix this soon, but it can really take a while sadly :)

bmos
October 8th, 2020, 23:19
I can probably make a 'compatibility patch' version of this for the interim :)
Hopefully the job hunt takes you somewhere good, although months without salary is quite a bummer.

Kelrugem
October 9th, 2020, 01:17
I can probably make a 'compatibility patch' version of this for the interim :)
Hopefully the job hunt takes you somewhere good, although months without salary is quite a bummer.

thanks :)

ah, an interim patch would be super cool :D

bmos
October 9th, 2020, 02:29
Turns out I was able to do the patch in the main extension!
No real need to integrate the two, really. Much easier than I thought.
v1.1.7 is here (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.1.7) :)

Kelrugem
October 9th, 2020, 02:39
Turns out I was able to do the patch in the main extension!
No real need to integrate the two, really. Much easier than I thought.
v1.1.7 is here (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.1.7) :)

ah, very cool, thanks a lot :D

dllewell
October 9th, 2020, 13:54
Turns out I was able to do the patch in the main extension!
No real need to integrate the two, really. Much easier than I thought.
v1.1.7 is here (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.1.7) :)

I tested this with the PFRPG - Spellbook, and both extentions loaded, and it works great. Thank you.

bmos
October 9th, 2020, 13:57
I tested this with the PFRPG - Spellbook, and both extentions loaded, and it works great. Thank you.Thanks for the confirmation, any community testing is greatly appreciated :)

bmos
November 8th, 2020, 14:17
I made huge improvements to the code this morning.
No changes to functionality, but here is v1.2 (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.2).
57 additions and 386 deletions to keep things nice and trim/tidy.
It's now 5.18 KB instead of 8.34 KB :D

bmos
February 15th, 2021, 20:33
v1.4 (https://github.com/bmos/FG-PFRPG-Spell-Formatting/releases/tag/v1.4) now released.

Better detection of spells for automatic upgrading of their spell descriptions.
Checked compatibility with upcoming Tuesday update.
Cleaner code

Khoredran
February 19th, 2021, 15:04
I don't know why, but when I use this extension with modules that I created for a campaign, all the spell descriptions of custom effects and consumable items that I created for specific NPCs disappear. The spell descriptions of the PFRPG - Spellbook are kept for the NPCs that I dragged & dropped these spells to. When I deactivate the extension, the descriptions come back immediately. This is quite peculiar and impeded some of my games since I was clueless at that time as to why the descriptions I wrote in the module were simply not there when they were loaded in my playing campaign. I only found out today that it was indeed this extension that was problematic. Any idea as to why this happens? Should I do an extra step while exporting my modules or is there a specific description layout needed to carry over when the module is loaded?

Note that I haven't created a spell entry for the custom effects for the NPC's.
Also, the spell description of the PFRPG Action Library that I dragged & dropped in NPC's disappear too.

I am using FGU

Thank you very much for your help.

bmos
February 19th, 2021, 15:34
when I use this extension with modules that I created for a campaign, all the spell descriptions of custom effects and consumable items that I created for specific NPCs disappear.
When I deactivate the extension, the descriptions come back immediately.That's because this extension hides the 'true description' and fetches the (usually better) fully-formatted description from the spellbook module.
I can update it to have it bring over the real description when it doesn't find a match from the spellbook, I think that would solve your use case.
I have filed this as issue #5 (https://github.com/bmos/FG-PFRPG-Spell-Formatting/issues/5) and am looking into it now. Strangely I do have code to do this already, but something must not be triggering it correctly.

Khoredran
February 19th, 2021, 15:38
That would be amazing! Thanks to you, I now understand why my issue occured and it might help other people out there that wanted to use this extension but got missing descriptions when using custom-made modules! I am very impressed by the quick response and I'm eager to download the updated version of the extension that will work for me.

bmos
February 19th, 2021, 15:57
That would be amazing! Thanks to you, I now understand why my issue occured and it might help other people out there that wanted to use this extension but got missing descriptions when using custom-made modules! I am very impressed by the quick response and I'm eager to download the updated version of the extension that will work for me.It looks like when I modified the code to replace descriptions with those from the spellbook, I didn't include a fallback to write the basic description back to the new field (even though it still did all the work to upgrade it to fully-formatted text!).

Khoredran
February 19th, 2021, 16:27
Well now it works like a charm, thank you so much!