I uploaded the wrong one. Use this instead.
Much better. I really like this one.
I uploaded the wrong one. Use this instead.
I uploaded the wrong one. Use this instead.
I uploaded the wrong one. Use this instead.
I agree with Pouakai, keep the old icon - it's pretty great.
@calcul8or, I haven't seen the code, but a friendly advise, if you're not already, is to use print statements. Preferably in all steps of the code. That usually makes it pretty easy to spot where something goes wrong.
if (pPlot:IsCity()) then
local pCity = pPlot:GetPlotCity()
print("It's a city")
FTcount = FuneraryTowerCountPalmyra(pCity, iPlayer)
elseif (pPlot:GetWorkingCity() ~= nil and pPlot:GetOwner() == iPlayer) then
print("Plot worked by city")
local FTcount = FuneraryTowerCountPalmyra(pPlot:GetWorkingCity(), iPlayer)
print("FTcount is " .. FTcount)
else
print("Looking for the right city")
local unitDistance = 9999
local newCity = nil
for iCity in pPlayer:Cities() do
local iNewDistance = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iX, iY)
print("iNewDistance = " .. iNewDistance)
if (iNewDistance < unitDistance) then
newCity = iCity
end
end
if (newCity ~= nil) then
FTcount = FuneraryTowerCountPalmyra(newCity, iPlayer)
else
print("No city found, using capital");
FTcount = FuneraryTowerCountPalmyra(pPlayer:GetCapitalCity(), iPlayer)
end
end
bGreatPerson = false
print("Changing culture by " .. FTcount)
pPlayer:ChangeJONSCulture(FTcount)
[529920.109] PalmyraTest2: GP expended in GreatPersonExpended
[529920.109] PalmyraTest2: Great person expended by Palmyra
[529920.109] PalmyraTest2: Plot worked by city
[529920.109] PalmyraTest2: iFuneraryTowerNum is 1
[529920.109] PalmyraTest2: iFuneraryTowerNum is 2
[529920.109] PalmyraTest2: iFuneraryTowerNum is 3
[529920.109] PalmyraTest2: FTcount is 3
[529920.109] PalmyraTest2: Changing culture by 0
local civID = GameInfoTypes["CIVILIZATION_ALASKA"];
local iImprovementFuneraryTowerID = GameInfoTypes.IMPROVEMENT_AKHUNTINGCAMP
local bGreatPerson = false
function PalmyraFTbonus(iPlayer, UnitID, UnitType, iX, iY, bDelay, eByPlayer)
local pPlayer = Players[iPlayer]
if (pPlayer:IsAlive() and pPlayer:GetCivilizationType() == civID) then
if bGreatPerson then
print("Great person expended by Palmyra");
local FTcount = 0
local pPlot = Map.GetPlot(iX,iY)
if (pPlot:IsCity()) then
local pCity = pPlot:GetPlotCity()
print("It's a city")
FTcount = FuneraryTowerCountPalmyra(pCity, iPlayer)
elseif (pPlot:GetWorkingCity() ~= nil and pPlot:GetOwner() == iPlayer) then
print("Plot worked by city")
local FTcount = FuneraryTowerCountPalmyra(pPlot:GetWorkingCity(), iPlayer)
print("FTcount is " .. FTcount)
else
print("Looking for the right city")
local unitDistance = 9999
local newCity = nil
for iCity in pPlayer:Cities() do
local iNewDistance = Map.PlotDistance(iCity:GetX(), iCity:GetY(), iX, iY)
print("iNewDistance = " .. iNewDistance)
if (iNewDistance < unitDistance) then
newCity = iCity
end
end
if (newCity ~= nil) then
FTcount = FuneraryTowerCountPalmyra(newCity, iPlayer)
else
print("No city found, using capital");
FTcount = FuneraryTowerCountPalmyra(pPlayer:GetCapitalCity(), iPlayer)
end
end
bGreatPerson = false
print("Changing culture by " .. FTcount)
pPlayer:ChangeJONSCulture(FTcount)
if (pPlayer:IsHuman() and FTcount > 0) then
Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", FTcount))
end
end
end
end
GameEvents.UnitPrekill.Add(PalmyraFTbonus)
function PalmyraGPexpended(playerID, iUnit)
local pPlayer = Players[playerID]
if (pPlayer:IsAlive() and pPlayer:GetCivilizationType() == civID) then
print("GP expended in GreatPersonExpended")
bGreatPerson = true
end
end
GameEvents.GreatPersonExpended.Add(PalmyraGPexpended)
function FuneraryTowerCountPalmyra(city, playerID)
local iFuneraryTowerNum = 0
for cityPlot = 0, city:GetNumCityPlots() - 1, 1 do
local plot = city:GetCityIndexPlot(cityPlot)
if plot and plot:GetOwner() == playerID then
if city:IsWorkingPlot(plot) then
if plot:GetImprovementType() == iImprovementFuneraryTowerID then
iFuneraryTowerNum = iFuneraryTowerNum + 1
print("iFuneraryTowerNum is " .. iFuneraryTowerNum)
end
end
end
end
return iFuneraryTowerNum
end
Could you explain how the extra culture works, Calcul8or?
While working a funerary tower, i expend the great person and a message lets me know that i buried a great person and gained culture.
The yield of the funerary tower doesn't increase, so what happens?
A lump sum of culture is paid out when a great person is expended based on the number of funerary towers being worked by the city the GP is in (or the nearest city). If that's not the way it was supposed to me, then I goofed it up![]()
The changes to the Funerary Towers, putting into consideration the no adjacency and desert only.
- Lump sum of 10 Culture per Funerary Towers worked when you expend a Great Person.
Teasers!
Spoiler :![]()
I'll need to look back through the thread for credits once the mod is released.
But we still need compats, unit art and music.
function ChangePalmyraCulture(delta, playerID)
local deltaX10 = delta * 10
print("Changing Culture by " .. deltaX10);
local pPlayer = Players[playerID]
pPlayer:ChangeJONSCulture(deltaX10)
if (pPlayer:IsHuman() and delta > 0) then
Events.GameplayAlertMessage(Locale.ConvertTextKey("You have gained +{1_Num} Culture from the burial of a great person!", deltaX10))
end
end