crnormand / gurps

Implementing a GURPS 4e game aid for Foundry VTT
MIT License
105 stars 49 forks source link

[BUG] Importing characters that exported from GCA5 fails with multiple errors #1308

Closed Klasodeth closed 2 years ago

Klasodeth commented 2 years ago

When attempting to import a character exported from GCA5 using Export To Foundry VTT v. 1.0.0.12 into Foundry, the following errors appear:

Error parsing XML: error on line 82 at column 18: error parsing attribute name.
This file was created with an older version of the GCA5 export which does not handle inventory text well.

Checking my exported character, I found the following at line 82:

<unmodifiedDamage="string">thr-1 cr</unmodifiedDamage>

if I modify all instances of <unmodifiedDamage="string"> to <unmodifiedDamage type="string">, the character imports with only the second warning about the older version of the GCA5 export.

In ExportToFoundryVTT.vb, if I make the same changes at lines 978 and 1108, then export a character, the character imports into Foundry without having to manually modify the exported file.

crnormand commented 2 years ago

ExportToFoundryVTT.zip Thanks for the heads up!

I have made the change to the public version, and I will send it to Armin so that it will be available through the GCA5 distribution system.

Until then, I have attached the fixed GCA5-12 export script (in a zip file). Please extract it to your ExportToFoundryVTT directory. It "should" fix the "older version" issue as well.

crnormand commented 2 years ago

Armin said it would be pushed tomorrow.

Klasodeth commented 2 years ago

I can confirm the updated export script resolved the first error.

I'm still receiving the warning about the older version of the GCA5 export. Looking in actor.js I find the following at line 1896:

let vernum = 1

The next reference to vernum is at line 1930. Here's a snippet of lines 1929-1931:

        if (isFoundryGCA5) {
          if (vernum < 12) {
            msg.push(i18n('GURPS.importGCA5ImprovedInventoryHandling'))

I don't see any other references to vernum between these two lines, so it appears that line 1930 checks to see if vernum is less than 12. Since at this point vernum is still set to 1, the older version warning will always be triggered.

This issue appears to only affect GCA5 exports. If GCA4 is used instead, line 1930 never executes, and vernum gets updated before it is compared against anything.

crnormand commented 2 years ago

Dang... you are right. Since I don't have GCA5 running, I haven't been able to test. I "think" I have the fix... and will deploy it soon. Fortunately, the message is just a warning (although annoying).

crnormand commented 2 years ago

https://github.com/crnormand/gurps/pull/1311

Farmeroz commented 2 years ago

Armin has pushed an update and I installed it. Unfortunately, it's still hard bugged (import doesn't work).

Error parsing XML: error on line 863 at column 18: error parsing attribute name.

This file was created with an older version of the GCA5 export which does not handle inventory text well.

This is line 863 in the file (which has worked previously):

<unmodifiedDamage="string">thr-1 cr</unmodifiedDamage>

crnormand commented 2 years ago

Well, that isn't the file I gave him last night. But I'll check.

Farmeroz commented 2 years ago

That's from the Exported File, sorry - might have confused things with the way I wrote that. I presumed that was relevant because the error message would relate to the file being imported?

crnormand commented 2 years ago

I understand you. The unmodified damage element was incorrect, and was fixed. The file I sent to Armin yesterday evening had it fixed. Either he hasn't propogated it yet, or her grabbed the wrong ZIP file I sent him. He said that he is reluctant to make a lot of small releases... so who knows. I've attached the currently fixed file ExportToFoundryVTT.zip

Farmeroz commented 2 years ago

OK that works fine apart from the warning message that you already noted. Thanks, Chris.