Results 1 to 16 of 16

Thread: Help Locating Provincial Mercenary UI

  1. #1
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Help Locating Provincial Mercenary UI

    Hi everyone,

    I have spent hours looking for this one icon, trying to find where it is located in the files. I would REALLY appreciate if someone could push me in the right direction.

    The specific icon is the one that appears in the top right corner of a units unit card when they are provincial mercenaries - I have put a photo of it below in the spoiler section.

    Spoiler Alert, click show to read: 
    This is the icon I am looking for

    Click image for larger version. 

Name:	Provincial Merc UI 2.jpg 
Views:	9 
Size:	30.2 KB 
ID:	359607

    And this is where it is in game

    Click image for larger version. 

Name:	Provincial Merc UI 1.jpg 
Views:	7 
Size:	658.5 KB 
ID:	359606


    Again, I'd REALLY appreciate help with this, I have spent soooo long looking and can't seem to find it, or where the icon name might be mentioned in the db files

  2. #2
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    I´m not at home this week, can check it in 2-4 days if you need more help. This is not touching DB at all...that is probably your problem

    Wild quess rome_data.pack or rome_data2.pack both are holding graphic files!.... easiest way to find it is to extrack whole UI folder and you can manually search all pictures. There is one folder under UI in both packs with common graphics. That is probably location of icon.

    Ingame usage is probably drawn via unit_panel (somewhere under UI/campaign files) ...which is hex coded file but you can extract it as well, open it in any hex editor ( https://hexed.it/ ) and search for path to the icon. (this is alternative how to find where is icon stored).

    Now it depends on what you are trying to do.

    1) change icon for new one...then simply add new icon with old name and folder structure into your mod.
    2) you can edit the unit_panel and change the name for new icon. Just keep the same lenght of pathway string to the new picture. And folder structure as well.
    Last edited by Daruwind; September 27, 2019 at 04:07 PM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  3. #3
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    Quote Originally Posted by Daruwind View Post
    I´m not at home this week, can check it in 2-4 days if you need more help. This is not touching DB at all...that is probably your problem

    Wild quess rome_data.pack or rome_data2.pack both are holding graphic files!.... easiest way to find it is to extrack whole UI folder and you can manually search all pictures. There is one folder under UI in both packs with common graphics. That is probably location of icon.

    Ingame usage is probably drawn via unit_panel (somewhere under UI/campaign files) ...which is hex coded file but you can extract it as well, open it in any hex editor ( https://hexed.it/ ) and search for path to the icon. (this is alternative how to find where is icon stored).

    Now it depends on what you are trying to do.

    1) change icon for new one...then simply add new icon with old name and folder structure into your mod.
    2) you can edit the unit_panel and change the name for new icon. Just keep the same lenght of pathway string to the new picture. And folder structure as well.
    Thanks for the quick reply Daruwind! I have ben checking in the ui folders of both data and data_rome2 and can't find it. I'm hoping that I have just missed it. I was hoping there might be something in the db files referencing what the name of the icon is but no idea really where to start with that.

    I'll try your tip of extracting the ui folder tonight because the icon must be in here.

    I don't really understand this bit of what you were saying though:

    Quote Originally Posted by Daruwind View Post
    Ingame usage is probably drawn via unit_panel (somewhere under UI/campaign files) ...which is hex coded file but you can extract it as well, open it in any hex editor ( https://hexed.it/ ) and search for path to the icon. (this is alternative how to find where is icon stored).
    It's strange why I am looking for it... I am modding Thrones of Britannia and trying to create Areas of Recruitment. I've basically figured it out, the only one problem is a missing icon in the top corner of the unit cards, the same icon that was in all the other TW titles before. I'm hoping that if I can extract it and put it in the same place in my ToB mod, it will fill the gap that is currently missing. I've attached the photo below of the issue I'm trying to fix:

    Spoiler Alert, click show to read: 
    Click image for larger version. 

Name:	AOR2.jpg 
Views:	10 
Size:	462.1 KB 
ID:	359609

  4. #4
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Quote Originally Posted by Malcolm View Post
    Thanks for the quick reply Daruwind! I have ben checking in the ui folders of both data and data_rome2 and can't find it. I'm hoping that I have just missed it. I was hoping there might be something in the db files referencing what the name of the icon is but no idea really where to start with that.

    I'll try your tip of extracting the ui folder tonight because the icon must be in here.
    okey, go ahead. If you are not lucky I should be home at dormitory after Sunday and I´m fairly sure I saw it in folder :-) But as I usually delete 99% of stuff that is not related to resources,buildings and such ...

    I don't really understand this bit of what you were saying though:
    Under UI, there is a lot of precompiled files (in a few folders)....usually you can spot them as they have no file extension and PFM cannot open them. Hence why everybody is calling them hardcoded. They are very similar to lua scripting however we have no clue about their uncompiled version and they are able to call backend functions..those from rome..dll, rome2.exe which are not accessible from lua files...because Im poking in this direction, i have little idea what to look for.

    It's strange why I am looking for it... I am modding Thrones of Britannia and trying to create Areas of Recruitment. I've basically figured it out, the only one problem is a missing icon in the top corner of the unit cards, the same icon that was in all the other TW titles before. I'm hoping that if I can extract it and put it in the same place in my ToB mod, it will fill the gap that is currently missing. I've attached the photo below of the issue I'm trying to fix:

    Spoiler Alert, click show to read: 
    Click image for larger version. 

Name:	AOR2.jpg 
Views:	10 
Size:	462.1 KB 
ID:	359609
    This is not gonna work for 99%. Simply dropping icon in the folder won´t do it. Unless there is blank icon with very same name under ToB data pack. Like if Ca was lazy and used transparent one instead of older one to make it invisible. But this is 1% chance. I bet they simply deleted the particular command to display this icon and recompiled the file with all other changes...Even if R2/Attila and ToB are very close, all UI files are compiled for each game again. I did something little similar for Steph last year, this would be little bigger modification. I might be able to extract particular R2 code and insert it into ToB but I have no clue if it is gonna work. It is like inserting pig´s heart into monkey and praying that the engine is willing to do my bidding in unknown language.
    Last edited by Daruwind; September 27, 2019 at 05:03 PM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  5. #5
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    So in good news, your tip to extract the UI folder worked! I found various forms of the icon under ui/skins. The bad news is, there are already versions of these in the Thrones of Britannia files that match.

    Why when I create provincial mercenaries in Thrones of Britannia is there a blank space where that icon should be? I know this is a Rome II forum so this question has been answered. To anyone else who happens to be looking for this icon for some reason, I found them in a few files in ui/skins, mostly in ui/skins/default.

    Thanks for your help Daruwind!

  6. #6
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Nah, this is more likely a general topic than any particular TW question.... :-)

    So there is icon in ToB UI folders with exactly the same name? And it is not blank one right? From the icons can you say if they are being used somewhere else in ToB?

    Another question so your previous picture from ToB with white square that is actually ingame bug right? I thought it was edited to show where you want to put the icon....

    But that would be looking quite positive! To sum it up, ToB doesn´t have local recruitment system so it is not properly set up. The white square is good sign! The game engine is understanding what you are doing just missing link to the file or something like that or maybe the path to picture was deleted. It is actually creating the blank space for the icon. So the code inside unit_panel is right. Just part of it was "dormant" ,not used or how you want to call it...

    I have a few ideas that you may try.

    1) note the path to the icon in R2 UI folder structure and compare it to path to ToB ones. Do they match? (check the data_packs or extracted structure...)

    - if not, you can try to recreate the folder structure in ToB mod and insert your new icon with same name. Technically engine might be looking at old path and might grab the icon and that might be all..

    2) if this is not working. You may try to extract the unit_panel file from R2 UI folder and open it in hex editor. https://hexed.it/ At the right side, there is search option simply type the name of R2 icon file and try to search for it. It will be part of string path to the file. Note it.

    then do the same for ToB unit panel. If you will find similar structure for icon name and compare the string path. Basically the path is where UI is looking for icon file. So again you can recreate the location for UI to grab it or you can change the unit_panel path to the actual icon..or to your new one even under new folder or whatever. Just keep in mind that the lenght of path is set up in UI (can be altered but it is for longer guide) it is like /ui/folder/another_folder/icon.png ..you can change it to /ui/folder/new_folder/icon1234.png heck even /ui/folder/folder/folder/icon.png just as long as you set up folders and files correctly inside you mod!!!
    Last edited by Daruwind; September 27, 2019 at 06:45 PM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  7. #7
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    The white block is what appears on the unitcard in game, so Thrones doesn't seem to know what to put there or it's putting a different image?

    Ok so I found the what looks like the right icons in the skins/deafult folder of Rome II, but I also found icons with the same names in the corresponding ToB folder. Below I've put a picture of them side by side.

    Spoiler Alert, click show to read: 
    This is what I found in the Rome II UI

    Click image for larger version. 

Name:	ToB UI pics.png 
Views:	5 
Size:	11.3 KB 
ID:	359625

    And this is what I found in the Thrones UI

    Click image for larger version. 

Name:	RII UI.png 
Views:	4 
Size:	10.2 KB 
ID:	359626


    So does this mean I have found the wrong icon? I have searched through the UI folders of Rome and these were the only ones I could find that matched the one in game.

  8. #8
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Exactly! White square means ToB is trying to load a picture and under right reason - regional recruitment! This would be very hard to add otherwise, so it is very good start for you ... So it looks like game is trying wrong name of icon or wrong path, however comparing icon names for both game, the names do match and folders are the same ones so the game should load something. So there is another problem probably..

    Can you check the sizes of each particular icons? If they are all for ToB /R2 similar pixel size? Like 8x8 pixels for R2 and not 256x256 for ToB? Probably not the case but newer games sometimes are using more detailed graphics and old code might be drawing zoomed in part of one icon..

    icon_marker_settlement
    icon_market_small_settlement
    icon_regions_owned

    I think you have correct files. So the problem is probably in unit_panel file (or in another panel..something about mercenaries or recruitment...not sure EDIT: or maybe something about region panel. I´m not caring about units often so have no clue which one of those panels is responsible to that particular recruitment window ingame :/ ) You can either wait for my return or if you want next step will be to search R2 UI panels files to find ones bearing icon names above. (my bet is still on unit_panel and icon_regions_owned but it can be different panel and different icon name). You need total commander or other program which is able to find text in files/folders. Manual search would be long. Paths to icons are in plain string...it should be easy.

    In R2 there should be something like:
    /ui/skins/default/icon_regions_owned.png

    And then in corresponding UI panel for ToB should be something very similar. That is what we need to check. Where is leading pathway in ToB. Then we will know where the engine is looking for particular file. Or what name it is expecting.

    Last step will be add ToB icon with right name and on right folder place so ToB will load it.

    (of course there is chance the problem is something more complex, then I have no clue until I look at it. for example ToB is way closer to Attila so while we are comparing here R2/ToB in case of troubles I will go look into Attila and firstly compare R2/Attila to know what are the differencies and then with that knowledge we can quess what is the issue for ToB ..again if Attila has those icon names or if they are different. Are they ingame for regional units? (huh I haven´t played Atitla in year so even don´t remember if there are regional units at all) It is very possible CA changed things from R2->Attila and guys doing ToB just tried to recreate R2 recruitment bud abandoned it later...we are never sure. Or the unit_panel or whichever it is is doing something else in Attila than in R2. Lots of possibilities to check )
    Last edited by Daruwind; September 28, 2019 at 05:50 AM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  9. #9
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    Quote Originally Posted by Daruwind View Post
    Can you check the sizes of each particular icons? If they are all for ToB /R2 similar pixel size? Like 8x8 pixels for R2 and not 256x256 for ToB? Probably not the case but newer games sometimes are using more detailed graphics and old code might be drawing zoomed in part of one icon..
    Checked them all and they are the same size, so unfirtunately that isn't the issue.

    Quote Originally Posted by Daruwind View Post
    I think you have correct files. So the problem is probably in unit_panel file (or in another panel..something about mercenaries or recruitment...not sure EDIT: or maybe something about region panel. I´m not caring about units often so have no clue which one of those panels is responsible to that particular recruitment window ingame :/ ) You can either wait for my return or if you want next step will be to search R2 UI panels files to find ones bearing icon names above. (my bet is still on unit_panel and icon_regions_owned but it can be different panel and different icon name). You need total commander or other program which is able to find text in files/folders. Manual search would be long. Paths to icons are in plain string...it should be easy.
    I tried opening that file in HexEd.it and honestly no idea what I'm doing but I tried searching for the file and didn't come up with anything. So I think I'm going to need your help with this some more!

    Click image for larger version. 

Name:	HexEdit.png 
Views:	2 
Size:	263.1 KB 
ID:	359627

  10. #10
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Ok, time to be creative.

    1) We should narrow down which R2 icon it is. So create small R2 mod, create blank icon or something that you will recognise easily with same pixel size as the original ones and try to put it into mod each time with one of upper names. (just for future readers, make sure path in your new mod to the icon file is same as in game pack, but that should be obvious :-) ui/skins/default/icon_123.png )

    icon_marker_settlement
    icon_market_small_settlement
    icon_regions_owned

    This should give as exact icon name.

    2) Now we should find the right UI panel. Get total commander or something else. You should see something like


    navigate one of TC panels to folder with UI files. Then in TC there is search/find option.



    first line left blank
    "search in" should contain path to your folder with extracted UI files, it should be enough to search folder where was unit_panel..
    then lower in find text write name of icon
    check/mark UTF 8/16, ASCII there are like two options
    and hit search.

    lower it should display all files containing this string. It is probably just single file which is responsible for drawing icon ingame.

    3) find corresponding ToB panel. Open both in hex editor and now it is the matter of searching for particular icon name in both and comparing the path in both panels...
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  11. #11
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    Quote Originally Posted by Daruwind View Post
    Ok, time to be creative.

    1) We should narrow down which R2 icon it is. So create small R2 mod, create blank icon or something that you will recognise easily with same pixel size as the original ones and try to put it into mod each time with one of upper names. (just for future readers, make sure path in your new mod to the icon file is same as in game pack, but that should be obvious :-) ui/skins/default/icon_123.png )

    icon_marker_settlement
    icon_market_small_settlement
    icon_regions_owned

    This should give as exact icon name.
    Good thinking! I've located the exact file. I put a number in front of every icon so I could locate it easily.

    It's icon_market_small_settlement

    Click image for larger version. 

Name:	Rome II Test.jpg 
Views:	6 
Size:	36.9 KB 
ID:	359628

    I've got other work to do tonight but hopefully I'll be able to get back to trying out your method tomorrow! Glad it feels like we're making progress!

  12. #12
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Good to hear!
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  13. #13
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    1) so UI search for usage of icon icon_marker_small_settlement in R2 has single hit - campaign ui/recruitment_item (so I was wrong with unit_panel but it makes sense)

    2) comparing R2/Attila/ToB recruitment_item....first two are almost identical, calling very same icon icon_marker_small settlement, ToB is obvious copy with more changes and actually it is calling instead different icon ui/campaign ui/effect_bundles/effect_icon_maps.png

    3) after comparing R2/Attila/ToB code, first two have block structure of ABCD ... while ToB has BACD I think ToB guys switched two blocks AB and that might be issue why it is not working correctly, but as this is inactive part of code normally...it is hardly bug

    4) there is a few ways how to change it. My first attempt will be to switch ToB BA blocks back to AB but leaving them intact. If this is not working we can try further modification back to Attila version basically.

    -----------

    5) well I finished the recruitmen_item panel in Attila style anyway, which means switching those blocks BA to AB and changing paths to old style icon.... So in attachment is my altered recruitment_item panel (altered name, must be renamed to default on) which is to be included in the mod ( campaign ui/recruitment_item ) and I changed path to new icon, engine should try to load now ui/skins/default/icon_marker_small_settlement2.png (there is this 2!!! ) ...so this new icon must be added into mod, size is old one so 24x24 pixels.

    recruitment_item-altered-ToB-ver1.rar

    Let´s see if the game explodes now
    Last edited by Daruwind; October 01, 2019 at 07:26 AM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  14. #14
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    Quote Originally Posted by Daruwind View Post
    1) so UI search for usage of icon icon_marker_small_settlement in R2 has single hit - campaign ui/recruitment_item (so I was wrong with unit_panel but it makes sense)

    2) comparing R2/Attila/ToB recruitment_item....first two are almost identical, calling very same icon icon_marker_small settlement, ToB is obvious copy with more changes and actually it is calling instead different icon ui/campaign ui/effect_bundles/effect_icon_maps.png

    3) after comparing R2/Attila/ToB code, first two have block structure of ABCD ... while ToB has BACD I think ToB guys switched two blocks AB and that might be issue why it is not working correctly, but as this is inactive part of code normally...it is hardly bug

    4) there is a few ways how to change it. My first attempt will be to switch ToB BA blocks back to AB but leaving them intact. If this is not working we can try further modification back to Attila version basically.

    -----------

    5) well I finished the recruitmen_item panel in Attila style anyway, which means switching those blocks BA to AB and changing paths to old style icon.... So in attachment is my altered recruitment_item panel (altered name, must be renamed to default on) which is to be included in the mod ( campaign ui/recruitment_item ) and I changed path to new icon, engine should try to load now ui/skins/default/icon_marker_small_settlement2.png (there is this 2!!! ) ...so this new icon must be added into mod, size is old one so 24x24 pixels.

    recruitment_item-altered-ToB-ver1.rar

    Let´s see if the game explodes now
    Hi Daruwind!

    I honestly don't really understand everything you said but it sounds like you have fixed it! I've been moving house the last week and a half so didn't have internet! I will hopefully get a chance to try this tonight or tomorrow and will get back to you.

    Thanks a lot for your help though, I never would have got anywhere near this without you!

  15. #15
    Malcolm's Avatar Miles
    Join Date
    Mar 2011
    Location
    Scotland
    Posts
    355

    Default Re: Help Locating Provincial Mercenary UI

    Ok so your fix worked Daruwind!!

    The result is in here...

    Spoiler Alert, click show to read: 
    Click image for larger version. 

Name:	Game Snapshot.jpg 
Views:	7 
Size:	476.0 KB 
ID:	359703


    Thanks very much for your help! Could never have done it by myself!

  16. #16
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Help Locating Provincial Mercenary UI

    Great to hear! Actually I was not sure if it will work so easily, glad to help!

    Actually I would love to know what was CA trying to do..because it seems somebody messed up things... But that we will probably never know for sure.
    Last edited by Daruwind; October 10, 2019 at 03:29 PM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

Posting Permissions

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