[PYTHON] Building Demolition

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 :
View attachment destroy.zip
 
Arkeide said:
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 :
View attachment 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!
 
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!"
 
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?!?!?!?!
 
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​
 
Simetrical said:
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.
 
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.
 
Thalassicus said:
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).
 
Thalassicus said:
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)?
 
It does in fact work, and with the 3GD as well:

coalplanthealth19kj.jpg


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:

Code:
	<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.
 
Maybe it's simply set to replace dirtypower by cleanpower when both exists

Vorious you there? o.o
 
Back
Top Bottom