Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
It seems this innocently named int28 is actually a count of some nested data structure.
It starts from ascii 'OnCreate', and then has (in certain files) 246 more bytes.
ui/samples_ntw/battle ui/inspire_bling - synchronizes after 246 correctly
[0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 66, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 194, 128, 0, 0, 0, 0, 1, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 1, 0, 0, 255, 255, 255, 255, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 195, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 3, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0]
ui/samples_ntw/battle ui/xp_bling - synchronizes after 246 correctly
[0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 66, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 194, 128, 0, 0, 0, 0, 1, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 1, 0, 0, 255, 255, 255, 255, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 1, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 195, 64, 0, 0, 0, 128, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 3, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0]
ui/samples_ntw/battle ui/lb_unit_id - does not resynchronize, first 246 bytes:
[0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 100, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 88, 88, 88, 24, 0, 0, 3, 0, 48, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 100, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 88, 88, 88, 24, 0, 0, 3, 0, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 100, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 88, 88, 88, 24, 0, 0, 3, 0, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, 100, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 88, 88, 88, 24, 0, 0, 3, 0, 48, 48, 51, 0, 0, 0, 0]
So there's probably some kind of size somewhere inside. The first guess would be this 5 vs 13.
These blocks of 255s might correspond to substructure of this record.
Unfortunately figuring this out would still give out only three more converted files.
(unless some other file has this in addition to something else undecoded...)
Any ideas?
By the way, has anyone actually done anything useful with ui layout files so far?
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Do this:
Install both python. I suppose you have now a C:\Python26 and a C:\python31. Right click on MyComputer\Properties\Advanced tab. In Enviroment Variables go in PATH in second window and add at the end of the line:
1. if you want to work with 2.6 C:\Python26
or
2. if you want to work with 3.1 C:\Python31
Do not forget to separate the new path you add with semicolon ";" from the existing last entry.
I'm happy to inform you that every single damn ui layout file Version032 and Version033 now converts both way perfectly.
Version025: {"not supported"=>1}
Version027: {"not supported"=>1}
Version028: {"not supported"=>3}
Version029: {"not supported"=>5}
Version030: {"not supported"=>2}
Version031: {"not supported"=>1}
Version032: {"ok"=>17}
Version033: {"ok"=>136}
Version039: {"ui->xml fail"=>4, "ok"=>129}
That's 94% of all ETW and NTW ui layout files.
I'm not sure if there's terribly much point in bothering with the remaining 6%.
Here's the full list of files which do not convert:
Version025: {"not supported"=>["samples_etw/frontend ui/lan"]}
Version027: {"not supported"=>["samples_etw/campaign ui/challenge_to_duel"]}
Version028: {"not supported"=>["samples_etw/frontend ui/battle_preparation", "samples_etw/frontend ui/single_player", "samples_ntw/frontend ui/single_player"]}
Version029: {"not supported"=>["samples_etw/campaign ui/sabotage", "samples_etw/common ui/dialog_ok", "samples_etw/common ui/dialog_yes_no", "samples_ntw/common ui/dialog_ok", "samples_ntw/common ui/dialog_yes_no"]}
Version030: {"not supported"=>["samples_etw/campaign ui/layout_unit_routs", "samples_ntw/campaign ui/layout_unit_routs"]}
Version031: {"not supported"=>["samples_etw/campaign ui/mp_grand_campaign"]}
Version039: {"ui->xml fail"=>["samples_ntw/battle ui/inspire_bling", "samples_ntw/battle ui/lb_unit_id", "samples_ntw/battle ui/xp_bling", "samples_ntw/common ui/menu_bar"]}
If you see something terribly important for Version025 to Version031 - Version032 converter would be reasonably easy to adapt to them, probably.
It's mostly figuring out what needs to be deleted (that's pretty much how I extended Version039 converter to support Version032/Version033 - that
plus a bunch of bug fixes).
Fixing remaining Version039 means decoding a weird data structure I described a few posts ago in this thread, and would be probably a lot more work.
It would probably be a good idea to merge three conversion scripts, but as they currently work just fine, I'll probably leave this for indefinite later.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
I merged converters so now convert_ui.py handles Version032, Version033, and Version039.
It should make using converter a lot more convenient.
By the way, to simplify converter XMLs for all formats contain the same fields -
fields which don't exist in old formats just have 0s there, and will be ignored on conversion back.
If you have problem with this try converting to binary and back to xml and see that your data is really there.
(I might fix it someday, just not now).
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
I'm going to resurrect this old thread, and say that I made it work with Shogun 2 files now. Unless I'm terribly confused, I think that's the first time modding Shogun 2 UI is possible.
It's in the usual place.
Merry Christmas!
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.