StarWarsFoundryVTT / StarWarsFFG

StarWarsFFG System for Foundry VTT.
http://www.foundryvtt.com
MIT License
93 stars 77 forks source link

[Importer] oggDude importer broken, careers' skill matching broken #865

Open florianpiekert opened 3 years ago

florianpiekert commented 3 years ago

The importer seems to be broken in regards to how it stores the entries in the compendium database. I provide an example. I have two different Career files.

Warrior.xml.noworking.txt Warrior.xml.working.txt

The working one is from oggDude Original. The other has an updated description and a German name.

When I import either, the corresponding database entry in oggdudecareers.db is for the German named one:

{"name":"Krieger","permission":{"default":0,"YrQF2ddswdrWes3Q":3},"type":"career","data":
{"description":"[H4]Warrior[h4]\nThe Warriors...[P][H3]Sources:[h3][H4]Page 96 - Force and Destiny Core Rulebook[h4]","attributes":{
"attr1ni0wen56j":{"mod":"Athletik","modtype":"Career Skill","value":true},
"attrp8k0fwpmq1":{"mod":"Athletik","modtype":"Skill Rank","value":0},
"attrad51q3mcho":{"mod":"Handgemenge","modtype":"Career Skill","value":true},
"attrmkvcy1u0zk":{"mod":"Handgemenge","modtype":"Skill Rank","value":0},
"attrvbfo6pv4f7":{"mod":"Coolness","modtype":"Career Skill","value":true},
"attr04xv5j1x9f":{"mod":"Coolness","modtype":"Skill Rank","value":0},
"attr5z5bqliomw":{"mod":"Nahkampfwaffen","modtype":"Career Skill","value":true},
"attrv9ap7fdsw2":{"mod":"Nahkampfwaffen","modtype":"Skill Rank","value":0},
"attrgc12bspijy":{"mod":"Wahrnehmung","modtype":"Career Skill","value":true},
"attrwssbv8104p":{"mod":"Wahrnehmung","modtype":"Skill Rank","value":0},
"attrfx97t06xjl":{"mod":"Überleben","modtype":"Career Skill","value":true},
"attr590r0au1io":{"mod":"Überleben","modtype":"Skill Rank","value":0},
"attrdnssdo51w8":{"mod":"ForcePool","modtype":"Stat","value":"1"}}},
"flags":{"ffgimportid":"WAR"},"effects":[],"_id":"Bw0wc48VFIoK78m9"}

and for the oggDude original

{"name":"Warrior","permission":{"default":0,"YrQF2ddswdrWes3Q":3},"type":"career","data":
{"description":"[H4]Warrior[h4]\nPlease see page 96 of the Force and Destiny Core Rulebook for details.[P][H3]Sources:[h3][H4]Page 96 - Force and Destiny Core Rulebook[h4]","attributes":{
"attrv5fdgopdoo":{"mod":"Athletics","modtype":"Career Skill","value":true},
"attr59typnz295":{"mod":"Athletics","modtype":"Skill Rank","value":0},
"attrzb0z68rxef":{"mod":"Brawl","modtype":"Career Skill","value":true},
"attrnuvf5he4ba":{"mod":"Brawl","modtype":"Skill Rank","value":0},
"attrbdfa5wcp6g":{"mod":"Cool","modtype":"Career Skill","value":true},
"attr7hp1cjt3d4":{"mod":"Cool","modtype":"Skill Rank","value":0},
"attrd70wsd8s99":{"mod":"Melee","modtype":"Career Skill","value":true},
"attrs4b3xakwvv":{"mod":"Melee","modtype":"Skill Rank","value":0},
"attrbk8pxcuoii":{"mod":"Perception","modtype":"Career Skill","value":true},
"attrpxu783gxkd":{"mod":"Perception","modtype":"Skill Rank","value":0},
"attrvcp267d4gp":{"mod":"Survival","modtype":"Career Skill","value":true},
"attr4nj8uxf7v7":{"mod":"Survival","modtype":"Skill Rank","value":0},
"attrvvyzxzjcwn":{"mod":"ForcePool","modtype":"Stat","value":"1"}}},
"flags":{"ffgimportid":"WAR"},"effects":[],"_id":"I8azt0e1USk6fkwU"}

this is the database (in the .db file) entry for the Warrior, apparently. ffgimportid is correct WAR. But what is wrong are the KEY !!references!! to the career skills! Instead listed are the NAMES. The Warrior.xml has

  <CareerSkills>
    <Key>ATHL</Key>
    <Key>BRAWL</Key>
    <Key>COOL</Key>
    <Key>MELEE</Key>
    <Key>PERC</Key>
    <Key>SURV</Key>
  </CareerSkills>

and offcourse the skills are working ok and have correct keys and names.

But what entirely is screwed is the assigned modifications. The original oggDude: WAR_oggD_Orig_matches matches, while the German named does not WAR_myVersion

Why is this? Is it that foundry & starwarsffg "by chance" match the NAMES to the skill KEYS? Which for sure fails for the German names then, as they are completely different from the English.

Which, btw, does not explain why this is providing THESE differences here. The imported set of skills remains the same, nothing is changed. Only the career compendium is deleted and then re-imported. Works 100% reproducibly. Unfortunately for ALL careers.

ercete commented 2 years ago

Hello florianpiekert,

I'm a french user of Oggdude 2.3.4.0 / Foundry 8.9.0 / StarwarsFFG 1.6 I also encounter bugs when importing french-translated sheets & datasets into Foundry. Also : importing original oggdude files works well.

I'm gonna watch at my imported carreers to see if I encounter the same bugs as you. (edit : and it is ! ) Can you try by your side to watch at imported weapons ? Because all base skills of mine are set to Astrogation. I suppose it is related... 2021-10-29 22_14_13-Window

I started some diffs betwenn original and translated files so as to find which xml line is breaking oggdude importer. (Found for exemple that any extra skill breaks charsheet import) I'm a bit skilled in software developpement. But never played with JS or worked on SWFFG source yet. Maybe I can debugging it ?

May the force be with us.

FloSchwalm commented 1 year ago

I just took a look at this. You should not, in fact, change the Skill names in OggDude Data Editor. As it is right now the skill names are used in their english variant in several places in the code, changing the name to something localized in the OggDude skill name thus breaks matching of the skills in those cases. This even means that right now you could import the same skill (based on its ffgimportid) multiple times into the DB if the localized name differs.

There is an easier way however to achieve what you want. The skill names are already localized for those languages that have a file in the lang directory and are available in the game settings language dropdown. So the skill names will be localized at display time instead of data import time if you just import the default OggDude skill list and then change your game's language setting. You could still change the skill description in OggDude's data editor if you wish, just don't touch the skill names.

In theory it should also work if you provide a custom skill list using exactly the names you entered in OggDude data editor and import that skill list with the skill list importer, but I did not verify if that works right now.