<Civilization_BuildingClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_SPAIN</CivilizationType>
<BuildingClassType>BUILDINGCLASS_PETRA</BuildingClassType>
<BuildingType/>
</Row>
</Civilization_BuildingClassOverrides>
The only non-LUA way to do it that comes into my mind is to set AIWorldConstructPercent in HandicapInfos to a very high value...
You can do in SQL, using less code than that. But this method only makes sense if always the same civs are played by the AI.
Tomatekh said:Though, it wouldn't matter which civs the AI plays, as you would be making entries for all of them.
Well, I was implying he would make an entry for every wonder each time for every civ. So 40 Wonders X 34 Civs, for a grand total of 1,360 entries... which is actually beyond tedious. Though, it wouldn't matter which civs the AI plays, as you would be making entries for all of them. Not exactly feasible, but it is a way to accomplish blocking AI from building wonders completely with just XML.
-- create dictionary, for quick access
local wonders = { }
for buildingClassInfo in GameInfo.BuildingClasses("MaxGlobalInstances = 1") do
wonders[GameInfo.Buildings[buildingClassInfo.DefaultBuilding].ID] = 1
end
-- no wonders for AI
GameEvents.CityCanConstruct.Add(function(iPlayer, iCity, iBuildingType)
if wonders[iBuildingType] and iPlayer ~= Game.GetActivePlayer() then
return false
end
return true
end);
I'm surprised no one mentioned this, but this I found to be the easiest way to do it (in lua):
Just putting that in a lua file should do the job.Code:-- create dictionary, for quick access local wonders = { } for buildingClassInfo in GameInfo.BuildingClasses("MaxGlobalInstances = 1") do wonders[GameInfo.Buildings[buildingClassInfo.DefaultBuilding].ID] = 1 end -- no wonders for AI GameEvents.CityCanConstruct.Add(function(iPlayer, iCity, iBuildingType) if wonders[iBuildingType] and iPlayer ~= Game.GetActivePlayer() then return false end return true end);
Then it would also affect the human player.
Well, it does, but I sort of implied that thing.Doesn't the game need to recognize a new script as part of a mod before it lets the thing run? (Great thinking, BTW; you aren't the only player frustrated by an AI civ snatching a wonder away from his own civ when he was 1-2 turns short of finishing.)