View Full Version : [PYTHON] Building Demolition
vorius Nov 07, 2005, 07:59 AM This is a python script modification to the CvEventManager file which enables building demolition from within a city view screen.
Detailed installation instructions are in the readme included with the zip
You will be extracting this to your My Games\Sid Meier's Civilization 4 folder (do not overwrite the CvEventManager file in the Assets folder under which the game was installed)
Then load any game and enter the city screen of one of your cities then press CTRL + D which will prompt you which building to demolish.
You cannot demolish world wonders or your Palace.
You should get a little sound effect when it is demolished too...
XF Clohvn Nov 07, 2005, 01:22 PM Should have been in from the start, nice work :)
Uty Nov 07, 2005, 01:31 PM What's the point of demolishing a building? They don't factor into maitenence cost.
vorius Nov 07, 2005, 02:06 PM What's the point of demolishing a building? They don't factor into maitenence cost.
Two things, mainly:
The first is Coal Plants/Nuclear Plants. If you get cleaner or safer power later you can demolish these buildings to get rid of their harmful effects
The second is National Wonders, if you want to reconfigure what cities have what national wonders since cities are limited to two
edit: on a less likely scenario, there's also the technique of removing really important buildings in cities you are sure to lose to an enemy or culture
Gorbad Ironclaw Nov 08, 2005, 02:22 AM Maybe removing some unhealthiness/unhappiness(if there are any, can't remember) generating buildings too.
BeefontheBone Nov 08, 2005, 12:51 PM Aren't all non-Wonder buildings razed on city capture anyway? Not sure about cultural shift, mind.
roidesfoux Nov 08, 2005, 02:14 PM Aren't all non-Wonder buildings razed on city capture anyway? Not sure about cultural shift, mind.
Nope. Only National Wonders.
-RdF
maartena Nov 09, 2005, 10:56 AM This is a python script modification to the CvEventManager file which enables building demolition from within a city view screen.
Detailed installation instructions are in the readme included with the zip
You will be extracting this to your My Games\Sid Meier's Civilization 4 folder (do not overwrite the CvEventManager file in the Assets folder under which the game was installed)
Then load any game and enter the city screen of one of your cities then press CTRL + D which will prompt you which building to demolish.
You cannot demolish world wonders or your Palace.
You should get a little sound effect when it is demolished too...
Will you get hammers back for it? (Like, maybe 33% of the initial contruction costs?)
All througout history, people have been demolishing buildings to build other parts of the city. Stones were often a hard commodity to come by, so after the Roman Empire collapsed and cities needed expansion or stone to build houses and buildings, they often turned to old buildings no longer in use. Colliseums were built all over Europe for instance, but only few remain in existance today due to them being torn down by the people, purely for the stones.
vorius Nov 09, 2005, 11:09 AM Currently demolishing does not give you a refund in hammers- I can certainly look into doing that if you'd really like to have that feature. Maybe expose a variable that can be modified so you can set whatever percent of it's cost would generate hammers for the city- form 0% to whatever you want.
Kilim Nov 09, 2005, 02:37 PM Once you add in the Hammer refund this mod would be Fully Complete :D
I like it alot!
Don't know why they didn't add this feature in the 1st place.
I am sure the other versions of Civ has the demolish option unless I am mistaken
Master Kodama Nov 09, 2005, 03:09 PM Conversely, getting a refund in gold instead of hammers might be a nice option -- that way you could re-allocate your refund to different uses besides production in that one city. That's how it worked in Civ3.
rosegame Nov 09, 2005, 03:13 PM can not work for me. when I hit ctrl+D it pops up the debug window.
can you change to another shortcut key?
Zurai Nov 09, 2005, 03:27 PM Nope. Only National Wonders.
-RdF
Incorrect. Capturing a city wipes out all or almost all buildings that were constructed in that city (barring world wonders) - even if the city was undefended.
vorius Nov 09, 2005, 07:01 PM can not work for me. when I hit ctrl+D it pops up the debug window.
can you change to another shortcut key?
A Python debug window? IS there any message written in this window?
MRM Nov 09, 2005, 08:48 PM :goodjob: That's really a feature that should have been in in the first place.
And IMO it's good as it is - no benifit in hammers or gold, how many bucks do you get from demolishing a real coal plant - it cost more ( so maybe you should have to pay for destroying a building ;) )
rosegame Nov 09, 2005, 09:24 PM how to upload the picture. I have no space to store the picture online. I can show you the debug window in the city view..
vbraun Nov 09, 2005, 09:40 PM Use http://www.imageshack.us to upload your pictures
rosegame Nov 10, 2005, 10:30 PM here is screenshot
http://img202.imageshack.us/img202/9612/civ4debug3cd.th.jpg (http://img202.imageshack.us/my.php?image=civ4debug3cd.jpg)
vorius Nov 11, 2005, 11:57 AM here is screenshot
http://img202.imageshack.us/img202/9612/civ4debug3cd.th.jpg (http://img202.imageshack.us/my.php?image=civ4debug3cd.jpg)
Hey that's pretty interesting! Never knew that existed! Any idea how you activated that window? I tried CTRL + D before this mod and it never did anything...
rosegame Nov 11, 2005, 03:40 PM I use the 18 civs map, add your mod and the domestic advisor mod.
that is all...
Arkeide Nov 12, 2005, 09:14 PM Thanks for this mod! Great work! ;)
It helped me to make my first mod attempt! I wanted to add a destroy city feature to your mod... It was nearly the same code so it was easy :)
When you press CTRL+X in a city, a pop up appear asking if you really want to raze the city, and then destroy it if you are OK.
Only city under or equal 3 can be destroyed.
Maybe some people will be interested to have both functionnalities at the same time... :D
Here it is :
103587
vorius Nov 12, 2005, 10:49 PM Thanks for this mod! Great work! ;)
It helped me to make my first mod attempt! I wanted to add a destroy city feature to your mod... It was nearly the same code so it was easy :)
When you press CTRL+X in a city, a pop up appear asking if you really want to raze the city, and then destroy it if you are OK.
Only city under or equal 3 can be destroyed.
Maybe some people will be interested to have both functionnalities at the same time... :D
Here it is :
103587
Nice work!
Maybe you could also do something like producing at least one settler or maybe even 1 settler for each population point of the city?
I just noticed from looking at the code you modified that the building demo mod I posted has some junk code in it from me testing stuff for this and my future auto-missionary mod. Also the code headers are mislabelled! I don't know how I let that get in there (it doesnt break anything- but it's just plain messy). :sad:
I'll have to fix this tomorrow after I get some sleep!
JakeCourtney Nov 12, 2005, 10:55 PM That's pretty cool.
Thalassicus Nov 22, 2005, 06:33 PM When you build a hydo or nuclear plant, I'm 99% sure it actually obsoletes the coal plant in the city (negating it's health effects). I might have mistakenly had a recycling center in the city...but I don't think I had Ecology yet at the time when I noticed that.
If an abandon city option is implimented, any foreign population in a city when it's raized should cause -1 diplomatic relations per population point with that civ. "You abandoned our countrymen!"
analyst Nov 27, 2005, 09:34 PM rosegame has a developer edition, methinks :) Wonder where that came from... :P
I'd LOVE to have that debug menu. It looks awesome.
Apprently you can even activate Throne Room?!?!?!?!
Simetrical Nov 28, 2005, 01:07 PM here is screenshot
http://img202.imageshack.us/img202/9612/civ4debug3cd.th.jpg (http://img202.imageshack.us/my.php?image=civ4debug3cd.jpg)
Do you maybe have cheat mode on?
Snaitf Nov 28, 2005, 03:50 PM ATTN: TheDarkside and Arkeide
I liked your mod but found a few bugs and wanted a few other features, so I basicly did a small re-write. I made sure to credit both of your as the original authors, but did place my name on it as I fixed/added a lot of stuff. If you want to check it out it's right here:
http://forums.civfanatics.com/showthread.php?t=144423
I hope you don't mind that I posted this, if you would like me to remove it, just let me know.
Snaitf
jello1717 Nov 28, 2005, 07:45 PM Do you maybe have cheat mode on?
CNTL-D brings up the same debug menu for me too. I do indeed have cheat mode enabled since that was the only way to see the entire map in the world builder when I first started playing (I don't know if this has changed).
EDIT:
I turned off cheat mode and CNTL-D no longer brings up the debug menu. With cheat mode off I am able to see the entire map in the world builder so disabled it for good.
hIdDeN_eViL Nov 30, 2005, 07:04 AM for a refund, i don't think it is realistic to straightforward refund hammers, simly because demolishing a coal plant shouldn't help you biuld a settler.
refunding gold is also unrealistic, as demoitions cost money, not make you money.
i think that instead, when a building is demolished, 1/3 of its production cost is given to rebuilding it. so if i kill off a coal plant, but later want to build it again, 1/3 is already complete. this reflects the fact that most of the building material is already there.
Dental-floss Dec 03, 2005, 01:31 PM When you build a hydo or nuclear plant, I'm 99% sure it actually obsoletes the coal plant in the city (negating it's health effects). I might have mistakenly had a recycling center in the city...but I don't think I had Ecology yet at the time when I noticed that.
I'm not so sure about this, since global warming often occurs near cities in which I have hydro or nuclear plants. Each of the cities it's happened near also have coal plants, which I was disappointed to discover I can't demolish (w/out the mod, I mean).
Fachy Dec 17, 2005, 10:13 PM When you build a hydo or nuclear plant, I'm 99% sure it actually obsoletes the coal plant in the city (negating it's health effects). I might have mistakenly had a recycling center in the city...but I don't think I had Ecology yet at the time when I noticed that.
If an abandon city option is implimented, any foreign population in a city when it's raized should cause -1 diplomatic relations per population point with that civ. "You abandoned our countrymen!"
If you're sure, can you figure out which line in the buildings xml file is it? It'd be nice to used it for religious modding (to make new-religion temples replace old ones)
Vorious, important question for you: Does the AI use the patch? Like.. does it normally demolish a coal plant after it built a hydro (assuming this doesn't automatically happen)?
Thalassicus Dec 18, 2005, 12:49 AM It does in fact work, and with the 3GD as well:
http://img233.imageshack.us/img233/1403/coalplanthealth19kj.jpg
http://img226.imageshack.us/img226/1141/coalplanthealth22ak.jpg
From looking in the XML file though, it doesn't appear to obsolete the building / remove the effect of the Coal plant there. It just has these lines:
<BuildingClass>BUILDINGCLASS_COAL_PLANT</BuildingClass>
...
<bRiver>0</bRiver>
<bPower>0</bPower>
<bDirtyPower>1</bDirtyPower>
<bAreaCleanPower>0</bAreaCleanPower>
<BuildingClass>BUILDINGCLASS_HYDRO_PLANT</BuildingClass>
...
<bRiver>1</bRiver>
<bPower>1</bPower>
<bDirtyPower>0</bDirtyPower>
<bAreaCleanPower>0</bAreaCleanPower>
<BuildingClass>BUILDINGCLASS_THREEGORGESDAM</BuildingClass>
...
<bRiver>1</bRiver>
<bPower>0</bPower>
<bDirtyPower>0</bDirtyPower>
<bAreaCleanPower>1</bAreaCleanPower>
...so I assume the rest is done somewhere else. Not sure if it'd be possible to apply to other buildings; depends on how the obsolescence is handled.
Fachy Dec 18, 2005, 11:04 AM Maybe it's simply set to replace dirtypower by cleanpower when both exists
Vorious you there? o.o
|
|