Hey everybody, part of my custom civs trait is that it grants faith upon settling a city. Sounds simple enough, but I can't seem to figure out how to make it work. Here's the code I have right now:
To me it seems like this should work, but right now I don't get any faith from founding a city. What's wrong here?
Code:
local iChickasaw = GameInfoTypes.CIVILIZATION_CHICKASAW
function Kohta_Falaya_Founded(playerID, iCityX, iCityY)
local player = Players[playerID]
if (not player:IsAlive()) then return end
if (not player:GetCivilizationType()==iChickasaw then return end
local chickasawFaithPerTurn = ((player:GetTotalFaithPerTurn() + 1) * 10)
player:ChangeFaith(chickasawFaithPerTurn)
end
GameEvents.PlayerCityFounded.Add(Kohta_Falaya_Founded)
To me it seems like this should work, but right now I don't get any faith from founding a city. What's wrong here?