5E Product Walkthrough Playlist
  1. #1

    Trouble with importing an XML

    Hi, I am wondering if there is something I don't understand here. FGU has the NPC-import tool. I am trying it out, and I create entries for NPCs from a PDF into Notepad++. There I tidy it up so it should give me the exact outcome in a npc-statblock I want. When I simply copy from this file into the "Import text" option it works perfectly. But I have more than one npc. In fact, I have 150. I want to import them all. With a combination of some converting and chatGPT I have found a relatively easy and efficient way of copying from the PDF into the correct format in Notepad++. But when I import the XML-file into FGu by using "Import" it says in chat "Imported record(s) from: C:\...\...\test.xml", but I can't find a single entry. (I am trying with 3 npc's in the XML-file atm).

    I add the file as an attachment, but I do not get any error-messages, the log says "Imported file "C:\...\...\test.xml" to database node "npc"

    Anyone can help me? I tried to search the forums and the web for answers, but everyone are talking about the "Import text" function, and I can't find anyone trying to import several npc's at the same time. The closest was one person with a description of how to import items via excel, and not really answering my question.

    To sum up: My issue is that when I import an XML-file the content just doesn't show up anywhere, despite me appearently getting a message it succeeded
    Attached Files Attached Files

  2. #2
    Sulimo's Avatar
    Join Date
    Dec 2014
    Location
    Pacific Time Zone
    Posts
    876
    I'm not sure the formatting you have will work.

    It's best to export an existing NPC to see the structure FG expects.

    Like this one from the 5E SRD:

    Code:
          <aboleth>
            <locked type="number">1</locked>
            <name type="string">Aboleth</name>
            <type type="string">aberration</type>
            <size type="string">Large</size>
            <ac type="number">17</ac>
            <actext type="string">(natural armor)</actext>
            <hp type="number">135</hp>
            <hd type="string">(18d10 + 36)</hd>
            <speed type="string">10 ft., swim 40 ft.</speed>
            <abilities>
              <strength>
                <score type="number">21</score>
                <bonus type="number">5</bonus>
              </strength>
              <dexterity>
                <score type="number">9</score>
                <bonus type="number">-1</bonus>
              </dexterity>
              <constitution>
                <score type="number">15</score>
                <bonus type="number">2</bonus>
              </constitution>
              <intelligence>
                <score type="number">18</score>
                <bonus type="number">4</bonus>
              </intelligence>
              <wisdom>
                <score type="number">15</score>
                <bonus type="number">2</bonus>
              </wisdom>
              <charisma>
                <score type="number">18</score>
                <bonus type="number">4</bonus>
              </charisma>
            </abilities>
            <savingthrows type="string">Con +6, Int +8, Wis +6</savingthrows>
            <skills type="string">History +12, Perception +10</skills>
            <senses type="string">darkvision 120 ft., passive Perception 20</senses>
            <alignment type="string">lawful evil</alignment>
            <languages type="string">Deep Speech, telepathy 120 ft.</languages>
            <cr type="string">10</cr>
            <xp type="number">5900</xp>
            <traits>
              <id-00001>
                <name type="string">Amphibious</name>
                <desc type="string">The aboleth can breathe air and water.</desc>
              </id-00001>
              <id-00002>
                <name type="string">Mucous Cloud</name>
                <desc type="string">While underwater, the aboleth is surrounded by transformative mucus. A creature that touches the aboleth or that hits it with a melee attack while within 5 feet of it must make a DC 14 Constitution saving throw. On a failure, the creature is diseased for 1d4 hours. The diseased creature can breathe only underwater.</desc>
              </id-00002>
              <id-00003>
                <name type="string">Probing Telepathy</name>
                <desc type="string">If a creature communicates telepathically with the aboleth, the aboleth learns the creature's greatest desires if the aboleth can see the creature.</desc>
              </id-00003>
            </traits>
            <actions>
              <id-00001>
                <name type="string">Multiattack</name>
                <desc type="string">The aboleth makes three tentacle attacks.</desc>
              </id-00001>
              <id-00002>
                <name type="string">Tentacle</name>
                <desc type="string">Melee Weapon Attack: +9 to hit, reach 10 ft., one target. Hit: 12 (2d6 + 5) bludgeoning damage. If the target is a creature, it must succeed on a DC 14 Constitution saving throw or become diseased. The disease has no effect for 1 minute and can be removed by any magic that cures disease. After 1 minute, the diseased creature's skin becomes translucent and slimy, the creature can't regain hit points unless it is underwater, and the disease can be removed only by heal or another disease-curing spell of 6th level or higher. When the creature is outside a body of water, it takes 6 (1d12) acid damage every 10 minutes unless moisture is applied to the skin before 10 minutes have passed.</desc>
              </id-00002>
              <id-00003>
                <name type="string">Tail</name>
                <desc type="string">Melee Weapon Attack: +9 to hit, reach 10 ft. one target. Hit: 15 (3d6 + 5) bludgeoning damage.</desc>
              </id-00003>
              <id-00004>
                <name type="string">Enslave (3/Day)</name>
                <desc type="string">The aboleth targets one creature it can see within 30 feet of it. The target must succeed on a DC 14 Wisdom saving throw or be magically charmed by the aboleth until the aboleth dies or until it is on a different plane of existence from the target. The charmed target is under the aboleth's control and can't take reactions, and the aboleth and the target can communicate telepathically with each other over any distance.\rWhenever the charmed target takes damage, the target can repeat the saving throw. On a success, the effect ends. No more than once every 24 hours, the target can also repeat the saving throw when it is at least 1 mile away from the aboleth.</desc>
              </id-00004>
            </actions>
            <legendaryactions>
              <id-00001>
                <name type="string">Options</name>
                <desc type="string">The aboleth can take 3 legendary actions, choosing from the options below. Only one legendary action option can be used at a time and only at the end of another creature's turn. The aboleth regains spent legendary actions at the start of its turn.</desc>
              </id-00001>
              <id-00002>
                <name type="string">Detect</name>
                <desc type="string">The aboleth makes a Wisdom (Perception) check.</desc>
              </id-00002>
              <id-00003>
                <name type="string">Tail Swipe</name>
                <desc type="string">The aboleth makes one tail attack.</desc>
              </id-00003>
              <id-00004>
                <name type="string">Psychic Drain (Costs 2 Actions)</name>
                <desc type="string">One creature charmed by the aboleth takes 10 (3d6) psychic damage, and the aboleth regains hit points equal to the damage the creature takes.</desc>
              </id-00004>
            </legendaryactions>
            <token type="token">tokens\A.png@DD5E SRD Bestiary</token>
          </aboleth>

  3. #3
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,663
    I don't think you can import more than one at a time; but to be fair I've never tried it so I don't know for sure.
    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 http://fgapp.idea.informer.com/

  4. #4
    Where do you find these structures? I've tried to search around, but I only found the template I used in my version

  5. #5
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,663
    Quote Originally Posted by Vegard View Post
    Where do you find these structures? I've tried to search around, but I only found the template I used in my version
    In the modules folder inside FGData you'll find the SRD bestiary module. Make a copy of that and rename the .mod to .zip and then unxip the file. You'll find the xml for all the NPCs in the bestiary. However the NPC import doesn't import xml files it imports simple text files. And as I said above you can only import one NPC at a time.

    What I think you are doing is actually creating an npc file which you could paste into a db.xml file inside a newly created campaign. So you'd create a new campaign, close it down and then open the db.xml file from inside the campaign folder. You can then paste your npc file into that db.xml file and provided all of the NPCs are in the format that @Sulimo posted above when you re-open the campaign the NPCs should be listed in that campaign. You could then export that from there into a module that you could use in other campaigns.
    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 http://fgapp.idea.informer.com/

  6. #6
    Okey, I do the same thing, with the structure you gave Sulimo. I tidy everything up and I try again with my 3 test-npcs. The exact same thing happens, and I get the exact same message in log and in chat. I attached my new test-versions to see if anyone can help me.

    Test 2 is all 3 npcs, Test 3 is just one of them to see if it was as Zacchaeus suggested and you only can import one at a time. Same result.

    Maybe a silly question, but could it be that they end up somewhere else in FGU than under npc's?

    I tried what you said Zacchaeus and pasted them into a new campaign, but I got the same thing. They do not show up in the npcs
    Attached Files Attached Files
    Last edited by Vegard; October 14th, 2023 at 22:06.

  7. #7
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,663
    Attached below is what the db.xml file should look like. I created a new campaign and then closed it down. I created a single npc just with a name and then exited the campaign. I then pasted your xml from Test3 in between the <npc></npc> tags and then opened the campaign up and your npc is there. With regard to the import; again I took your xml code I converted the file to a text file and copied the text from the file (without the <root></root> stuff and the NPC imported fine. So I'm not sure why it isn't working for you.
    Attached Files Attached Files
    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 http://fgapp.idea.informer.com/

  8. #8
    I got it to work! I put in 3 npc's at the same time, worked perfectly, but I had to do it within the db.xml-file. But now I have one final question: The note, where should that go? It does not show up in any of the npcs. I am talking about the description of the monster.

  9. #9
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,663
    Quote Originally Posted by Vegard View Post
    I got it to work! I put in 3 npc's at the same time, worked perfectly, but I had to do it within the db.xml-file. But now I have one final question: The note, where should that go? It does not show up in any of the npcs. I am talking about the description of the monster.
    It goes inside the npc like so;

    Code:
    <text type="formattedtext">
    <p>This is a note</p>
    </text>
    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 http://fgapp.idea.informer.com/

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