PDA

View Full Version : NPC autoparsing from spells



ProNobis
March 29th, 2018, 19:56
Hi guys!

As I'm working on Incarnate-Battles and getting it ready for release.

Where I am stuck right now, is that things like spellcasting npcs can pull from spells in my campaign data located at <root><spell><spellname> but when I export to a module that it no longer works.

Any ideas?

PS. by spell name I mean all lowercase no special sign names like:
acidarrow
enlargereduce
etc.

Zacchaeus
March 29th, 2018, 21:21
When you say it no longer works what do you mean? Do you mean that the spells don't populate on the NPC? As far as I am aware spells will get pulled from whatever module is open but there may also be a hierarchy in that it takes them from the PHB first, then SRD, then anything else. I'm not sure on that point. At any rate if the NPC stat block is correctly worded then the spells should be found in whatever source you have open.

Varsuuk
March 29th, 2018, 21:28
Perhaps he is packaging the adventure as a separate module which when the user opens it without the “campaign” open it can no longer find the spell?

Sounds like you need to copy the spells to the adventure mod or create a campaign spell mod?

Zacchaeus
March 29th, 2018, 21:42
Perhaps he is packaging the adventure as a separate module which when the user opens it without the “campaign” open it can no longer find the spell?

Sounds like you need to copy the spells to the adventure mod or create a campaign spell mod?

No it should find the spells whatever way you do it since the NPC stat block uses anonymous linking (sort of). As long as the trait in the NPC stat block is correctly worded FG should find the spells. I'm assuming he is using standard spells given the examples he gave above. If not then the names of the spells in the stat block would have to be the same as the spells that are in the module.

Trenloe
March 29th, 2018, 21:52
The NPC spell code looks for reference.spelldata." .. sSanitized .. "@*" wildcard module database search.

sSanitized is converted from the spell name as follows (from the comments in the 5E manager_campaigndata2.lua file):

Then convert spell name using algorithm used by Par5E to create valid XML tags for spells. (Remove all whitespace, converts to lowercase and replaces punctuation with _ char)

If spells are created in a FG campaign through the interface then exported they do not have XML tags with the sanitized spell name, it will be id-000001 etc.. So just exporting spells from a campaign won't work. Each spell XML tag at the reference.spelldata. level needs to be edited to be what FG is expecting - the sanitized spell name, not id-XXXXX.

ProNobis
March 29th, 2018, 23:01
Thank you Trenloe! I had already "sanitized" the spell names (hence why it worked in the campaign). thank you so much for the reference.spelldata, I am pretty sure that the spelldata instead of my spell was the problem. In a game will check it once we are done.

ProNobis
March 29th, 2018, 23:29
And I managed to get Enlarge/Reduce to parse correctly as enlargereduce so I think it allows for punctuation to be omitted, but I will take _ under advisement in case it proves to be wrong.

Trenloe
June 9th, 2018, 01:01
The NPC spell code looks for reference.spelldata." .. sSanitized .. "@*" wildcard module database search.

sSanitized is converted from the spell name as follows (from the comments in the 5E manager_campaigndata2.lua file):

Then convert spell name using algorithm used by Par5E to create valid XML tags for spells. (Remove all whitespace, converts to lowercase and replaces punctuation with _ char)

If spells are created in a FG campaign through the interface then exported they do not have XML tags with the sanitized spell name, it will be id-000001 etc.. So just exporting spells from a campaign won't work. Each spell XML tag at the reference.spelldata. level needs to be edited to be what FG is expecting - the sanitized spell name, not id-XXXXX.

Note - the 5E FG code has changed recently to also look for the base spell name within the exported id-XXXXX structure. so, in theory, there should be no need to manually change the id-XXXXX to sanitized spell names to get NPC spell lookups to match.