5E Character Create Playlist
  1. #1

    NPC autoparsing from spells

    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.

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,826
    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.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    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?

  4. #4
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,826
    Quote Originally Posted by Varsuuk View Post
    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.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    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.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    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.

  7. #7
    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.

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,411
    Quote Originally Posted by Trenloe View Post
    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.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in