AW Arcaeca
Deus Vult
Basically for a new civ I'm planning to give all tiles within their territory that generate no base yield (snow and desert, basically) +1 culture. Right now the code only calls for the plot to not generate food, gold or production but I might change that later on.
TBH I have no idea how to call all plots owned by a certain civ, so I kind of guessed on that... But with that in mind, how close is this coding to being able to do that?
TBH I have no idea how to call all plots owned by a certain civ, so I kind of guessed on that... But with that in mind, how close is this coding to being able to do that?
Code:
GameEvents.PlayerDoTurn.Add(
function(playerID)
local pPlayer = Players[playerID]
if (pPlayer:IsAlive()) then
if (pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_NEWCIV) then
local pPlot = Game.Plots([Plot.GetOwner(pPlayer)])
local food = GameInfoTypes.YIELD_FOOD
local gold = GameInfoTypes.YIELD_GOLD
local production = GameInfoTypes.YIELD_PRODUCTION
local culture = GameInfoTypes.YIELD_CULTURE
if (pPlot:GetYield(food) == 0)
and (pPlot:GetYield(gold) == 0)
and (pPlot:GetYield(production) == 0) then
x = pPlot:GetX()
y = pPlot:GetY()
Game.SetPlotExtraYield(x, y, culture, 1)
end
end
end)