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

City State Diplomacy Mod (Updated)

Discussion in 'Community Patch Project' started by Gazebo, Oct 18, 2010.

  1. ExpiredReign

    ExpiredReign Deity

    Joined:
    Jan 3, 2013
    Messages:
    2,450
    Gender:
    Male
    Location:
    Tasmania
    I'm sure Gazebo or bc1 may have a clearer grasp on this, but I don't think you will be able to 'copy-paste' these additions into the EUI version.

    My somewhat limited grasp of lua seems to tell me that EUI uses a different function entirely to generate the tooltips compared to the vanilla, whereas CSD has just added some extra detail.
     
  2. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    I haven't looked at the latest EUI, but I will soon. Since it is a lua thing, just use EUI for now, and by the time you get your game to the WC we should have a solution. :)
    G
     
  3. Inawordyes

    Inawordyes In a word: Illyria

    Joined:
    Jul 19, 2013
    Messages:
    210
    Location:
    East Coast, US
    Haha, I kinda figured when I did a cursory glance between the two that they didn't match up, which is why I posted because I couldn't figure out the EUI system to be able to find where to paste your new changes. But no biggie, I probably won't get to the WC anyways, haha, since I'll probably flake on the mod civ game I set up to test new mods and such, so it shouldn't be a problem in the end. And even if it is, I can wait. :)
     
  4. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    Version 23 is now ready, and is officially released! There are many changes, all of which I have listed below. As always, this version is not savegame compatible, so please save your old version of CSD (v22) if you need it for an older game.

    The mod can be found on the Steam Workshop and here on Civfanatics.

    As always, feedback is greatly appreciated. Thanks to everyone who helped debug and create v23 - it is the best CSD yet!
    G
     
  5. Sesostris

    Sesostris Chieftain

    Joined:
    Sep 8, 2013
    Messages:
    34
    Cool. :)

    Just to let you know: I finally figured out the cause of my error, and now I just feel stupid for not thinking of it before. The mod 'Diplomacy scores (BNV)' is a dll mod, argh.

    But on the bright side, I'm now finally ready to enjoy your mod along with CEP and EUI. :goodjob:
     
  6. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    Ah, I didn't even think to warn you of that. Enjoy! You picked a good time to join the club.
    G
     
  7. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    Going to re-upload v23 shortly – the compiler seems to have bugged part of the dll, shutting off some key late-game functions. I'll upload the new version very, very soon.
    G

    Update: v23 is fixed, and re-uploaded. Hooray!
     
  8. Zeppelin4

    Zeppelin4 Warlord

    Joined:
    Mar 30, 2007
    Messages:
    230
    Does this mod work with EUI, CEP, and smart AI ?
     
  9. Inawordyes

    Inawordyes In a word: Illyria

    Joined:
    Jul 19, 2013
    Messages:
    210
    Location:
    East Coast, US
    It will work with EUI, provided you remove the CityView.lua file from the Assets/InGame/CityView folder inside the CSD file, as EUI's is compatible with CSD but not vice-versa (at the moment, CSD has a new TopPanel which is not currently compatible with the EUI version as well, but it can be safely deleted and the relevant tooltips - relating to the new World Congress stuff - will be added into the EUI version soon.

    It will work with CEP, and it was talked about above and over the last page or two, but I don't personally play with CEP so I'm not as knowledgeable as to what needs to be done to make it completely compatible.

    Smart AI is, unfortunately, not compatible, because both SAI and CSD are DLL mods - of which there can only be one active. However, it has been mentioned that SAI's code has been partially folded into Whoward's SuperDLL, which also includes CSD and CiV Diplo, and provides users of those three DLL mod the chance to use them together, so SAI may eventually get completely coded in, in which case it would be able to be used, through the SuperDLL, with CSD. But, as it stands, they are not currently compatible at this time.
     
  10. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    Whoward's combined dll contains everything from CSD v23, as well as his own excellent work, Putmalk's work, and the elements of Smart AI that are verified to be stable (not everything in the SmartAI mod is stable). It is my recommended collection of mods, along with CEP, if that holds any weight! :)
    G
     
  11. Spheniscine

    Spheniscine Chieftain

    Joined:
    Mar 30, 2011
    Messages:
    83
    Is there a way to use this mod with No Civilian Traffic Jams? It's quite ironic, given that this mod adds new civilian units meant to be moved into city-state territory which is often blocked by their defense units or workers...
     
  12. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    It is not, however I rarely encounter that problem with CSD.
    G
     
  13. Spheniscine

    Spheniscine Chieftain

    Joined:
    Mar 30, 2011
    Messages:
    83
    Hmm... now I think about it it's actually not been that bad for me, except having to periodically reorder my diplomats or waste a turn or two because the easiest tile to access is currently blocked... my main negative experiences with "civilian traffic jams" have thus far been limited to issues with moving missionaries through a full-fledged civ's territory (on a map which easily bottlenecks), and when giving open borders to AI civs (once England parked a Great Admiral right in front of my bay city, making it impossible for workboats to travel out. And of course there is that issue of military units blocking roads impeding civilian travel. I'm now extremely wary of giving the AI open borders.)
     
  14. ExpiredReign

    ExpiredReign Deity

    Joined:
    Jan 3, 2013
    Messages:
    2,450
    Gender:
    Male
    Location:
    Tasmania
    @Gazebo
    Could you tell me which UI files you have updated in either of the last two releases? That is the beta and full releases of version 23.

    For some reason I'm getting an error in the logs that is asking for something CEP introduces as being missing but only when CSD is loaded. It would help me if I could narrow down the field a bit, otherwise it is all the CSD UI files out the window for the time being.
     
  15. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,468
    Location:
    Near Portsmouth, UK
    Use the "combined" version of CSD as "No more ..." has been merged into my DLL - you'll also need this micro-mod
     
  16. Spheniscine

    Spheniscine Chieftain

    Joined:
    Mar 30, 2011
    Messages:
    83
    Would it work with CSD v21? I'm a bit worried about the compatibility of v23 with Communitas (both technical-wise and balance-wise; e.g. the new settlers may step on the toes of Communitas' policy trees)
     
  17. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,468
    Location:
    Near Portsmouth, UK
    No, it's only maintained against the current version of CSD
     
  18. ExpiredReign

    ExpiredReign Deity

    Joined:
    Jan 3, 2013
    Messages:
    2,450
    Gender:
    Male
    Location:
    Tasmania
    I wouldn't worry about that. I'm about to initiate a whole new policy revision and use CSD's new units and policies where I can. My goal will to always have interoperability with the 2 mods.

    Sent from my GT-I9305T using Tapatalk
     
  19. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    Sure! I've included all new changes in the spoiler below. I've included context sections from the actual lua to let you know where I added the changes.

    Spoiler :
    I updated CityStateStatusHelper.lua to work with the two new quests (Barbarian and Rebel)

    DiploList.lua includes a change to add the Archaeology 'center on click' function:

    Spoiler :
    Code:
    -------------------------------------------------------------------------------
    -------------------------------------------------------------------------------
    function OnQuestIconClicked( PlayerID )
    	local pMinor = Players[PlayerID];
    	if (pMinor) then
    		if (pMinor:IsMinorCivDisplayedQuestForPlayer(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_KILL_CAMP)) then
    			local iQuestData1 = pMinor:GetQuestData1(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_KILL_CAMP);
    			local iQuestData2 = pMinor:GetQuestData2(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_KILL_CAMP);
    			local pPlot = Map.GetPlot(iQuestData1, iQuestData2);
    			if (pPlot) then
    				UI.LookAt(pPlot, 0);
    				local hex = ToHexFromGrid(Vector2(pPlot:GetX(), pPlot:GetY()));
    				Events.GameplayFX(hex.x, hex.y, -1);
    			end
    		end
    		if (pMinor:IsMinorCivDisplayedQuestForPlayer(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_ARCHAEOLOGY)) then
    			local iQuestData1 = pMinor:GetQuestData1(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_ARCHAEOLOGY);
    			local iQuestData2 = pMinor:GetQuestData2(g_iPlayer, MinorCivQuestTypes.MINOR_CIV_QUEST_ARCHAEOLOGY);
    			local pPlot = Map.GetPlot(iQuestData1, iQuestData2);
    			if (pPlot) then
    				UI.LookAt(pPlot, 0);
    				local hex = ToHexFromGrid(Vector2(pPlot:GetX(), pPlot:GetY()));
    				Events.GameplayFX(hex.x, hex.y, -1);
    			end
    		end
    	end
    end
    
    -----------------------------------------------------------------
    -----------------------------------------------------------------



    InfoToolTipInclude.lua includes two yields changes:

    Spoiler :
    Code:
    -- City Culture modifier
    		local iAmount = pCity:GetCultureRateModifier();
    		if (iAmount ~= 0) then
    			strCultureToolTip = strCultureToolTip .. "[NEWLINE][NEWLINE]";
    			strCultureToolTip = strCultureToolTip .. "[ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_CULTURE_CITY_MOD", iAmount);
    		end
    
    		-- City Culture League modifier (CSD)
    		local iAmount = Players[pCity:GetOwner()]:GetLeagueCultureCityModifier();
    		if (iAmount ~= 0) then
    			strCultureToolTip = strCultureToolTip .. "[NEWLINE][NEWLINE]";
    			strCultureToolTip = strCultureToolTip .. "[ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_CULTURE_LEAGUE_MOD", iAmount);
    		end


    and

    Spoiler :
    Code:
     	if (iYieldType == YieldTypes.YIELD_FOOD) then
    		local iYieldFromTrade = pCity:GetYieldRate(YieldTypes.YIELD_FOOD, false) - pCity:GetYieldRate(YieldTypes.YIELD_FOOD, true);
    		if (iYieldFromTrade ~= 0) then
    			strYieldBreakdown = strYieldBreakdown .. "[ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_FOOD_FROM_TRADE_ROUTES", iYieldFromTrade);
    			strYieldBreakdown = strYieldBreakdown .. "[NEWLINE]";
    		end
    	end
    
    	-- Base Yield from League Art (CSD)
    	local iYieldFromLeague = pCity:GetBaseYieldRateFromLeague(iYieldType);
    	if (iYieldFromLeague ~= 0) then
    		if (iYieldType == YieldTypes.YIELD_SCIENCE) then
    		strYieldBreakdown = strYieldBreakdown .. "[ICON_BULLET]" .. Locale.ConvertTextKey("TXT_KEY_SCIENCE_YIELD_FROM_LEAGUE_ART", iYieldFromLeague, strIconString);
    		strYieldBreakdown = strYieldBreakdown .. "[NEWLINE]";
    		end
    	end


    PlotMouseOverInclude.lua includes a change for the embassy (I modified the old lua for this):

    Spoiler :
    Code:
     local convertedKey = GetImprovementText(iImprovementType);	
    		improvementStr = improvementStr .. convertedKey;
    		if plot:IsImprovementPillaged() then
    			improvementStr = improvementStr .." " .. Memoize_LocaleLookup("TXT_KEY_PLOTROLL_PILLAGED")
    		end
    		if plot:IsImprovementEmbassy() then 
    			improvementStr = improvementStr .. " " .. Locale.ConvertTextKey("TXT_KEY_PLOTROLL_EMBASSY", pPlayer:GetCivilizationShortDescriptionKey());
    		end


    The 'Popups' folder in CSD modified the Minor Civ popups (CityStateDiploPopup.lua/.xml and CityStateGreetingPopup.lua) to hide the gold gift buttons if gold gifts are set to zero. This is purely cosmetic, so if it is going to cause problems, you can simply tell users to delete that folder. Otherwise, if CEP doesn't modify the CityStateDiploPopup stuff, it should work just fine.


    AND, lastly, TopPanel.lua adds a check for yields from league resolutions:

    Spoiler :
    Code:
    -- Science from Research Agreements
    		local iScienceFromRAs = pPlayer:GetScienceFromResearchAgreementsTimes100();
    		if (iScienceFromRAs ~= 0) then
    		
    			-- Add separator for non-initial entries
    			if (bFirstEntry) then
    				bFirstEntry = false;
    			else
    				strText = strText .. "[NEWLINE]";
    			end
    	
    			strText = strText .. Locale.ConvertTextKey("TXT_KEY_TP_SCIENCE_FROM_RESEARCH_AGREEMENTS", iScienceFromRAs / 100);
    		end
    
    		-- Science from Allies (CSD MOD)
    		local iScienceFromAllies = pPlayer:GetScienceRateFromMinorAllies();
    		if (iScienceFromAllies ~= 0) then
    		
    			-- Add separator for non-initial entries
    			if (bFirstEntry) then
    				bFirstEntry = false;
    			else
    				strText = strText .. "[NEWLINE]";
    			end
    	
    			strText = strText .. Locale.ConvertTextKey("TXT_KEY_MINOR_SCIENCE_FROM_LEAGUE_ALLIES", iScienceFromAllies);
    		end
    
    		-- Science from Funding from League (CSD MOD)
    		local iScienceFromLeague = pPlayer:GetScienceRateFromLeagueAid();
    		if (iScienceFromLeague ~= 0) then
    		
    			-- Add separator for non-initial entries
    			if (bFirstEntry) then
    				bFirstEntry = false;
    			else
    				strText = strText .. "[NEWLINE]";
    			end
    	
    			strText = strText .. Locale.ConvertTextKey("TXT_KEY_SCIENCE_FUNDING_FROM_LEAGUE", iScienceFromLeague);
    		end
     
  20. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,034
    Gender:
    Male
    Location:
    Little Rock
    The new settlers should work with the policy trees, as any additional population/buildings etc. will be folded in. You can also disable the advanced settlers from CSD in CSD's options.sql file.

    On this note, ExpiredReign, I did notice in a playtest last night that CEP's settlers should be set to obsolete at Compass if CSD's advanced settlers are active. Also, looking at the tech-tree changes of CEP, Compass may be too early of an obsolete date, so we may need to have a CEP-specific tech target for Pioneers (I had pioneers by 300BC, for example).
    G
     

Share This Page