First, I've been trying to use .lua for some time but I'm not sure if I'm just terrible at making it work or if I need to activate it somewhere (like associations for .xml). Do it need to be imported into VFS or do I need to add it in content as InGameUIAddin (and if I need to, is it supposed to not appear in the options?)?
Now the real question,
I tried to make a small change in some of Damasc's (and JFD) code to make a custom improvement (in the Civilization territory) creates a dummy building in a city (effect stacks):
It doesn't work and I'm not sure why...
PS.: If you have difficulty understanding something I said because of the grammar, pls tell me so I can try to explain it better. English is not my native language >.>
Now the real question,
I tried to make a small change in some of Damasc's (and JFD) code to make a custom improvement (in the Civilization territory) creates a dummy building in a city (effect stacks):
Code:
local civilisationID = GameInfoTypes["CIVILIZATION_OLD_ONES"]
------------------------------------------------------------------------------------------------------------------------
-- Sholds
------------------------------------------------------------------------------------------------------------------------
function Sholds(playerID)
local player = Players[playerID]
if player:IsAlive() and player:GetCivilizationType() == civilizationID then
for pCity in pPlayer:Cities() do
local iNumPlots = pCity:GetNumCityPlots()
for i = 0, iNumPlots - 1 do
local pPlot = pCity:GetCityIndexPlot(i)
if pPlot and pPlot:GetOwner() == iPlayer then
if pPlot:GetImprovementType() == GameInfoTypes.IMPROVEMENT_STRONGHOLD then
city:SetNumRealBuilding(GameInfoTypes["BUILDING_ELDERSCI"], 1)
end
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(Sholds)
It doesn't work and I'm not sure why...
PS.: If you have difficulty understanding something I said because of the grammar, pls tell me so I can try to explain it better. English is not my native language >.>