Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31

Thread: UI layout file <-> xml converter - now handles 94% files from both ETW and NTW

  1. #21
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Quote Originally Posted by kungfuserge View Post
    Same with python 31 ; I will try with another computer

    Take a closer look, your screenshot says it's Python 2.6 not 3.x
    Error comes from c:\python2.6\lib\io.py

  2. #22

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Right ! and I have given the 31 path upon your script ; well I guess I have to go to the registry to do some changes ,
    I can't uninstall 2.6 ; I'm using it all the time

  3. #23

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Quote Originally Posted by taw View Post
    That's nothing. I need 3 virtual machines with XP, Vista,
    and Windows 7 just to test websites with various versions of IE for work ;-)

    By the way wouldn't it be easier to port that mesh converter from Python 2.x to 3.x like everything else?
    This looks like the most annoying conflict right now, and 2.x -> 3.x port is fairly simple.

    Volunteers?
    You could but that converter is very old and has little file support, if you are doing that it would be nice if you could update it. But we have uu3d for the minute, so it's not too bad.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    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

  4. #24

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Hey Taw

    BTW

    Could you deal with the Algorithms that are coding the DLC's

    I have remade all of them by hand by pictures ; but I am curious about the real model

  5. #25
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    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?

  6. #26
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Quote Originally Posted by kungfuserge View Post
    Hey Taw

    BTW

    Could you deal with the Algorithms that are coding the DLC's

    I have remade all of them by hand by pictures ; but I am curious about the real model
    I have some idea on how DLC data is encrypted (not very competently from what I've accidentally noticed), but I'm way too lazy to work on it, especially with so many more important formats still waiting.

  7. #27

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    Quote Originally Posted by kungfuserge View Post
    Right ! and I have given the 31 path upon your script ; well I guess I have to go to the registry to do some changes ,
    I can't uninstall 2.6 ; I'm using it all the time
    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.




  8. #28

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    This converter gives a lot of potential to futur mods ; an exemple:



    Thanks Taw for your work

  9. #29
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file to xml converter - now with both ETW and NTW support

    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.

  10. #30
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file <-> xml converter - now handles 94% files from both ETW and NTW

    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).

  11. #31
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: UI layout file <-> xml converter - now handles 94% files from both ETW and NTW

    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!

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •