5E Product Walkthrough Playlist
  1. #1

    Editing Spell Data (5e)

    I'm looking at amending the 'sName' field of some spells (in the Spelldata.lua file) to add additional text into the effects tab when the spells are added to the players character sheet.

    I'm currently doing this when my extension initialises in the hope that it will remain compatible with other extensions if they are editing or amending the Spelldata file also.
    (Just using the shield spell as an example).

    Code:
    test=DataSpell.parsedata
    
    
        for key, value in pairs(test) do
            if key=="shield" then
                value[1].sName=value[1].sName.." ;(new text here)"
            end
        end
    This need tidying up ofc, but before I continue I would appreciate any input if there is a neater/better way of achieving what I want.

    *Edit*
    Also a question to the Devs...
    Do spells from additional sourcebooks i.e. Xgte get placed in Spelldata.lua or do they go elsewhere.

    Cheers, Steve.
    Last edited by Stv; June 12th, 2022 at 14:50.

  2. #2
    Most spells attempt to parse the data directly from the spell text, which is not always able to be done cleanly. The data_spell.lua file is simply an override for how spells are parsed into actions.

    If you are wanting to override the behavior of how a particular spell is parsed, I would just replace the whole thing (i.e. replace "shield" entry), instead of trying to inject into the details.

    Regards,
    JPG

  3. #3
    Thanks for the info Moon Wizard. I'll have a delve into the parser.

    Cheers, Steve.

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
  •  
5E Character Create Playlist

Log in

Log in