Closed Einheit-101 closed 2 years ago
You'll need to be a lot more specific. Send me the before / after files, decoded, and encoded, and I'll check what's going on.
Sure, here is the original file extracted with Pack File Manager, the decompiled XML file, the changed XML file (Changed line 4401) and the encoded, changed file that causes the freeze when trying to load a game with it: https://www.dropbox.com/s/w34rgub7j4ec9j5/files.zip?dl=0
I am simply trying to enable the money/public order info for all provinces, not just for the selected one because CA "forgot" to add this simple feature from games of the past. Turns out, it isnt nearly as simple as i thought, because the LUAC files controlling this are simply dummy files that do nothing and this XML is horror to read or edit.
OK, found the issue.
You're using a text editor that converted endings in that xml from Unix endings (LF) to Windows endings (CRLF). That's not what converter expects, and these extra CRs find their way into the binary.
Now arguably converter should handle it better, as many Windows editors do this. It's not complicated, just not something I considered.
For now could you try it with some editor that autodetects and preserves line endings like VSCode? (if you open a freshly converted file it should say "UTF-8 LF" somewhere in right side of the bottom bar; if it says "UTF-8 CRLF", that's the wrong endings). Just delete those xml files as they already have bad endings, start fresh, and don't edit them in any editor that might mess them up.
If I have some time I'll add a workaround to the converter too, but it should let you get it working.
I use notepad++, i can try changing utf code there. I have UTF-8 UTF-8-BOM UTF-16 BE-BOM UTF-16 LE-BOM
I used this tutorial to change CRLF to LF: http://sql313.com/index.php/blog/62-using-notepad-to-change-end-of-line-characters
However still freeze.
I need to add, your converter already gives me CRLF files, not LF, so there is clearly something wrong
I recommend just try using VSCode instead of Notepad++ until I figure out the fix.
I just used Vscode and the game still freezes and i had to convert the file in vscode from CRLF to LF
I had a similiar issue, what eventually worked for me was to change line 58 in ui\lib\ui_builder.rb
from
Pathname(path).write(@data)
to
Pathname(path).binwrite(@data)
This actually works! Now i just need to find out how to send data to the city_info_bar via script because it seems total war only updates certain informations if a city is selected by cursor...
OK, replaced .write
with .binwrite
.
If it works, closing the issue.
You can decompile UI files and recompile them without altering them, but as soon as you change a simple color value the game will freeze while trying to load a campaign file.
I changed line 4401 in city_info_bar file from 198 to 255 and the game wont load anymore.