Craig_Sutter
Deity
In my mod, several civilizations start with no cities.
When playtesting, I found that they were puppeting their newly acquired capital cities and well as others.
I have added a courthouse effect to the palace, and so, I don't want the capitals to be puppets.
I used the following code to do so:
It works in that the capital cities are no longer puppets; however, I suspect that the code is actually doing more and forcing all AI cities that are conquered to be annexed. I not certain this is the case, but it seems to be so as I no longer see puppets in my testing.
Could someone who is familiar with lua look at my code and verify if it is acting as I wish? Or have some unintentional results occured?
When playtesting, I found that they were puppeting their newly acquired capital cities and well as others.
I have added a courthouse effect to the palace, and so, I don't want the capitals to be puppets.
I used the following code to do so:
Code:
function UnPuppetTurnStart ()
for iPlayer=0, GameDefines.MAX_MAJOR_CIVS-1 do
local player=Players [iPlayer];
if (player:IsAlive () and not player:IsHuman()) then
local pCity = player:GetCapitalCity()
for pCity in player:Cities () do
if (pCity:IsPuppet ()) then
pCity:SetPuppet (false);
end
end
end
end
end
Events.ActivePlayerTurnStart.Add (UnPuppetTurnStart);
It works in that the capital cities are no longer puppets; however, I suspect that the code is actually doing more and forcing all AI cities that are conquered to be annexed. I not certain this is the case, but it seems to be so as I no longer see puppets in my testing.
Could someone who is familiar with lua look at my code and verify if it is acting as I wish? Or have some unintentional results occured?