How can I exclude buildings from puppet cities? I'm pretty sure it's possible as there are some buildings (Barracks line) that they never build. Thanks in advance.
Can you do me a big favor and point me to the vanilla files that do this? I am hopeless with lua but I think I can back out the parts that I need if I can see the example.
Hacked out of my mod "Unique Building - Basilica" (and changed a bit)
Code:
local iBuildBarracks = GameInfo.Buildings["BUILDING_BARRACKS"].ID
function OnCityCanConstruct(iPlayerId, iCityId, iBuildingType)
if (iBuildingType == iBuildBarracks) then
local pPlayer = Players[iPlayerId]
local pCity = pPlayer:GetCityByID(iCityId)
return (not pCity:IsPuppet())
end
return true
end
GameEvents.CityCanConstruct.Add(OnCityCanConstruct)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.