Happy Razing

platyping

Sleeping Dragon
Joined
Oct 22, 2010
Messages
4,626
Location
Emerald Dreams
Happy Razing

Features:
1) Raze a city anytime anyday.
2) Sell off buildings at 10% cost.
3) Min 90% Nationality

 
Excellent! Let's happily raze our cities then! :D

However, I hope that it won't be available for other players' cities that you have not conquered. I'm thinking of the sneak view with espionage!
 
Ah sad, getting senile at modding and thinking...
Fixed, no longer able to raze cities of other players (whether team mates, vassals or simply via espionage)
 
Good!

May I ask you a favour? Could you have a look at a piece of my CvGameUtils.py where two of your components are sharing the place with another addition?

Spoiler :
PHP:
	def getWidgetHelp(self, argsList):
		eWidgetType, iData1, iData2, bOption = argsList

		if iData1 == 665:
			return CyTranslator().getText("TXT_KEY_CONDUCT_INQUISITION_MOUSE_OVER", ())
			
## Platy WorldBuilder ##
		if eWidgetType == WidgetTypes.WIDGET_GENERAL:
			if iData1 == 1029:
				sHelp = str(iData2)
				return CyTranslator().getText("TXT_KEY_WB_HELP" + sHelp,())
## Platy WorldBuilder ##

## Platy Happy Razing ##
		if eWidgetType == WidgetTypes.WIDGET_GENERAL:
			if iData1 == 4444:

				return CyTranslator().getText("TXT_KEY_HAPPY_RAZING",())
## Platy Happy Razing ##

		return u""

Is it OK to have a succession of "If" like that or should I add something somewhere to make it work? I have other instances like that.

Thanks!

Edit: no Python errors and it works, so should I worry?...
 
This sounds like Abandon City?? Thinking of this can you make a program/python, that when you want to JUST sell everything in that city, you can do so by just clicking on that "button" because otherwise you have to go ONE by ONE and if you have over 100 buildings, it get menautinous(spelling wrong)
 
Good!

May I ask you a favour? Could you have a look at a piece of my CvGameUtils.py where two of your components are sharing the place with another addition?

Spoiler :
PHP:
	def getWidgetHelp(self, argsList):
		eWidgetType, iData1, iData2, bOption = argsList

		if iData1 == 665:
			return CyTranslator().getText("TXT_KEY_CONDUCT_INQUISITION_MOUSE_OVER", ())
			
## Platy WorldBuilder ##
		if eWidgetType == WidgetTypes.WIDGET_GENERAL:
			if iData1 == 1029:
				sHelp = str(iData2)
				return CyTranslator().getText("TXT_KEY_WB_HELP" + sHelp,())
## Platy WorldBuilder ##

## Platy Happy Razing ##
		if eWidgetType == WidgetTypes.WIDGET_GENERAL:
			if iData1 == 4444:

				return CyTranslator().getText("TXT_KEY_HAPPY_RAZING",())
## Platy Happy Razing ##

		return u""

Is it OK to have a succession of "If" like that or should I add something somewhere to make it work? I have other instances like that.

Thanks!

Edit: no Python errors and it works, so should I worry?...

Since both of them are using the same Widget, you might as well merge them together and use elif for Data1.

Code:
		if eWidgetType == WidgetTypes.WIDGET_GENERAL:
			if iData1 == 1029:
				sHelp = str(iData2)
				return CyTranslator().getText("TXT_KEY_WB_HELP" + sHelp,())
			elif iData1 == 4444:
				return CyTranslator().getText("TXT_KEY_HAPPY_RAZING",())
 
This sounds like Abandon City?? Thinking of this can you make a program/python, that when you want to JUST sell everything in that city, you can do so by just clicking on that "button" because otherwise you have to go ONE by ONE and if you have over 100 buildings, it get menautinous(spelling wrong)

Pretty easy, just that... it doesn't really seem useful since there should be at least 1 or 2 buildings that you will want to keep...
 
Since both of them are using the same Widget, you might as well merge them together and use elif for Data1.

Indeed, thank you!

Note: on my screen, I had to change the placement of the icon because it was in the middle of the city name (CvMainInterface: 900 instead of 690, just for info).

Oh, I guess the symbol (the fist) comes from the font file (tga). Where can I see how they are referenced (FontSymbols.OCCUPATION_CHAR) if I want to change it?
 
http://civ4bug.sourceforge.net/PythonAPI/index4.html
for symbols. I believe you can change it to a new artwork entirely but I lazy to do so...

Hmm not sure why you still have to change the icon placement, since I pretty much copied and paste from another part of that file :D
So it should be adjusted according to screen resolution which apparently it doesn't hmmmmm
 
Pretty easy, just that... it doesn't really seem useful since there should be at least 1 or 2 buildings that you will want to keep...

Not if your just taking over the city to do just this, MORE :gold: then abandon/raze.:p
 
http://civ4bug.sourceforge.net/PythonAPI/index4.html
for symbols. I believe you can change it to a new artwork entirely but I lazy to do so...

Thanks but couldn't find a thing there...

Found this instead in CvUtil.py:
Spoiler :
PHP:
OtherFontIcons = { 'happy' : FontSymbols.HAPPY_CHAR,
				'unhappy' : FontSymbols.UNHAPPY_CHAR,
				'healthy' : FontSymbols.HEALTHY_CHAR,
				'unhealthy' : FontSymbols.UNHEALTHY_CHAR,
				'bullet' : FontSymbols.BULLET_CHAR,
				'strength' : FontSymbols.STRENGTH_CHAR,
				'moves' : FontSymbols.MOVES_CHAR,
				'religion' : FontSymbols.RELIGION_CHAR,
				'star' : FontSymbols.STAR_CHAR,
				'silver star' : FontSymbols.SILVER_STAR_CHAR,
				'trade' : FontSymbols.TRADE_CHAR,
				'defense' : FontSymbols.DEFENSE_CHAR,
				'greatpeople' : FontSymbols.GREAT_PEOPLE_CHAR,
				'badgold' : FontSymbols.BAD_GOLD_CHAR,
				'badfood' : FontSymbols.BAD_FOOD_CHAR,
				'eatenfood' : FontSymbols.EATEN_FOOD_CHAR,
				'goldenage' : FontSymbols.GOLDEN_AGE_CHAR,
				'angrypop' : FontSymbols.ANGRY_POP_CHAR,
				'openBorders' : FontSymbols.OPEN_BORDERS_CHAR,
				'defensivePact' : FontSymbols.DEFENSIVE_PACT_CHAR,
				'map' : FontSymbols.MAP_CHAR,
				'occupation' : FontSymbols.OCCUPATION_CHAR,
				'power' : FontSymbols.POWER_CHAR,
				}
It follows the order of the GameFont.tga file.

There isn't one really good for it but I took the MAP_CHAR instead, like "raze the city and return it to the earth"...
 
Not if your just taking over the city to do just this, MORE :gold: then abandon/raze.:p

That means there are additional codes which give u $$$ for dismantling buildings in the city.
Which I do not really agree, why do you get gold for destroying buildings?
More likely you ought to pay for dismantling as well as restoration fees in real life.
 
That means there are additional codes which give u $$$ for dismantling buildings in the city.
Which I do not really agree, why do you get gold for destroying buildings?
More likely you ought to pay for dismantling as well as restoration fees in real life.

You are not dismantling them you are selling them to private enterprise. It is how it worked in Civ III. Yes, I worked on the old Abandon City mod.
 
Ah I see, I only noticed the old Building Demolition mod but that requires users to press certain keys.

Reading the Abandon City thread, it seems that you still have to press keys though, so I simply make it simpler for users with a button.

With regards to buildings, I agree stuff like Hospital, Public Transportation and University can be privatised.
But some like Banks.... most of them are private sector in the first place.

Also, when you privatised something, that building is still present in the city and still provides the same benefits.
Which, is not what you are doing when you "remove" it from the city.
 
With regards to buildings, I agree stuff like Hospital, Public Transportation and University can be privatised.
But some like Banks.... most of them are private sector in the first place.

Also, when you privatised something, that building is still present in the city and still provides the same benefits.
Which, is not what you are doing when you "remove" it from the city.

Dont get too technical on this, its really just getting more :gold: rather than less when razed is all, gameplay wise. (I guess):crazyeye:
In the Abandon City mod you cant abandon all buildings anyways, just certain ones to being with is all.
 
I read the original Demolish thread and know there is a demolish building function which also requires certain keys to bring up a pop up.

I tried to implement it by directly clicking on the building itself in the building list but has yet to succeed, which is why I release this first since this part is easy.

Reading the Abandon thread, it seems that the pop up leads to OOS?

Edit:
Anyway, I redid the x and y co-ordinates of the button according to the "<" and ">" buttons this time.
Hopefully it works in all screens now.
 
I read the original Demolish thread and know there is a demolish building function which also requires certain keys to bring up a pop up.

I tried to implement it by directly clicking on the building itself in the building list but has yet to succeed, which is why I release this first since this part is easy.

Reading the Abandon thread, it seems that the pop up leads to OOS?

Edit:
Anyway, I redid the x and y co-ordinates of the button according to the "<" and ">" buttons this time.
Hopefully it works in all screens now.

You could be right, C2C Team re-did the Abandon Mod just like most stuff in CFC, to make it better because of stuff like that, sorry. But anyways thx for at least listening!! I like almost all of your stuff, and if i only had my choice, i'd put it ALL in C2C!! But again its a TEAM! Besides DH would JUMP all over me! :lol:
 
Yeah, c2c has alot of experienced coders and I guess some of the problems of the original mod should have been solved. :)
But nobody will want to download c2c just to extract the codes for their own mod, so I make it simple for them.

Anyway, demolish I agree but privatise I disagree :)
I will still try to see if it is possible to implement directly without a pop up
Adding a demolish all is simple enough, just need to decide location.

Only difference between demolish and privatise is just one line of code to give gold though
 
Yeah, c2c has alot of experienced coders and I guess some of the problems of the original mod should have been solved. :)
But nobody will want to download c2c just to extract the codes for their own mod, so I make it simple for them.

OK, YOU got me there :p But again thx for supporting this great community!! Especially Civ IV:goodjob:
 
Top Bottom