Argos UA coding help

Firebug

Not-so Great Engineer
Joined
Sep 25, 2014
Messages
1,271
Location
Clevedon, England
I've managed to code the first half of my Argos UA, but i'm struggling with the second half.

When a Citizen is born in the Capital it receives a Production boost equal to the Food carried over at birth.

I think theres a FoodKept value for use in Lua?
 
I think this should do the trick:

Code:
GameEvents.SetPopulation.Add(function(iPlotX, iPlotY, iOldValue, iNewValue)
	if iNewValue < iOldValue then return end
	local pCity = Map.GetPlot(iPlotX,iPlotY):GetPlotCity()
	if (pCity:IsCapital()) and (Players[pCity:GetOwner()]:GetCivilizationType() == GameInfoTypes.CIVILIZATION_FB_ARGOS) then
		pCity:ChangeProduction(pCity:GetFoodKept())
	end
end)
 
First Palmyra, now this.
I want your babies.
 
Back
Top Bottom