QUESTION: Alternative methods for making buildings obsolete.

Joined
Jul 21, 2003
Messages
7,819
Location
Adelaide, South Australia
Hi guys. So I want the ability to make buildings obsolete, but not via techs. I'd like to achieve the effect with either (a) the construction of another building, (b) the foundation of a Religion or (c) switching to a civic.

Now, I know how to make the necessary changes in CvInfos, but what I really need to know is how would I go about making the other changes needed to make it work? I assume I'd need to modify things in either CvCity, CvPlayer or CvTeam. What kind of file am I looking for?

Aussie.
 
The function you need is CvTeam::changeObsoleteBuildingCount() (in CvTeam.cpp).

This is currently only called from within CvTeam:: processTech() after a new tech is researched, but you can use it in other locations as well:
Code:
(a) in CvCity::processBuilding()
(b) in CvPlayer::foundReligion()
(c) in CvPlayer::processCivics()
 
The might also be a dirty Python hack for this, available via CvGameUtils.canConstruct().
 
Hi guys. So I want the ability to make buildings obsolete, but not via techs. I'd like to achieve the effect with either (a) the construction of another building, (b) the foundation of a Religion or (c) switching to a civic.

Now, I know how to make the necessary changes in CvInfos, but what I really need to know is how would I go about making the other changes needed to make it work? I assume I'd need to modify things in either CvCity, CvPlayer or CvTeam. What kind of file am I looking for?

Aussie.

Pretty sure all of these tags are in AND. ;)
 
:yup: sure there is, they use it in Next War for the arcology shielding.

Yeah, but that code only influences *future* construction. What I want to do is have a newly built building-or the gaining of a religion-actually obsolete a building that's already been constructed in a city.

Aussie.
 
Yeah, but that code only influences *future* construction. What I want to do is have a newly built building-or the gaining of a religion-actually obsolete a building that's already been constructed in a city.

Aussie.

A newly built building replacing an older one is used in my mod at any rate. It uses the tag ReplacesBuildingClass, and replaces previous buildings with a new one that allows for building upgrade chains. I even added a new civilopedia page to show building upgrade chains.
 
A newly built building replacing an older one is used in my mod at any rate. It uses the tag ReplacesBuildingClass, and replaces previous buildings with a new one that allows for building upgrade chains. I even added a new civilopedia page to show building upgrade chains.

Oh cool, thanks so much for that info Afforess. Seriously, is there anything you *can't* do? ;) Between you & TheLopez, I reckon you guys could build a Civ game-from the ground up-that could give Civ4 & Civ5 a run for its money :)!

Aussie.
 
Oh cool, thanks so much for that info Afforess. Seriously, is there anything you *can't* do? ;) Between you & TheLopez, I reckon you guys could build a Civ game-from the ground up-that could give Civ4 & Civ5 a run for its money :)!

Aussie.

Artwork - I can't do artwork.

Seriously though, you should check FFH2 and my list of new tags before trying to add one yourself. Half the time you can find it already there. No need to reinvent a perfectly good wheel.
 
LOL, that's why I put the question up here *before* going ahead & trying to add something myself (though I did make a point of at least identifying which files in CvInfos I might need to alter). I'll also look to see if there are any tags limiting the construction of buildings based on the presence of forests, mountains & jungles-that would also save me a *lot* of time ;).

Aussie.
 
There are. Look for PrereqOrFeature and PrereqOrTerrain, PrereqANDTerrain. There is even a PrereqOrImprovement too. All lists, so you can specify as many, or as few items as you need.
 
There are. Look for PrereqOrFeature and PrereqOrTerrain, PrereqANDTerrain. There is even a PrereqOrImprovement too. All lists, so you can specify as many, or as few items as you need.

Amazing work Afforess, you've just saved me *weeks* or even *months* of work!

Aussie.
 
Back
Top Bottom