Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Trying to display two resources in the same settlement

  1. #1

    Icon5 Trying to display two resources in the same settlement

    Hi!

    During working on a mod that places heavy emphasis on resources, I found a problem that I don't know how to overcome.

    I want to display icons for the non-resource region specialties like grain, gold, etc and create buildings (for secondary slots) that provide new resources, for example a quarry that provides stone.

    Here in this picture I managed to display the grains icon, by creating a new grains resource

    Click image for larger version. 

Name:	wres1 (2).jpg 
Views:	19 
Size:	109.7 KB 
ID:	361683

    That's perfect. Then I created a new building for the minor secondary slot that provides a "stone" resource. To test the display I built it in the same settlement with the grains. I expected both icons to show up next to the name of the settlement, but only one appears.

    Click image for larger version. 

Name:	wres2 (2).jpg 
Views:	16 
Size:	221.5 KB 
ID:	361684

    Can I fix this somehow so that both icons are displayed? Any workaround is ok for me, for example I can accept removing the grains from being a resource but at least having the "grains" icon to display next to the settlement's name.

    Let me know if you have any ideas
    Last edited by Athanasios55; May 18, 2020 at 11:28 AM.

  2. #2
    Gyrosmeister's Avatar Monsieur Grec
    Join Date
    May 2017
    Location
    North Rhine-Westphalia
    Posts
    513

    Default Re: Trying to display two resources in the same settlement

    I assume that the game does not like having two resources on the same settlement, this could be your problem here.
    Perhaps if you know hex-editing you could tweak the UI-settings and try your luck there


  3. #3
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Trying to display two resources in the same settlement

    mmhhh, I think you'll have to hex edit the ui files, the blank files you have inside ui folder (you can see them with pfm/rpfm)
    but i can't be sure it would work for such thing, it also depends on how the dll has been written regarding it.

    my advice? let it be

    edit: what gyros says...

  4. #4

    Default Re: Trying to display two resources in the same settlement

    Thanks very much for the quick answers!!

    I have already extracted the UI folder from data_rome2.pack 'cause I was peeking at the resource icons

    But I only see .png files in there like the UI skins and other small icons and such. Maybe you know where are these UI-settings that I have to hex-edit? Not like I know anything about hex-editing but I will at least be able to say I tried something
    Last edited by Athanasios55; May 18, 2020 at 12:27 PM.

  5. #5
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Trying to display two resources in the same settlement

    yep, they are displayed as white sheets with no .extension
    for example: db > ui > campaign ui > clan/events/tech_tooltip ecc ecc..
    there are many also inside other folders

    use this program https://github.com/Cpecific/twwh2_ctm
    or this one https://www.mitec.cz/hex.html

    don't ask me something else 'cause i dunno poop here

  6. #6

    Default Re: Trying to display two resources in the same settlement

    I dowloaded a hex editor, took a look and I think I found the file responsible: ui\campaign ui\city_info_bar

    I am not sure something can be done about this but I found another important problem: when I set a building to need the spices resource the needed resource icon is invisible. Normally you get a red icon in the shape of the resource that is missing. I found that in the file "buildingframe" (in ui\campaign ui) the spices are missing, but there is information about all the rest, linking to their red icon (example: ui/skins/default/resource_olive_oil_needed.png)

    If anyone knows more about this please let me know! I am really interested in this and I will try to learn more.

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

    Default Re: Trying to display two resources in the same settlement

    The real question is, how many resources we/you want...the UI is set up to expect at max single instance of resource per region...
    But this issue is on my TODO list too,just somewhere deep under rainbow. So I´m interested. Let´s pick number, how many we dream for..because it cannot be dynamic. Have to set maximum per region..

    another spot with single res per reion is on lower map..check neapol /sparta...So before we start, is there any other place you can think off?
    Spoiler Alert, click show to read: 


    Last edited by Daruwind; May 22, 2020 at 12:17 AM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

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

    Default Re: Trying to display two resources in the same settlement

    Fixed spice needed issue in buildingframe

    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  9. #9
    Morticia Iunia Bruti's Avatar Praeses
    Join Date
    May 2015
    Location
    Deep within the dark german forest
    Posts
    8,422

    Default Re: Trying to display two resources in the same settlement

    I would bet, CA simply forgot a spice_needed.png.^^
    Cause tomorrow is a brand-new day
    And tomorrow you'll be on your way
    Don't give a damn about what other people say
    Because tomorrow is a brand-new day


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

    Default Re: Trying to display two resources in the same settlement

    Nah, spice_needed.png is there in game files, tooltip for missing spice is there as well in UI...there just was not in UI loading structure for png and then tooltip was missing link to that loading picture path. ...as usually code is dark and full of inactive terrors.

    Bigger problem will be more resources per region. Game is just calling resource....so we must pray that calling resource again will return next one as there is nothing like calling_resource_number_XYZ engine is either smart or hit the wall in this case..will tell you later
    Last edited by Daruwind; May 22, 2020 at 03:04 AM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  11. #11
    Morticia Iunia Bruti's Avatar Praeses
    Join Date
    May 2015
    Location
    Deep within the dark german forest
    Posts
    8,422

    Default Re: Trying to display two resources in the same settlement

    So simply a databank error in building tables.^^
    Cause tomorrow is a brand-new day
    And tomorrow you'll be on your way
    Don't give a damn about what other people say
    Because tomorrow is a brand-new day


  12. #12

    Default Re: Trying to display two resources in the same settlement

    Woah, is this real or am I dreaming??

    Hey Daruwind, how did you do that? I know the .png exists, but it wouldn't appear when I set the resource requirement.

    I checked the buildingframe file and it was missing from there. How did you added it??


    The real question is, how many resources we/you want...the UI is set up to expect at max single instance of resource per region...
    But this issue is on my TODO list too,just somewhere deep under rainbow. So I´m interested. Let´s pick number, how many we dream for..because it cannot be dynamic. Have to set maximum per region..
    Hmm if you ask me 2 resource icons per settlement would be more than enough and 3 would be perfect. Is it possible though? And does it need to be changed for every single region or will it automatically apply to all?
    Last edited by Athanasios55; May 22, 2020 at 05:15 AM.

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

    Default Re: Trying to display two resources in the same settlement

    I will upload pack file with altered UI files once I´m done I just have experience with altering that hex code...

    the info city bar is the same one for all region, capital, minor ones. If it can be altered for two res, it can be done for any fix number and will work for every region. But that is still little ahead of us...
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  14. #14

    Default Re: Trying to display two resources in the same settlement

    You have my gratitude and let me know if you need any work to be done that I can do to help you.

    I tried to add the spices with the hex editor, I tried to replace an existing resource with the spices in the buildingframe Then I added the modified file in the mod and the game crashed 3 seconds after I clicked on a settlement. Obviously I did something wrong.

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

    Default Re: Trying to display two resources in the same settlement

    Good part is, I manage to insert second resource icon, bad part is, it is showing nothing



    this is new test with my new structure calling resource icon, while old structure is left blank...check position of white square vs resource icon in Velathri, Neapolis vs previous picture. So my new hex code is working well and i could in theory add as many structures as I want per region, they just won´t work....basically result seems to indicate engine is in this case returning single resource icon and cannot be recalled another time to get it again or next resource icon...so we hit the wall here. :/
    Last edited by Daruwind; May 23, 2020 at 03:43 AM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  16. #16

    Default Re: Trying to display two resources in the same settlement

    Thank you for working on it! Seriously, you saved the day. At least now I can rest assured it is not possible.

    By the way though I am a bit curious, the white square is because you added a second resource (to the settlement building for example) and it displays like this or is it like that even with no second resource on the settlement?

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

    Default Re: Trying to display two resources in the same settlement

    I added multiple resource production effects to primary buildings, engine is just retrieving first resource in region it gets hands to. In tests above Neapolis is producing Olive Oil, Iron and a few others.. :-)

    Problem is in engine. The white square is there no matter what situation...which means UI/engine is not understanding what it is suppose to do. But at least i have good syntax
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  18. #18

    Default Re: Trying to display two resources in the same settlement

    Right, I see!

  19. #19
    valerius karamanus's Avatar Civis
    Join Date
    Dec 2018
    Location
    Constantinopolis
    Posts
    126

    Default Re: Trying to display two resources in the same settlement

    Well if UI altering is not possible, maybe you can edit resouce icons to show two of them? Something like this https://imgur.com/Qf6lXAO. Of course that means you have to do every resource combination.

    If it is a building issue, another option would be adding special capital building for every region and add resources as part of their effects. That would be a lot more tiring work but offers much more room for creativity. Just some ideas.

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

    Default Re: Trying to display two resources in the same settlement

    I´m trying some voodoo to insert listview for resources...we will see.

    That won´t work. If you alter current icons, engine will use them in all instances.

    It is not problem with buildings. You can have multiple resources per region in primary/secondary buildings, various levels...and game handles/tracking more resources just fine. You are just getting single icon per region that´s all...

    But thanks for ideas
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

Page 1 of 2 12 LastLast

Posting Permissions

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