Automatically Build Buildings

ls612

Deity
Moderator
Joined
Mar 10, 2008
Messages
8,288
Location
America
I am trying to add a mechanic to my mod which will automatically make a building appear in a city if the city grows to a certain size. How does one have a building built in the DLL? Does CvCity::ProcessBuilding() actually add the building to the city or just it's effects?
 
Off the top of my head, I think you call CvCity::GetBuildings()->ChangeNumBuilding(BuildingTypes) from within the DLL.

No, that isn't it (that is the number of buildings in a city total). I think that GetBuildings()->SetNumFreeBuildings(BuildingTypes) will work though. Thanks anyways.
 
pkCity->GetCityBuildings()->SetNumRealBuilding(iIndex, iNewValue);

IIRC SetNumFreeBuildings will work too, but the building will have no maintenance cost.
 
No, that isn't it (that is the number of buildings in a city total). I think that GetBuildings()->SetNumFreeBuildings(BuildingTypes) will work though. Thanks anyways.

Looking at the source code now, you're right. SetNumFreeBuildings will make that maintenance free though. If that's what you wanted, great, but if you did maintenance on the building you want SetNumRealBuilding.

EDIT ninja'd
 
Back
Top Bottom