Aneurism
Aug 13, 2007, 09:32 AM
I would like ICBMs to have the same affect as razing a city, leaving nothing but ruins. Is this possible?
|
View Full Version : Mod Nukes... to destroy cities? Aneurism Aug 13, 2007, 09:32 AM I would like ICBMs to have the same affect as razing a city, leaving nothing but ruins. Is this possible? Zebra 9 Aug 13, 2007, 10:50 AM Yes, it will require python. But it won't be hard to do. I'll see what I can wip up. :D Aneurism Aug 13, 2007, 12:51 PM Yes, it will require python. But it won't be hard to do. I'll see what I can wip up. :D That would be really cool! Thanks! :D Zebra 9 Aug 23, 2007, 07:18 PM 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: 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: def onNukeExplosion(self, argsList): 'Nuke Explosion' pPlot, pNukeUnit = argsList ## Begin Change ## if pPlot.isCity(): CyInterface().addMessage(pPlot.getPlotCity().getOw ner(), 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: Aneurism Aug 24, 2007, 07:52 AM Thanks Zebra that is AWESOME!! :D :D :goodjob: :cool: Gaius Octavius Aug 24, 2007, 10:37 AM INGSOC (Intercontinental Nukes are Going Simply to Obliterate the City) IT'S DOUBLE-PLUS GOOD! :D I have wanted something like this for a long time--simple, easy to use, easy to change. I presume you could even add an extra python check to see if the city is a certain size. That way, you could have it obliterate the city only if it's below a specific population. :thumbsup: Zebra 9 Aug 24, 2007, 03:27 PM def onNukeExplosion(self, argsList): 'Nuke Explosion' pPlot, pNukeUnit = argsList ## Begin Change ## if pPlot.isCity(): if pPlot.getPlotCity().getPopulation() <= 5: CyInterface().addMessage(pPlot.getPlotCity().getOw ner(), 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 else: pPlot.getPlotCity().setPopulation(pPlot.getPlotCit y().getPopulation() - 5) ## Can't remember if cities have a change pop function ## End Change ## CvUtil.pyPrint('Nuke detonated at %d, %d' %(pPlot.getX(), pPlot.getY()))This would cause all cities with 5 or less population to be destroyed. And any other city would lose 5 pop. Gaius Octavius Aug 26, 2007, 06:22 PM Ha ha! Well, that wasn't really a request, but thanks anyway. I foresee lots of use. :thumbsup: meatwad4289 Aug 27, 2007, 02:49 PM wow thats neat, kinda overpowered though. I mean definitely a reason to rush nukes, and then Attack everyone, but once someone else has it... I think nuking would be a abd idea. Jay Aug 28, 2007, 11:53 AM perhaps counter this by making nukes a national unit: limit 3 or something because you could actually kill off the WHOLE world in one turn if you had enough nukes :P jpinard Aug 28, 2007, 12:58 PM perhaps counter this by making nukes a national unit: limit 3 or something because you could actually kill off the WHOLE world in one turn if you had enough nukes :P Or better yet, make them super expensive. ArneHD Aug 28, 2007, 01:17 PM Or a better idea, MAD, and serious diplomatic penalties for using nukes, as in the real world. Someone made MAD possible, I have no idea what the mod was called though. Gaius Octavius Aug 28, 2007, 05:07 PM If you used this, I imagine you'd want "require complete kills" on by default, as that makes more sense in a MAD-type situation. That way it would not be overpowered. meatwad4289 Aug 28, 2007, 11:53 PM I'd say make it so 1 nuke hurts troops and destroys improvents(same as now) next nuke does the same, and might kill off weaker ones, 3rd one is death to all units, 4th one removes 5 population(kills city if theres only 5) 5th one kills city. Each nuke drains culture border. This means inorder to eliminate the world you need 4 to 5 nukes for each City, the average civ has usually 20 cities, that means to wipe out a single civ you would need atleast 90 Nukes for each civ.. Still possible to build up a few hundred nukes and launch them at once, but if you do it before your cities are done makign improvements, you'll hurt your own empire by switching everythign to nuke production. Your Army wont grow, and your enemies will. You'll have more nukes, but using nukes on large scale means the world will hate you, And if you wait for your attack til after your cities are done improving and you have a stead ystream of military troops coming out so you switch some to Nukes, then your enemy will have the SDI and the bomb shelters planes, ect lowering your chance of success of nuking the world. So you need to build atleast 3x as many and have half of that as Tactical. This means your going to have to have about 270 for each civ you attack. So this would severly limit the ability of Nuking the world out. rylu Aug 29, 2007, 02:51 AM I've made the changes to make nukes more destructive in C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\Python\CvEventManager.py but it still work let me nuke raze cities under pop 5. Anyone got this change to work? Zebra 9 Aug 29, 2007, 02:50 PM Works for me. Upload the changed file and I'll have a look at it. I'll get that fancier (and IMNVHO better idea) nuke system working tomorrow. :D jpinard Aug 29, 2007, 09:42 PM I like meatwad's idea, but I think it should only be 4 nukes for total city immolation. BTW, how does the second script change zebra made influenced by SDI or shelters? Does it over-ride shelter settings? rylu Aug 29, 2007, 11:15 PM Thanks. Here is the file.... http://forums.civfanatics.com/uploads/108172/CvEventManager.zip jpinard Aug 30, 2007, 12:14 AM Thanks. Here is the file.... http://forums.civfanatics.com/uploads/108172/CvEventManager.zip See if it works with the correct spacing and alignment (here's a fixed version)... rylu Aug 30, 2007, 07:01 AM Thanks, works perfectly. Nuke wars are much more interesting now. Aneurism Sep 24, 2007, 01:09 PM ...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: Aneurism Sep 24, 2007, 01:14 PM 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 :) jpinard Sep 24, 2007, 06:21 PM Zebra - were you going to do more with this? Zebra 9 Sep 28, 2007, 03:32 PM Sorry, I'm too busy, but when I get time I will make a ton of uploads (hope my dial up can handle it). Badhron Dec 07, 2007, 08:45 PM 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 maynardsthirdey Dec 17, 2007, 11:09 PM 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: 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: def onNukeExplosion(self, argsList): 'Nuke Explosion' pPlot, pNukeUnit = argsList ## Begin Change ## if pPlot.isCity(): CyInterface().addMessage(pPlot.getPlotCity().getOw ner(), 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. Fabrysse Dec 18, 2007, 02:51 AM To add more destruction, just have a look in my "Spain 1936" Mod (http://forums.civfanatics.com/showthread.php?t=191582) : 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. Zebra 9 Dec 21, 2007, 03:55 PM Did you enable the onNukeExplosion event in the xml file (I forget what its called)? Seven05 Dec 21, 2007, 08:54 PM 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: 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. Zebra 9 Dec 27, 2007, 08:36 AM 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. |
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.