Abandon/Raze City and Buildings

I think I have now fixed the last problem - you can no longer sell free buildings, which you then get back and could sell again and again....

Still for BUG 3.6.
 
OK, this is the last one I will post. There was a problem with modular buildings and now UU workers and settlers are being produced when approprite. Thanks to zappara for those fixes.
 
3.19 safe? ":)
 
Since it is just Python with no SDK calls I would assume so but I have not tested it, and real life means I wont get to it this week.
 
Hi,

I downloaded the abandon city mod yesterday from the start of this thread. Then I found your latest version (post 42) and so I downloaded that also.

I installed the later one following the clear instructions (for which many thanks). Everything works in it right up to the point of destroying a building or abandoning a city when pressing the OK button has no effect.

So I thought I must have something corrupted somewhere because all your mod files had to be in the right place for it to get that far.

Now, this morning I replaced the mod with the older version (from post 1 in this thread) and it worked perfectly.

Any clue what my problem is?

By the way I found that BUG had created an ini file for the newer version of the mod and placed it in "\BUG Mod" folder (I use altroot and installed the mod to run all the time rather than in the mods folder as a separate mod). It did the same when I installed it in the Stone Age mod (this is in \BTS\mods and also uses BUG) where the ini file appeared the \Stone Age folder. The file was created when Civ first loaded; the name is AbandonCityDemolishBuilding.ini and the content is;
"
# AbandonCity

# AbandonCityDemolishBuilding.ini

#

# Created by The BUG Mod.



[AbandonCity]



# XML key TXT_KEY_BUG_OPT_ABANDONCITY__PRODUCEUNITS_HOVER not found

# Default: 1



Produce Units = 1

"

I'm on 3.19 and believe I have the latest version of all mods having installed them in the last couple of weeks.
 
Actually I experince the same thing.

Thought it was only me since no one else reported it.

\Skodkim

Hi,

I downloaded the abandon city mod yesterday from the start of this thread. Then I found your latest version (post 42) and so I downloaded that also.

I installed the later one following the clear instructions (for which many thanks). Everything works in it right up to the point of destroying a building or abandoning a city when pressing the OK button has no effect.

So I thought I must have something corrupted somewhere because all your mod files had to be in the right place for it to get that far.

Now, this morning I replaced the mod with the older version (from post 1 in this thread) and it worked perfectly.

Any clue what my problem is?

By the way I found that BUG had created an ini file for the newer version of the mod and placed it in "\BUG Mod" folder (I use altroot and installed the mod to run all the time rather than in the mods folder as a separate mod). It did the same when I installed it in the Stone Age mod (this is in \BTS\mods and also uses BUG) where the ini file appeared the \Stone Age folder. The file was created when Civ first loaded; the name is AbandonCityDemolishBuilding.ini and the content is;
"
# AbandonCity

# AbandonCityDemolishBuilding.ini

#

# Created by The BUG Mod.



[AbandonCity]



# XML key TXT_KEY_BUG_OPT_ABANDONCITY__PRODUCEUNITS_HOVER not found

# Default: 1



Produce Units = 1

"

I'm on 3.19 and believe I have the latest version of all mods having installed them in the last couple of weeks.
 
Hello,

Where in Python file do I change the demolish/sell back to vanilla?

I want to try just abandon city code. See if the AI is smarter with buildings that are upgradeable because as one building upgrade to next, the older building automatically get demolished and sold for gold.

Thanks!
 
Sorry, I am on the far side of the planet from my computer. I also have limited access to the net.

The code should be in the assets/python folder and is called AbandonCity.py if I remember correctly.

As to the OK button not always working, I had that problem just before heading off to the old country so I should be able to start hunting for the problem when I get back in late September.

A newer version is available in Rise of Mankind but it has some RoM specific code in it.

Edit: The ini file does not yet do anything. I started to play around with it but decided that all the options except perhaps the enable one should be up to the modder not the player.
 
Attached is the new version. I still have not got the .INI file stuff working but I have cleaned up the code and the list box for selecting which building to sell/demolish.

Changes:-
- list box only shows buildings you can sell. IE free buildings no longer appear.
- you get less money for selling obsolete buildings (thanks to Zappara).

This is still for BUG so you will need to put a line in the assets\config\init.xml file to load this python. See readme file.

Note that this does have a bit of Rise of Mankind specific code in one of the if tests but in the same if test there is a condition which is always true for all non RoM games when the RoM condition is true. IE it (probably) does not matter that the condition is there.
 
It seems to be exactly the same: ctl+a brings up the pop-up but nothing happens when I press OK.

\Skodkim
 
Oops uploaded wrong file - sorry:blush:

Attached is the new version. I still have not got the .INI file stuff working but I have cleaned up the code and the list box for selecting which building to sell/demolish.

Changes:-
- list box only shows buildings you can sell. IE free buildings no longer appear.
- you get less money for selling obsolete buildings (thanks to Zappara).

This is still for BUG so you will need to put a line in the assets\config\init.xml file to load this python. See readme file.

Note that this does have a bit of Rise of Mankind specific code in one of the if tests but in the same if test there is a condition which is always true for all non RoM games when the RoM condition is true. IE it (probably) does not matter that the condition is there.
 
Does this work for any others?

Just tried the latest update and still nothing happens when I press OK.

Since its the python code thats been changed I suppose I wont need to start a new game to test...

\Skodkim
 
Does this work for any others?

Just tried the latest update and still nothing happens when I press OK.

Since its the python code thats been changed I suppose I wont need to start a new game to test...

\Skodkim

Unfortunately, I am no longer getting that problem. I have also triple checked that I have loaded the latest version, although Zappara has noticed that the payment for obsolete buildings is wrong. There is some XML for this mod, basically language text for the headings etc. but I don't think it changed between the versions so it should not be necessary to start a new game although you would have to exit Civ after putting the python in for the python to be loaded.
 
Still can't get the OK button to work.

I'm not used to working with python at all but it seems there's a discrepancy between the mod name in the files "AbandonCityEventManager.py" and Abandon City Mod.xml where the mod name is "AbandonCity" and the fact that you should put <load mod="Abandon City Mod"/> in the init.xml file. Is this correct?

Anyone else seing this problem??

\Skodkim
 
Still can't get the OK button to work.

I'm not used to working with python at all but it seems there's a discrepancy between the mod name in the files "AbandonCityEventManager.py" and Abandon City Mod.xml where the mod name is "AbandonCity" and the fact that you should put <load mod="Abandon City Mod"/> in the init.xml file. Is this correct?

Anyone else seing this problem??

\Skodkim

The names are OK, if inconsistant. The <load mod=...> points to the name of the XML to load. Inside that XML it points to the python (.py) to run. If this bit was not working you would not even be getting the popup.

Out of curiosity are "free" buildings showing in the popup list? If so then you still have the old version. Just to be sure.

Btw, I have confirmed that there is a bug in the obsolete building costs. I fixed the code where it gives money but not where it displays how much you will get.
 
No free building pop up so it must be the latest version. Wonder where the problem is then...

Just tried emptying the cache (again) with no luck. Will try starting a new game at one point and see if theres any difference.

\Skodkim
 
I know this post is old, but I fixed the Abandon City mod for BUG so that it runs with BUG 4.2 and BTS 1.19

The reason pressing OK wouldn't work is because there was a RoM "if statement" in the py file that pretty much shut the whole thing off.

The installation is the same as the older posted version.
 
Great!

Now I can get it to work - had really been waiting for someone to fix it

Thanks :goodjob:

\Skodkim
 
Top Bottom