• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

larienna

Second Lieutenant
3 Badges
Jul 1, 2012
139
0
  • Warlock 2: The Exiled
  • Warlock: Master of the Arcane
  • 500k Club
I decided to dig back into modding this morning, but I am having issues with XML modifications. Editing in game works fine, but when you change the XML either the modifications are not retained in the mod, and on the next xr decompression, I lose everything I added. Or eiher the locdata.xml strings are not applied to the game.

For the first part, I suspect there is something with mod refreshing and saving. I happned to modify a mod and uncheck before exiting and I lost my modification done in editor. Maybe unchecking or checking the mod after xml modification could change something. I'll have to test, but it took a while before my logicparams in data.xml got applied and remained in the mod after decompression.

The second issue is that my locdata.xml is retained in the mod but it's not applied. I changed glyph names, god names and resistance names with copy pasted code from my old mod which used to work, and it is simply not used. I even read the thread I posted 2 years ago, and I did everything I did at that time. Maybe the string names has been modified, I'll have to check it out.

In my old mod, I had the whole data.xml structure, now I only have the new modified stuff because creating a new mod does no copy everything. Maybe I need to copy the whole data.xml to actually override these text strings.
I don't remember from where it should be extracted, I think it's from some of the game archives if I remember correctly. I don't want to copy my old mod, because it's buggy and the modifications will not be the same.
 
I am making some test with logic params. This pos is more like a log of action to decipher how to commit the XML modification to the mod.

- I started to modify start gold and mana then I compress.
- I decompressed to see if the compression worked. It worked.
- I started the game, the mod was already on, I created a new game, modifications were not applied
- I removed the mod, restarted the game, added the mod. Create a new game, modification not applied.
- I edited 1 value in the mod from the editor. Exited the game, started a new game, modidication not applied
but when uncompressing the XML I lost the modification I made to gold and money in the first place.

So exiting the game seems to save the mod, but opening the game does not seem to load it.

- I tried changing gold an again and now it worked. WTF!

Maybe I need to open the editor to trigger the "fact" that there has been a modification to the mod and then it will consider it. Let's try it again.

- I change gold and mana, compress everything
- start new game, modification not applied
- I enter and exit the editor immediately, then start a new game, moddification not applied.
- I decompress the file, gold and mana are still there.

So it does not seem to "save" anything if no modification is done in the editor.

- Let's go in the editor again, change one variable
- decompress the file and now it revert back my xml changes.
- but If I make the xml mod again and compress
- and it does not work

So I really cannot find the logic to make the xml modifications saved into the mod. I though the mod could have been duplicated, or have an update flag, or only update itself it unchecked in the list of leaded mods.

Next step, copy the entire data.xml. Still not sure if I will be able to commit the changes. I'll look at the old documentation so see if there is any instructions regarding xml editing.
 
I made further testing, I think the reason the XML did not get retained is because my compression script made a backup of the .xr files in a sub folder and the backup overrided the modified files. I made the backup elsewhere, so now any modifications get applied.

The only thing that remains is the locdata.xml that does not get applied. I gonna try copying the whole data.xml. It's just strange that glyphs did not change names as they have entries in the data.xml.