Mod Nukes... to destroy cities?

...because you could actually kill off the WHOLE world in one turn if you had enough nukes :P

Just like in the real world... :sad:
 
Another thought on this is that it is more realistic that a nuke could wipe out a whole city in one turn then, say a single warrior who raizes a city :)
 
I'm asuming this is for warlords or BTS as the text you said to replace doesn't exist in the vanilla file. If this is the case could you possibly find a way to get it to work on vannila.

Good job on the modding though
 
Ok, I have wiped somthing up. Sorry it took so long.
Now inorder do this you need the CvEventManager.py file (or a custem event manager) and find the onNukeExplosion function. This function looks like:
Code:
	def onNukeExplosion(self, argsList):
		'Nuke Explosion'
		pPlot, pNukeUnit = argsList

		CvUtil.pyPrint('Nuke detonated at %d, %d'
			%(pPlot.getX(), pPlot.getY()))
Now you need to change the code to look like this:
Code:
	def onNukeExplosion(self, argsList):
		'Nuke Explosion'
		pPlot, pNukeUnit = argsList
		## Begin Change ##
		if pPlot.isCity():
			CyInterface().addMessage(pPlot.getPlotCity().getOwner(), False, 25, "%s has been destroyed by %s's Nuke!" %(pPlot.getPlotCity().getName(), gc.getPlayer(pNukeUnit.getOwner()).getName()), '', 2, "", 7, pPlot.getX(), pPlot.getY(), False, False)	## A message to the city's owner
			pPlot.getPlotCity().kill()		## Kill the city
		## End Change ##

		CvUtil.pyPrint('Nuke detonated at %d, %d'
			%(pPlot.getX(), pPlot.getY()))
Hope this helps. :thumbsup:

I tried this in my Beyond the Sword Python folder and it didn't work. I put in everything and I started up a quick game, got a nuke from World Builder in order to test it out and the city was not razed. I don't know if maybe I messed up the spacing or what happened.
 
To add more destruction, just have a look in my "Spain 1936" Mod : I use a python eventManager for barbarian Trapped cities.

In my game, it's used to destroy barbarian cities when players want to catch them (I don't want any new city for my civs). But it can be used for something else...

It destroys the city, and makes damages to the units near the city. If you're interested, you're free to use it, transform (to add problems on the tiles for exemple), etc.......

I'll upload it as a mod comp soon, but you can find it now in the Mod.
 
I don't think that one needs to be enabled Zebra, the python callback is in the SDK with no check to see if it's enabled via that XML file you're referring to. For example, the SDK method for canMoveInto() has this in it:
Code:
	if (GC.getUSE_UNIT_CANNOT_MOVE_INTO_CALLBACK())
	{
		// Python Override
However most functions that have callbacks available don't have that check in them, just a reference right to the python interface, or essentially always enabled. It's not very consistent :)

As for the nukes, I've made them pretty brutal in my mod so if you want to have a bit of fun turning the world into a smoldering ball of radioactive waste follow the link in my sig.
 
I know that it is very irregular, I'm just not sure which ones are disabled via the XML so it is always a good idea to check.
 
Back
Top Bottom