1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

EUI Compatibility Files (11/16)

Discussion in 'Community Patch Project' started by stackpointer, Nov 15, 2014.

  1. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,121
    Location:
    The Kingdom of New Zealand
    Okay, so I spent a good couple of hours seeing what I could do to help ease compatibility between EUI and the CBP, and I come bearing fixes for the most immediate problems which make EUI and CBP unplayable.

    CityBannerManager.lua updated for the latest EU version. Without it, the CityBanner does not load properly.

    TradeLogic.lua updated for the latest EU version. This is the CIV Diplomacy version.

    The most important thing, however, is for Gazebo: the CityView.lua file should be removed from the mod, and replaced with this file, which needs to be added as an InGameUIAddin. This does the same thing as did the replacement cityview file, but without the obvious incompatibilities.

    The TopPanel.lua file has too many changes to effectively combine it with EUI's version, and doesn't cause any issues when EUI's is overwritten by default. That, and I need to finish my dynamic top panel replacer before even thinking about it.

    And the CityStateStatusHelper file I couldn't do much about, as the EUI version doesn't differentiate between the status tooltip text and the description text, unlike CBP. However, there are no major issues with just letting the CBP version overwrite the EUI version.

    Also, don't get lax on commenting where you've made edits to vanilla files (none in SocialPolicyPopup); makes it a slower process to try and find the changes otherwise.
     
  2. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    Fantastic news JFD!

    I agree that toppanel.lua isn't that important and CityStateStatusHelper.lua isn't really that big a deal too.

    Looking forward to cityview being updated :)

    Thanks :goodjob:

    \Skodkim
     
  3. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    Hmmm, I get a text error in the trade screen where it says "TXT_KEY_DIPLO_TECHNOLOGY".

    I use CIV Diplomacy (where this is defined).

    \Skodkim
     
  4. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,121
    Location:
    The Kingdom of New Zealand
    That's odd; it seems to be because the tag is incorrectly labeled. A quick fix would be to replace the existing en_US_Text_UI.xml file in My Games\Sid Meier's Civilization 5\MODS\Civ IV Diplomatic Features\XML\Text\en_US with this one. But maybe Gazebo can add the missing tag into the CP so others don't have the same problem.
     
  5. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    Hmm. Seems I found a couple of other bugs too:

    1. Unhappiness from isolation isn't shown on the city banner
    2. Otherwise the unhappiness seems to correspond to that shown in the economic overview except for one city (weird...) where the city banner shows 0 unhappiness and the economic overview shoes two. See screen shots.

    \Skodkim
     
  6. Funak

    Funak Deity

    Joined:
    Jul 15, 2013
    Messages:
    9,127
    Even if you don't get it to work, you're a boss for making an effort. I'd take my hat of for you if a wore a hat!

    In fact I think I'll go get a hat so I can take it off for you, good day sir.
     
  7. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    Thanks!

    It kind of solved the problem as the text is now displayed correctly in my side of the trade screen. Unfortunately the issue moved to the AI side of the screen now :mischief:

    I solved it by adding both text strings (TXT_KEY_DIPLO_TECHNOLOGY and TXT_KEY_DIPLO_TECHNOLOGIES) to the xml file but I did a search of the files and I think the problem is found in DiploTrade.xml from Civ IV DF where there are multiple instances of "TXT_KEY_DIPLO_TECHNOLOGIES" but also one "TXT_KEY_DIPLO_TECHNOLOGY".

    \Skodkim
     
  8. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    If anyone's interested I made some small changes to JFD's citybannermanager file and have uploaded it here.

    Changes:
    • Unhappiness from Isolation included in tool tip (it is after all one of the major contibutors early on)
    • Rearranged tool tips so they should be easuer to read.

    Note: I'm still seeing some discrepancies between the values in the citybannermanager tool tips and the ones from the economic overview but I'm confident it's not related to my changes as they we're also there before I touched it. Maybe I just need to clear cache etc. before it works (but as I'm in the middle of a game right now I'll wait). If its a bug I hope someone can solve it as it pretty much leaves the citybannermanager tool tips unsuable right now :(

    Hold your horses. Forgot that in order to make this work you need to add a text string to one of the xml files from CBP. It really isn't that important which one but I recommend adding it to Community Balance Patch (v 13.4.4)\Modular Elements\Happiness Mod\HappinessText.xml which is where the rest of these are stated. Maybe Gazebo will add the string to CBP? The text string goes:

    Spoiler :
    Code:
    		<Row Tag="TXT_KEY_EO_CITY_CONNECTED">
    			<Text>[COLOR_POSITIVE_TEXT]Connected[ENDCOLOR]</Text>
    		</Row>
    


    EDIT: Attachment removed as a new version has been uploaded.

    \Skodkim
     
  9. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,002
    Gender:
    Male
    Location:
    Little Rock
    I'll definitely make the necessary changes to get this to work. Also, the happiness discrepancy is probably due to the order of the happiness value functions. The order matters, as that's how I designed the 'each citizen can only cause 1 type of unhappiness' mechanic.

    G
     
  10. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    I dont understand. Are you saying that its ok that the city banner and the economic overview show different numbers? The numbers from the latter seem to correspond to whats is showb (as a sum) inthe top panel btw.

    \Skodkim
     
  11. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,002
    Gender:
    Male
    Location:
    Little Rock
    No, they should show the same values. If you look at the lua for the economicoverview panel, you'll see that the part where I get the values from the functions for each source of unhappiness is in a particular order. It goes something like this:
    Code:
    GetUnhappinessfromStarving
    GetUnhappinessfromPillaged
    GetUnhappinessfromGold
    GetUnhappinessfromDefense
    GetUnhappinessfromConnection
    GetUnhappinessfromMinority
    GetUnhappinessfromScience
    GetUnhappinessfromCulture
    If the lua is not in that order, the numbers will display incorrectly. The order matters, as the 'bucket' of citizens (i.e. the pop of the city) is reduced for every point of unhappiness distributed from the first one down.

    G
     
  12. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    Ok :crazyeye:

    Ill see if I can figure it out when i get back to civ tomorrow but this is pobably my first lua editing so i'd appreciate it if you or JFD could have a quick look at the file I posted.

    \Skodkim
     
  13. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    It seems the unhappiness components were actually in incorrect order. I rearranged them and everything seems fine with the city banner now. I updated the upload in post 48

    Enjoy!!!

    \Skodkim
     
  14. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,002
    Gender:
    Male
    Location:
    Little Rock
    Since the cityview replacement file you made doesn't include every change CBP makes to the cityview file, I'm going to simply make an 'EUI compatibility files' download with instructions for people on how to use it.

    G
     
  15. Crimson13

    Crimson13 Prince

    Joined:
    Jul 11, 2012
    Messages:
    373
    I would really appreciate that. Between following the guide bc1 has on EUI's main page for mod compatibility and trying to follow this and the new files it's confusing.
     
  16. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,002
    Gender:
    Male
    Location:
    Little Rock
    I don't use EUI, so I'm not terribly knowledgeable on its workings. If anyone would like to help me compile a folder of all the requisite files that one needs to drop into EUI and/or the CBP to make them work together, I'd appreciate it.
    G
     
  17. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,121
    Location:
    The Kingdom of New Zealand
    If there is anything else, it's not marked. All I could find was what was between
    "-- COMMUNITY PATCH" and "-- END", which was the city name tooltip regarding happiness. If what I included from between those tags was incorrect (though they are copied exactly from what is in the CityView file of the latest CBP), or needs updating to fix the issues talked about, then I can update it again (although it follows the same princple as updating the cityview). If all you're doing is updating a tooltip, you do not need to edit the CityView, and should take the opportunity to save the added incompatibilities.

    I did outline those files which were incompatible. Only two cause UI glitches - CityView and CityBannerManager; the former doesn't seem necessary from what I can gather of its use in the files that I have, and CityBannerManager I provided a replacer - albeit one that apparently was displaying info incorrectly. CityStateStatusHelper cannot be helped (I glossed over a discussion on that matter). TopPanel would require way too much work for very little gain (the vanilla TopPanel works fine to replace the one provided by EUI). And InfoToolTipInclude is depreciated by EUI, which makes compatibility there an incredible headache. Basically, the only things preventing EUI and CBP from playing nice are, as far as I can tell, the CityView and CityBannerManager files; though this only includes stuff from the Active folder. H&P definitely cannot be played with EUI AFAIK.

    EDIT: Ah, I see you follow the Firaxis school of thought of using inconsistent marking :lol: There are, indeed, a few extra things in the CityView that I didn't find. I'll look about merging them into an EUI compatible CityView, if they can't be added modular. After I get some sleep...
     
  18. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,121
    Location:
    The Kingdom of New Zealand
    Okay, here is the merged CityView.lua file. This merges two points: the happiness tooltip info and then the function regarding extra specialist yields (let me know if I've missed something else). If someone could test and confirm that it works, then it can be safely considered what one needs to make the CBP and EUI CityView compatible. This file should be placed over the top of the CityView file in LUA/Active/Standard CBP.

    As for the NonCSD version, I'm wondering whether that file is a little outdated, as it doesn't use the same GetSpecialistYieldChange function that does the StandardCBP version. If that's the case, then the above CityView can be used with or without CSD, as EUI comes pre-built with support for all the stuff to do with the Civil Servant and the Great Diplomat. Otherwise, I can make a merger for that file as well, which includes the GetExtraSpecialistYieldOfType function.

    The H&P CityView, though, I won't touch, as the changes are quite extensive.

    Sorry for the confusion! The file that I provided could still be of use if you consider the happiness tooltip more vital than the other changes, but if not, this CityView should work.

    EDIT: Nevermind! The latest version of the CBP added some new additions to the CityView which invalidates this file. I'll leave it here if anyone wants to merge the rest, but for now, I do wonder if trying to make CBP compatible with EUI is a bit of a rabbit chase. I guess I haven't been as much use as I had hoped :/
     
  19. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    I tried the file you uploaded with CBP 13.4.4 and got some errors in lua.log. Fortunately they quickly led me to the conclusion that you forgot to replace "pCity" with "city" in the section you added. I uploaded a new file which works fine in my tests.

    \Skodkim
     
  20. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,275
    Location:
    Denmark
    New version of the EUI compatible Citybannermanager.lua file inbound. This version contains happiness info from all components but in order for the text strings to show up the text strings below need to be added to Community Balance Patch\Modular Elements\Happiness Mod\HappinessText.xml. I haven't looked at the latest releases but number one may have added.

    Gazebo: Would you add the following text strings for this to work properly?

    Spoiler :
    Code:
    		<Row Tag="TXT_KEY_EO_CITY_CONNECTED">
    			<Text>[COLOR_POSITIVE_TEXT]Connected[ENDCOLOR]</Text>
    		</Row>
    		<Row Tag="TXT_KEY_EO_CITY_NOT_STARVING">
    			<Text>[COLOR_POSITIVE_TEXT]Well fed[ENDCOLOR]</Text>
    		</Row>
    		<Row Tag="TXT_KEY_EO_CITY_RELIGION_NOT_DIVIDED">
    			<Text>[COLOR_POSITIVE_TEXT]Religious unity[ENDCOLOR]</Text>
    		</Row>
    		<Row Tag="TXT_KEY_EO_CITY_NOT_PILLAGED">
    			<Text>[COLOR_POSITIVE_TEXT]Well worked Lands[ENDCOLOR]</Text>
    		</Row>
    		<Row Tag="TXT_KEY_EO_MINORITY_UNHAPPINESS">
    			<Text>[COLOR_NEGATIVE_TEXT]({1_Num})[ENDCOLOR] from Religious Divisions (Needs Followers of [ICON_RELIGION] Majority Religion).</Text>
    		</Row>[/SPOILER]
    \Skodkim
     

Share This Page