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

Dynamic Culture Overview

Discussion in 'Civ5 - Mod Components' started by KyteM, Mar 25, 2014.

  1. KyteM

    KyteM Chieftain

    Joined:
    Mar 4, 2014
    Messages:
    27
    Now I'm curious on what was the issue.
     
  2. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    Loading "Argentina Civilization" seemed to result in a nearly empty Culture Overview (no cities, only first four columns listed). Deleting the cache and reinstallling solved the issue.
     
  3. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
    My "Culture Overview Fix" now features an obsolescence note and a recommendation to use your mod instead.
     
  4. PipBro3000

    PipBro3000 Chieftain

    Joined:
    Jun 12, 2014
    Messages:
    1
    I've been having the same problem both with and without this mod. I'm still trying to find the mod/mod conflict that makes this happen.

    With this mod and some others, including TPangolin's Vietnam mod, the culture overview would have the Amphitheater replaced with Vietnam's UB Amphitheater, regardless of what civ I played as. Is this a load order problem? I'm not sure how to fix that.

    EDIT: Would it work if I went through my other mods and took out the CultureOverview.lua from those folder? I think the two troublemakers might be JFD's Franks and Armenia.

    EDIT EDIT: Okay, I had to delete all of those lua files from other mods and everything seems to work...except Vietnam. Maybe add a reference to fix the load order?
     
  5. Leugi

    Leugi Supreme Libertador

    Joined:
    Jan 25, 2013
    Messages:
    1,675
    Location:
    Bolivia
    Oh boy, I didn't see this as I was away. Great job, will link this in my fancy thread (and use it):goodjob:
     
  6. calcul8or

    calcul8or Warlord

    Joined:
    May 30, 2014
    Messages:
    254
    Location:
    USA
    I'm having some trouble getting this to work in my own mod, adding a unique national Wonder with 2 slots for GW of Writing. I've added both the .xml and the .lua files to ModBuddy, and tried various combinations of VFS=true/false and InGameUIAddin, and nothing seems to work.

    What happens is: after the loading screen, the culture overview panel is open, and won't respond to the close button (or close any other way, for that matter). If I use the keyboard shortcut to build my first city, then click the Tourism icon on the top of the screen, the culture overview window will then close by clicking twice.

    Everything does work correctly if I load the Dynamic Culture Overview mod separately, I just don't want users to have to download and use a separate mod if it's not necessary.

    I am using version 6.

    Any help would be appreciated, thanks.
     
  7. Puer

    Puer Warlord

    Joined:
    Jan 4, 2005
    Messages:
    279
    Location:
    Estonia
    Thanks for the mod, KyteM!
     
  8. KyteM

    KyteM Chieftain

    Joined:
    Mar 4, 2014
    Messages:
    27
    Wow it seem the forum didn't see fit to tell me I'd been getting posts here. Thanks guys for the support.

    D'you have a link to it? There seems to be multiple vietnam civs.

    Odd, all I did was set VFS to true in both and have the names match. Sure it's not some other mod replacing the XML or Lua?
     
  9. calcul8or

    calcul8or Warlord

    Joined:
    May 30, 2014
    Messages:
    254
    Location:
    USA
    Thanks! I will test again this weekend and see. The only other mods I have running are IGE and Unlimited XP from Barbarians (along with the custom civ I'm building) so I doubt it's a mod conflict.

    EDIT: Wow, that worked. And here I thought I had tried every combination. Thanks again!
     
  10. KyteM

    KyteM Chieftain

    Joined:
    Mar 4, 2014
    Messages:
    27
  11. Crash757

    Crash757 King

    Joined:
    May 30, 2003
    Messages:
    905
    Location:
    Riga, Latvia
    I have the same problem, sort of. I don't see the amphitheater at all. And I have the said Vietnam civ installed. I wouldn't like to uninstall it, is there any other solution ?
     
  12. KyteM

    KyteM Chieftain

    Joined:
    Mar 4, 2014
    Messages:
    27
    Can you link the Vietnam civ so I can check?
     
  13. Crash757

    Crash757 King

    Joined:
    May 30, 2003
    Messages:
    905
    Location:
    Riga, Latvia
  14. KyteM

    KyteM Chieftain

    Joined:
    Mar 4, 2014
    Messages:
    27
    Ok at first I thought something was wrong but reading the XML it's just that the Water Puppet Theater doesn't have any GW slots so naturally it won't show up.
    Oh, and the Water Puppet Theater uses BUILDINGCLASS_THEATRE, which means it replaces the Theater, not the Amphitheater.

    Unfortunately, I can't validate this in-game because Civ5 has decides it completely and utterly hates my computer and crashes when trying to start a new game.
     
  15. Nemu_khao

    Nemu_khao Chieftain

    Joined:
    Dec 20, 2014
    Messages:
    17
    Nice! Gonna download.

    Btw, does it include some kind of "maximize culture for city X" or "optimise great work theming bonus" feature? Something along those lines? I mean currently it's very tedious to manage it. I am gonna give this mod a try though.
     
  16. lockstep

    lockstep Prince

    Joined:
    Jan 15, 2004
    Messages:
    399
    Location:
    Vienna, Austria
  17. krolac

    krolac Chieftain

    Joined:
    Mar 12, 2015
    Messages:
    19
    This mod is really nice, but I am having some problems with it when adding it to my muliplayer mod using the MPMPM DLC-hack method. The problem is that the Host's buildings take priority and overwrite the regular buildings for other players.

    I have given the Greeks an Odeon building, replacing the Amphitheatre, and this show up fine for me as the host, and I can't see the Amphitheatre in the overview. So far so good. The problem is that the same is true for other players as well, so when they get a work of art in the Amphitheatre, they cannot access it.

    I have dabbled a little bit in Lua while working with this mod, but this is way out of my league. I am assuming that if I could get all buildings with work of art slots for all civs in the current game to show up in the list, it would be fine, even if this would mean that some of the buildings would get placed on the "wonder" section below the city names.

    I can get all civ-specific buildings to show up by messing with this part, but can not figure out how to get both the regular building (Amphitheatre) and specific building (Odeon) to show up at the same time. Would be grateful for any help!

    Code:
    for row in DB.Query([[
    	SELECT b.Id AS Id, bc.Type AS BuildingClass, b.Type AS BuildingType, GreatWorkCount,
    	CivilizationType, t.GridX, t.GridY, 
    	EXISTS (
    	SELECT 1
    	FROM Building_ThemingBonuses
    	WHERE BuildingType = b.Type
    	LIMIT 1 
    	) AS HasThemeBonusInt
    	FROM BuildingClasses AS bc
    	JOIN Buildings AS b ON bc.Type = b.BuildingClass
    	LEFT JOIN Civilization_BuildingClassOverrides AS o ON o.BuildingType = b.Type
    	LEFT JOIN Technologies AS t ON b.PrereqTech = t.Type
    	WHERE	MaxPlayerInstances = -1 AND
    	MaxTeamInstances = -1 AND
    	MaxGlobalInstances = -1 AND
    	GreatWorkCount > 0 AND
    	CivilizationType = ?
    	]], GameInfo.Civilizations[Game.GetActiveCivilizationType()].Type) do
    	gwBuildings[row.BuildingClass] = row;
    	dprint(row.BuildingType);
    	end
     
  18. krolac

    krolac Chieftain

    Joined:
    Mar 12, 2015
    Messages:
    19
    So I fiddled around a bit more with the code and I think I got it to work the way I want it to with these simple changes (starts at around line 460):

    Before:
    Code:
    	
    	for row in DB.Query([[
    		SELECT b.Id AS Id, bc.Type AS BuildingClass, b.Type AS BuildingType, GreatWorkCount, 
    		CivilizationType, t.GridX, t.GridY,
    		EXISTS (
    			SELECT 1
    			FROM Building_ThemingBonuses
    			WHERE BuildingType = b.Type
    			LIMIT 1 
    		) AS HasThemeBonusInt
    		FROM BuildingClasses AS bc
    		JOIN Buildings AS b ON bc.Type = b.BuildingClass
    		LEFT JOIN Civilization_BuildingClassOverrides AS o ON o.BuildingType = b.Type
    		LEFT JOIN Technologies AS t ON b.PrereqTech = t.Type
    		WHERE	MaxPlayerInstances = -1 AND
    				MaxTeamInstances = -1 AND
    				MaxGlobalInstances = -1 AND
    				GreatWorkCount > 0 AND
    				CivilizationType IS NULL
    	]]) do
    		gwBuildings[row.[COLOR="Red"]BuildingClass[/COLOR]] = row;
    		dprint(row.BuildingType);
    	end
    	
    	-- If you get overrides after normal buildings it'll effectively replace the previous buildings so it all works out pretty nicely.
    	for row in DB.Query([[
    		SELECT b.Id AS Id, bc.Type AS BuildingClass, b.Type AS BuildingType, GreatWorkCount,
    		CivilizationType, t.GridX, t.GridY, 
    		EXISTS (
    			SELECT 1
    			FROM Building_ThemingBonuses
    			WHERE BuildingType = b.Type
    			LIMIT 1 
    		) AS HasThemeBonusInt
    		FROM BuildingClasses AS bc
    		JOIN Buildings AS b ON bc.Type = b.BuildingClass
    		LEFT JOIN Civilization_BuildingClassOverrides AS o ON o.BuildingType = b.Type
    		LEFT JOIN Technologies AS t ON b.PrereqTech = t.Type
    		WHERE	MaxPlayerInstances = -1 AND
    				MaxTeamInstances = -1 AND
    				MaxGlobalInstances = -1 AND
    				GreatWorkCount > 0 [COLOR="Red"]AND
    				CivilizationType = ?[/COLOR]
    	]][COLOR="Red"], GameInfo.Civilizations[Game.GetActiveCivilizationType()].Type)[/COLOR] do
    		gwBuildings[row.[COLOR="Red"]BuildingClass[/COLOR]] = row;
    		dprint(row.BuildingType);
    	end
    After:

    Code:
    	for row in DB.Query([[
    		SELECT b.Id AS Id, bc.Type AS BuildingClass, b.Type AS BuildingType, GreatWorkCount, 
    		CivilizationType, t.GridX, t.GridY,
    		EXISTS (
    			SELECT 1
    			FROM Building_ThemingBonuses
    			WHERE BuildingType = b.Type
    			LIMIT 1 
    		) AS HasThemeBonusInt
    		FROM BuildingClasses AS bc
    		JOIN Buildings AS b ON bc.Type = b.BuildingClass
    		LEFT JOIN Civilization_BuildingClassOverrides AS o ON o.BuildingType = b.Type
    		LEFT JOIN Technologies AS t ON b.PrereqTech = t.Type
    		WHERE	MaxPlayerInstances = -1 AND
    				MaxTeamInstances = -1 AND
    				MaxGlobalInstances = -1 AND
    				GreatWorkCount > 0 AND
    				CivilizationType IS NULL
    	]]) do
    		gwBuildings[row.[COLOR="Red"]BuildingType[/COLOR]] = row;
    		dprint(row.BuildingType);
    	end
    	
    	-- If you get overrides after normal buildings it'll effectively replace the previous buildings so it all works out pretty nicely.
    	for row in DB.Query([[
    		SELECT b.Id AS Id, bc.Type AS BuildingClass, b.Type AS BuildingType, GreatWorkCount,
    		CivilizationType, t.GridX, t.GridY, 
    		EXISTS (
    			SELECT 1
    			FROM Building_ThemingBonuses
    			WHERE BuildingType = b.Type
    			LIMIT 1 
    		) AS HasThemeBonusInt
    		FROM BuildingClasses AS bc
    		JOIN Buildings AS b ON bc.Type = b.BuildingClass
    		LEFT JOIN Civilization_BuildingClassOverrides AS o ON o.BuildingType = b.Type
    		LEFT JOIN Technologies AS t ON b.PrereqTech = t.Type
    		WHERE	MaxPlayerInstances = -1 AND
    				MaxTeamInstances = -1 AND
    				MaxGlobalInstances = -1 AND
    				GreatWorkCount > 0 
    	[COLOR="Red"]]]) do[/COLOR]
    		gwBuildings[row.[COLOR="Red"]BuildingType[/COLOR]] = row;
    		dprint(row.BuildingType);
    	end

    Now all non-wonder buildings with a great work slot shows up in the overview list. The Greeks will have them in the Odeon and the other civs in the Amphitheatre. There will be several empty buildings that most Civs will not be able to build but at least everything shows up and it seems to work fine so far, have not played a complete game with it yet.
     
  19. manekk

    manekk Chieftain

    Joined:
    Mar 18, 2015
    Messages:
    59
    Hi KyteM

    Thanks for this mod - I am a massive fan of solutions that work across all the mods and provide universal fix. I have a question about compatibility though.

    I have compared this file with CultureOverview.lua and .txt from different civilizations and:

    1. JFD's Iceland and Papal States have the same xml, and are either identical or have minor differences in lua (pPlayer vs player in a few lines), so I guess it's safe to assume that all JFD's civs are fully compatible and he is implementing your solution by default?

    2. Colonialist Legacies Mexican Republic has a different lua file, and has no xml file - will it work if I get rid of this mods CultureOverview and use yours? Or should I use both? And will the fact that Mexico has no xml mess things up?

    3. Colonialist Legacies Boers and Vietnam, and Leugi's Peru don't use culture overview at all, but have new buildings with slots that replace museum and amphitheatre. Since the building are only replacements, is it safe to assume your mod won't do any harm?

    4. Leugi's Cuba and Bolivia culture overview xml and lua are the same, so I guess again full compatibility.

    5. Leugi's Paraguay has no xml, and lua is different. Should I delete Paraguays lua and use yours? Or leave everything as it is? And what about xml missing in Paraguay?


    And one last question. As krolac above I would love to use your mod in multiplayer via MPMPM.
    Did you have a chance to look at the incompatibility reported above and the solution? What are your thoughts?
     
  20. manekk

    manekk Chieftain

    Joined:
    Mar 18, 2015
    Messages:
    59
    Hi krolac and thanks for the fix. Did you have a chance to test it in a full game?
    And do you think that it would still work when there are 5 civs used at the same time, all with modified GW buildings?
     

Share This Page