Results 1 to 13 of 13

Thread: Is there any way to fix white box glitch on building_constructed UIs at first display?

  1. #1
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Is there any way to fix white box glitch on building_constructed UIs at first display?

    I have some problem as I put large UI to conceal messy part of description on building browser panel but I found that they would display as white box in some settlements, it take time and click at other settlement before I could back to original settlement to see it large size UI.

    Is there any way to fix this problem and make them display rightly on first click?
    Is proudly patroned by the Great Balikedes.



  2. #2

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Can you post a picture of the browser and what you're trying to hide? There might be a way to tackle it through code rather than overflowing UI.

  3. #3
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Thank you for reply, Aradan.

    Here is picture example of messy text I want to hide.



    Example of UIs which I using to hiding them (there are many buildings like this) There are some success in some settlement, but many settlement endup show as white.



    In some settlements, all big UI turn white box


    Text that I want to hide is "provide" part which is auto-generate description which turn messy due to I using other buildings as requirement conjunction (building bonus grow with more development in region)

    I also create recruitment with multiple building requirement like in first MTW as well by put them all in hinterland building exist in every settlement which now I give up idea of display big ui on that as there are more than 10,000+ recruitment lines in it (basic recruitment along with alternative conditions for increase starting exp when recruit) but I still put big UI on it as alternative would mean ctd at start of campaign, not just ctd on clicking it as currently is.
    Attached Thumbnails Attached Thumbnails ExampleOfSuccessHiding.jpg   ExampleOfMessyText.jpg   ExampleOfWhiteBox.jpg  
    Last edited by Suppanut; November 26, 2018 at 09:17 AM.
    Is proudly patroned by the Great Balikedes.



  4. #4

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Ah, I feel your pain, I also had thousands of building-conditioned capability and recruitment lines in FATW. It's been a few years, but I think I remember enough to be able to help.

    Let me introduce you to the miracle that is building_factions. Try the following:

    For capability lines:
    trade_base_income_bonus bonus 1 requires factions { empire_east, } and not building_factions { slave, } and building_present_min_level temple_equestrian cavalry_barracks
    The negative condition makes the entire line disappear from the building info scroll. Moreover, the 'slave' faction is never actually the building-faction of any building, iirc, (because all rebel armies/settlements have a sub_faction, which is what the game reads as the building_faction), so this doesn't stop rebels from getting the effect either.


    So, that was for disappearing active capability lines from your buildings. You can also do the opposite, which is having 'dummy' capability lines, which are visible on the scroll but don't actually do anything.
    trade_base_income_bonus bonus 1 requires factions { empire_east, } and building_factions { slave, }
    The line is visible, but since 'slave' never builds anything, the condition is never true and the effect never applies.


    When I want to have a building capability with a conditional that would cause a CTD or look ugly on the info-scroll, but still want the player to have an idea of what a building does, I combine a 'dummy' line with a 'disappeared' one. So, the player knows a building is supposed to give a particular effect (under certain conditions, which I hint at in the building description or in some other building, etc).

    For instance, below, the first 'trade bonus' line is a 'dummy' (visible, but does nothing) and the second is 'disappeared' (invisible, but actually does all the work): (*in FATW, 'slavs' is unplayable, so I use that instead of 'slave', for complicated reasons)
    Spoiler Alert, click show to read: 


    For recruitment lines:

    Pretty much the same concept. Add 'and not building_factions { slave, }' to your recruitment lines, and they're gone from the info-scroll. Since they are not visible, they are not click-able, so now you can add building conditions to them. Then, if you want, combine each 'disappeared' line with its respective 'dummy' line, with 'and building_factions { slave, }', to let the player know what a building is supposed to do.

    Example:
    Code:
    recruit "harondor sword" 0 requires factions { berbers, } and hidden_resource harad and hidden_resource rk and not hidden_resource umbar and not building_factions { slavs, } ; dummy
    recruit "harondor sword" 0 requires factions { berbers, } and hidden_resource harad and hidden_resource rk and not hidden_resource umbar and not building_present_min_level policy_building policy_fin and not building_factions { slavs, } ; invisible, but active and with building conditional
    Btw, I think that it's ok to have *many* recruitment lines in the same building, as long as they i) do not co-exist with building-effect lines (except with religious_effect lines, those are ok with recruitment lines), and ii) they are not both visible/click-able and have building conditions at the same time.





    If you want to have a complex building system that looks perfectly streamlined to the player, you might want to take a look at FATW's EDB, it has various other mechanics and tricks that might come in handy.

    For instance, you can also use dummy buildings in order to prettify your building-conditioned effect lines:

    Spoiler Alert, click show to read: 

    Code:
    hippodrome requires factions { carthaginian, eastern, nomad, roman, hun, barbarian, } and hidden_resource nofort
    {
        capability
        {
            ; EFFECTS
            law_bonus bonus 4 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy1 and not building_present_min_level hinterland_mithras temple_of_mithras_temple
            law_bonus bonus 2 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy2 and building_present_min_level hinterland_mithras temple_of_mithras_temple
            population_growth_bonus bonus 8 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy1 and not building_present_min_level hinterland_mithras temple_of_mithras_temple
            population_growth_bonus bonus 8 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy2 and building_present_min_level hinterland_mithras temple_of_mithras_temple
            taxable_income_bonus bonus 20 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy1 and not building_present_min_level hinterland_mithras temple_of_mithras_temple
            taxable_income_bonus bonus 5 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy2 and building_present_min_level hinterland_mithras temple_of_mithras_temple
            trade_base_income_bonus bonus 1 requires factions { sarmatians, } and building_factions { sarmatians, } and not building_present_min_level hinterland_roads road_dummy1 and not building_present_min_level hinterland_mithras temple_of_mithras_temple
    ...
        }
    export_buildings:
    Code:
    --------------
    
    {road_dummy1}                    (non-mannish population)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    {road_dummy1_desc}                Dummy1
    {road_dummy1_desc_short}            Dummy1
    
    --------------
    
    {road_dummy2}                    (mannish population)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    {road_dummy2_desc}                Dummy2
    {road_dummy2_desc_short}            Dummy2
    
    --------------
    The dummy building never exists, it simply displays the relevant text (e.g. "(mannish population)" for the player AND, importantly, the multiple new-line characters push the actual condition-building (temple_of_mithras_temple) OFF the building scroll, because otherwise this effect description would spill into/overlap with the following effect, like in your first image.




    Hope that helps.
    Last edited by Aradan; November 27, 2018 at 04:10 AM.

  5. #5
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Thank you, Aradan, I will test this method as soon as possible.
    Is proudly patroned by the Great Balikedes.



  6. #6
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Your "faction_building" work like charm, now I could solved problem of unclickable buildings and messy bonus I want to hide. But now I have new question.

    How many bonus line which could active in single building in one settlement at the same time? from my test it is 32 but is it due to bonus itself or due to display of bonus? I end up revisit this question due to how disappear bonus line works make me question by own earlier assumption.
    Is proudly patroned by the Great Balikedes.



  7. #7

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Not sure, but I guess that is a limit for in-screen display. I have buildings with 150+ effect lines, though they are not all active at the same time. This is quite easy to test though.
    Last edited by Aradan; December 01, 2018 at 12:31 PM.

  8. #8
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Test is done. It is not about on-screen display though, it just have active lines more than 32 at the time which causing problem. What seem to be difference is that when disappear the line, I get single crash message instead normal double crash messages.
    Last edited by Suppanut; December 01, 2018 at 10:03 PM.
    Is proudly patroned by the Great Balikedes.



  9. #9

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    That's interesting. Could you post here the code you tested? I'm just interested to know if you used 32 lines of the same effect (e.g. taxable_bonus) or the same faction, etc, so I can cross-check.

  10. #10
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    I use bluntly same tax effect or happiness effect 32 lines in row in single buildings which I test earlier during time I use move multiple building bonuses to 3rd party buildings to hide them, result of such ctd would be always give generic error messages twice. Later after I read how to hide capability lines from you I test it again but now add faction_building { slave, } to them, I still get ctd but now only once, not twice.

    Code is so simple, just repetitive 32 lines of the same bonus on 1 single building but I didn't keep that code in store now. If you still want it I will rewrite it for you tomorrow.
    Last edited by Suppanut; December 03, 2018 at 11:02 AM.
    Is proudly patroned by the Great Balikedes.



  11. #11
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Here is the code I used to test

    If you add this to any building which already exist would causing ctd with error message twice, (or at the end of turn if building is just finished)

    Code:
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
                taxable_income_bonus bonus 1
    While code below add to building would give ctd as well but only once, not twice

    Code:
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
                taxable_income_bonus bonus 1 requires not building_factions { slave, }
    If you reduce number of active bonus line that condition valid in single settlement to below 32 lines, they would loading fine without ctd.
    Is proudly patroned by the Great Balikedes.



  12. #12

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    Thanks, I'll find some time to do some quick tests, out of curiosity. I wonder if the CTD persists if the lines give different kinds of effects. If not, then it should be relatively unlikely to ever have 32 instances of the same effect for the same faction in the same settlement, which means the CTD problem is practically not a very serious one.

  13. #13
    Suppanut's Avatar Idea-O-Matic
    Join Date
    Mar 2007
    Location
    Thailand
    Posts
    3,703

    Default Re: Is there any way to fix white box glitch on building_constructed UIs at first display?

    As far as I know, it also ctd if bonus are of different kinds and this kind of CTD is savegame gamebreaking.
    Is proudly patroned by the Great Balikedes.



Posting Permissions

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