The Enlightenment Era

I mean, to be fair, it would be great to actually use Samurai a bit more in the game xD

It's a shame that Samurai are so bad, especially since their animations are really cool. Sadly, I'm not sure if this is the most effective solution to the issue...
 
Also, the Samurai still upgrades into Riflemen, even though they're two eras away :/. Intentional?

I'm pretty sure the Samurai upgrades to Riflemen in normal BNW, as well.

EDIT: Sorry, I missed the "still" in there.
 
Maybe it should upgrades to Line Intantry in EE

That would be ideal, and possibly even historically accurate, since Firaxis seem to use Riflemen where Line Infantry should be. It's just that it's one thing pitching 21 strength with Shock 3 against 24 strength, and another pitching 21 strength against 31 strength.
 
I'd like to address something.
I'm at a game where it's at the Modern/Atomic Era(s) and nobody has built the Versailles wonder yet. I looked at the files and didn't see any flavors for this wonder. I haven't built it to see how long it would go unbuilt, and the AI has completely ignored it.

Update:
The same situation applies for the Fasil Ghebbi wonder.
 
Hey guys,when i build Crystal Palace i get 35% bonus for GG and i have 8 great works..Is 35% limit ?
 
As Buildkirbyus mentioned earlier, I also haven't seen the AI construct Fasil Ghebbi or Versailles in 2 complete games. I never built them myself and but the AI hasn't seemed interested so far.

One of those games I played as Japan and I also agree that the gap between promotions for the samurai to rifleman was a bit large. I like the idea of possibly changing it to line infantry.
I also wanna say how much I love this mod! Thanks for all the hard work.
 
The Wat Phra Kaew grants +2 Science for Religious Buildings.
Would you check the xml?

cf.
XML\Buildings\Enlightenment_Wonders.xml
Line: 439 - 474
 

Attachments

  • Wat Phra Kaew.jpg
    Wat Phra Kaew.jpg
    401.4 KB · Views: 88
The Wat Phra Kaew grants +2 Science for Religious Buildings.
Would you check the xml?

cf.
XML\Buildings\Enlightenment_Wonders.xml
Line: 439 - 474

If I'm right, the old Wat Phra Kaew mod gave +2 Science, I guess it was just copy-pasted over for EE.
 
Don't know if you are still looking for code for Versailles, but I added this to the mod for the test game I am running with EE and Era Buildings active:
Code:
--------------------------------------------------------------
-- Versailles effect (+10 WLTKD turns in all cities on Construction)
-- Author: LeeS
--------------------------------------------------------------
local iVersaillesWonder = GameInfoTypes.BUILDING_EE_VERSAILLES
local iWLTKDmod = (math.ceil(GameDefines.CITY_RESOURCE_WLTKD_TURNS * (50/100))) + 1

function VersaillesCompleted(ownerId, cityId, buildingType, bGold, bFaithOrCulture)
	if buildingType == iVersaillesWonder then
		for pCity in Players[ownerId]:Cities() do
			if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
				if pCity:GetWeLoveTheKingDayCounter() > 0 then
					pCity:ChangeWeLoveTheKingDayCounter(iWLTKDmod)
				else
					pCity:SetWeLoveTheKingDayCounter(iWLTKDmod)
				end
			end
		end
	end
end
GameEvents.CityConstructed.Add(VersaillesCompleted)
Upon wonder construction it adds +10 WLTKD turns to all cities that are not puppets, being razed, or in resistance.
  • The extra +1 turns in the code is to keep players from freaking out that they are not getting the full 10 turns. They actually would be, but the turn upon which the wonder is constructed is considered by the game as being one of the "10 turns", so cities only show 9 more turns.
  • Cities of less than size 6 don't show the WLTKD counter, but the food yield is being modified for those cities. However, I haven't been able to run far enough through testing after the wonder is constructed to verify that the less-than-6 size cities actually ever go out of WLTKF mode.
  • If you want the effect to be continuous for the rest of the game, that would take quite a bit more logic. And some form of data-marking for cities that have had their WLTKD counter adjusted would have to be devised. Unfortunately there does not seem to be anything simple (like a policy effect) that can be used to one-and-done the code to increase the WLTKD counters on a continuing basis.
  • For game speeds other than Standard, don't know if the game adjusts the number of WLTKD turns specified in the GameDefines I am pulling the base number from.
    • It will not be a huge issue to alter if other gamespeeds adjust the base number
    • the real issue will be deciding which gamespeed modifier is best to use given the number of custom gamespeed-mods running around, and they all seem to not use the same percentage modifier columns from the GameSpeeds table to make their effects within a custom game-speed-mod
 
Doesn't that just start a WLTKD in all cities though, instead of a Chichen Itza esque longer WLTKD when they occur?
Yeah...the issue with a permanent longer WLTKD 'modification' is there's nothing standard within the game to hang the modification on.

Not that it isn't doable, it is just that it would take more logic and at the least some method to 'mark' a city as having their current WLTKD as having been processed. At the very least it will require data-saving of some kind, I would think -- or a marker-building to place within the city signifying it has been processed for that current WLTKD. Basically, the third bullet in my previous post is addressing this issue/question as to whether you want the effect to be like the Chicken Pizza.
 
Try this version on for size:
Spoiler :
Code:
 --------------------------------------------------------------
-- Versailles effect (+10 WLTKD turns in all cities in WLTKD on Construction)
--	extends all WLTKD for the player by +10 turns for the remainder of the game as these WLTKD occur
-- Author: LeeS
--------------------------------------------------------------
local iVersaillesWonder = GameInfoTypes.BUILDING_EE_VERSAILLES
local iWLTKDmod = (math.ceil(GameDefines.CITY_RESOURCE_WLTKD_TURNS * (50/100)))
local tCitiesInWLTKD = {["NONE"] = "nobody has built the Versailles yet"}

function VersaillesCityCaptured(iOldOwner, bIsCapital, iX, iY, iNewOwner, iPop, bConquest)
	if iNewOwner == 63 then return end
	local pCity = Map.GetPlot(iX, iY):GetPlotCity();
	if pCity:IsHasBuilding(iVersaillesWonder) then
		--City with the Versailles Wonder was just captured
		tCitiesInWLTKD = {}
		if Players[iNewOwner]:IsMinorCiv() then
			tCitiesInWLTKD[iNewOwner] = {["NONE"] = "new owner of the Versailles is a city-state"}
			return
		else
			tCitiesInWLTKD[iNewOwner] = {}
		end
		for pCity in Players[iNewOwner]:Cities() do
			if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
				if pCity:GetWeLoveTheKingDayCounter() > 0 then
					pCity:ChangeWeLoveTheKingDayCounter(iWLTKDmod)
				end
				tCitiesInWLTKD[iNewOwner][pCity:GetID()] = pCity:GetWeLoveTheKingDayCounter()
			end
		end
	else
		if Players[iNewOwner]:CountNumBuildings(iVersaillesWonder) > 0 then
			if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
				tCitiesInWLTKD[iNewOwner][pCity:GetID()] = pCity:GetWeLoveTheKingDayCounter()
			end
		end
	end
end
function VersaillesPlayerCityFounded(iPlayer, iCityX, iCityY)
	if Players[iPlayer]:CountNumBuildings(iVersaillesWonder) > 0 then
		if Players[iPlayer]:IsBarbarian() then return end
		if Players[iPlayer]:IsMinorCiv() then return end
		tCitiesInWLTKD[iPlayer][Map.GetPlot(iCityX, iCityY):GetPlotCity():GetID()] = 0
	end
end
function VersaillesPlayerDoTurn(iPlayer)
	local pPlayer = Players[iPlayer]
	if pPlayer:IsBarbarian() then return end
	if pPlayer:IsMinorCiv() then return end
	if pPlayer:CountNumBuildings(iVersaillesWonder) > 0 then
		print("Versailles was detected in the empire of player # " .. iPlayer)
		for pCity in pPlayer:Cities() do
			local iCityID = pCity:GetID()
			if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
				if tCitiesInWLTKD[iPlayer][iCityID] then
					if pCity:GetWeLoveTheKingDayCounter() > tCitiesInWLTKD[iPlayer][iCityID] then
						pCity:ChangeWeLoveTheKingDayCounter(iWLTKDmod)
					end
				else
					if pCity:GetWeLoveTheKingDayCounter() > 0 then
						pCity:ChangeWeLoveTheKingDayCounter(iWLTKDmod)
					end
				end
				tCitiesInWLTKD[iPlayer][iCityID] = pCity:GetWeLoveTheKingDayCounter()
			end
		end
		print("tCitiesInWLTKD[iPlayer] is a table: iPlayer = player # " .. iPlayer)
		for iCityID,WLTKDCounter in pairs(tCitiesInWLTKD[iPlayer]) do
			print("Player City of ID# " .. iCityID .. " currently has a WLTKD counter of " .. WLTKDCounter)
		end
	end
end
function VersaillesCompleted(ownerId, cityId, buildingType, bGold, bFaithOrCulture)
	if buildingType == iVersaillesWonder then
		tCitiesInWLTKD = {}
		tCitiesInWLTKD[ownerId] = {}
		for pCity in Players[ownerId]:Cities() do
			if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
				if pCity:GetWeLoveTheKingDayCounter() > 0 then
					pCity:ChangeWeLoveTheKingDayCounter(iWLTKDmod)
				end
				tCitiesInWLTKD[ownerId][pCity:GetID()] = pCity:GetWeLoveTheKingDayCounter()
			end
		end
		--add additional event subscriptions here
		GameEvents.PlayerDoTurn.Add(VersaillesPlayerDoTurn)
		GameEvents.PlayerCityFounded.Add(VersaillesPlayerCityFounded)
		GameEvents.CityCaptureComplete.Add(VersaillesCityCaptured)
	end
end
GameEvents.CityConstructed.Add(VersaillesCompleted)

for iPlayer = 0, GameDefines.MAX_MAJOR_CIVS - 1 do
	if Players[iPlayer]:IsAlive() then
		if Players[iPlayer]:CountNumBuildings(iVersaillesWonder) > 0 then
			tCitiesInWLTKD = {}
			tCitiesInWLTKD[iPlayer] = {}
			for pCity in Players[iPlayer]:Cities() do
				if not pCity:IsPuppet() and not pCity:IsRazing() and not pCity:IsResistance() then
					tCitiesInWLTKD[iPlayer][pCity:GetID()] = pCity:GetWeLoveTheKingDayCounter()
				end
			end
			GameEvents.PlayerDoTurn.Add(VersaillesPlayerDoTurn)
			GameEvents.PlayerCityFounded.Add(VersaillesPlayerCityFounded)
			GameEvents.CityCaptureComplete.Add(VersaillesCityCaptured)
		end
	end
end

for k,v in pairs(tCitiesInWLTKD) do
	if type(v) == "table" then
		print("tCitiesInWLTKD[k] is a table: k = player # " .. k)
		for iCityID,WLTKDCounter in pairs(tCitiesInWLTKD[k]) do
			print("Player City of ID# " .. iCityID .. " currently has a WLTKD counter of " .. WLTKDCounter)
		end
	elseif k == "NONE" then
		print("tCitiesInWLTKD[k] = " .. k .. " because " .. v)
	else
		print("We have something really wierd going on here with the data in the tCitiesInWLTKD table")
	end
end
  • Doesn't require persisting data
  • Only runs the PlayerDoTurn, PlayerCityFounded, and CityCaptureComplete events after the wonder is constructed
  • On game reloading, rebuilds the necessary data from the saved game itself
  • Dynamically monitors for whether a new WLTKD has been initiated within a city, and adds the extra WLTKD turns in that city.
  • Extends existing WLTKD instantly upon completion of the wonder
  • If the city that built the wonder is captured, the new owner starts to get the effects of the wonder. If they are an AI (city-state) and they raze and destroy the city with the wonder, the effects cease to operate, and any stale obsolete data will get cured the next time the user reloads a saved game -- otherwise the stale info will just lie in the lua-table and not hurt anything.
  • Barbs are excluded from the capturing code for purposes of getting the benefits of the wonder.
  • If the user has the Barbs Evolved mod enabled, and the barbs capture the city with the wonder, the Barbs still will not get the advantage of the wonder, and the player who originally constructed the wonder will lose the benefits.
  • I did not code to 'remove' the extra WLTKD turns that might have been active for a player who just lost the city with the wonder.

PS: I have a slightly different version with a few lua-log print confirmation commands imbedded if you want to test a little.

[edit]I updated the code to be a bit more proactive against making sure barbs and minors can't make real use of the wonder even if they do capture the city that built the wonder. I also left the extra lua log print statements in the code, but you may wish to remove them.
 
Top Bottom