Planetbuster-Rocket

The_J

Say No 2 Net Validations
Administrator
Supporter
Joined
Oct 22, 2008
Messages
42,149
Location
DE/NL/FR
The Planetbuster-Rocket, it'll destroy really all in it's catchement area :).
DOWNLOAD

attachment.php


attachment.php


attachment.php


DOWNLOAD

Uses the ICBM-modell.
Code is from Tsentom1 (his Eden Project), also got much help from him :).
Couldn't have done it without him :).
Also credits to EmperorFool, for his advice :).

Can be used as it comes as a stand-alone-mod.
AI will use it like an ICBM, not like a special unit.


Feel free to use it :), but give me and tsentom1 credit :D.


For modders:
I've added the planetbuster-unitclass and unit at the end of the unitclassinfos.xml and unitinfos.xml
In the CvEventManager.py i've added with tsentom's help this:
Spoiler :

Code:
	def onNukeExplosion(self, argsList):
		'Nuke Explosion'
		pPlot, pNukeUnit = argsList
		CvUtil.pyPrint('Nuke detonated at %d, %d'
			%(pPlot.getX(), pPlot.getY()))
###Planetbusterbegin###		
		if (pNukeUnit is not None and pNukeUnit.getUnitType() == gc.getInfoTypeForString('UNIT_PLANETBUSTER')):

                        
                        iX = pPlot.getX()
                        iY = pPlot.getY()

			for iXLoop in range(iX - 1, iX + 2, 1):
				for iYLoop in range(iY - 1, iY + 2, 1):
						pPlot = CyMap().plot(iXLoop, iYLoop)
						if (( pPlot.isPeak()==true  ) or (pPlot.isHills()==true)):
							pPlot.setPlotType(PlotTypes.PLOT_LAND, True, True)
 						pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_COAST" ), 1, 1)
###Planetbusterend###

Should be simpel to understand. If not, ask me or tsentom :).
 

Attachments

  • planetbreaker1.JPG
    planetbreaker1.JPG
    159.9 KB · Views: 12,398
  • planetbreaker2.JPG
    planetbreaker2.JPG
    149.1 KB · Views: 12,412
  • planetbreaker3.JPG
    planetbreaker3.JPG
    142.4 KB · Views: 12,319
What do you mean?
The terraforming? -> Yes.
Total destruction? -> No.
The destruction is caused throught the change to water, because the units/improvements/cities can't exist on water.

If you look at the Eden-Project, you can see it better, what can be done with terraforming, the code is more detailed.
 
Sorry bout that. My comp crashed and i didn't see that i had already posted.
 
awesome modcomnt!!!!

both of the releases,

Thanks :).

i hope to see more!!

:)

If i have time, and a idea, what could fit good into my mod, i'll try to do it :).
At the moment a can not really program python, i "steal" the code every time, but my skills are becoming better :).
 
What do you mean?
The terraforming? -> Yes.
Total destruction? -> No.
The destruction is caused throught the change to water, because the units/improvements/cities can't exist on water.

Could you change everything to water (thereby kiling the units) and then to desert to overcome that issue ?
 
Could you change everything to water (thereby kiling the units) and then to desert to overcome that issue ?

I've thought about it, i think, it'll work, but haven't tested it.
Just adding
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_DESERT" ), 1, 1) after the last line will do it.
 
I've thought about it, i think, it'll work, but haven't tested it.
Just adding
pPlot.setTerrainType(gc.getInfoTypeForString( "TERRAIN_DESERT" ), 1, 1) after the last line will do it.

Sweet!
The only problem i saw with this unit was that it made water. It would be so easy to exploit it, by isolating the AI, making more cities coastal, and since the AI doesn't do trans-ocean warfare, :nuke:ing areas to make yourself an island. But if it makes desert, who would do that to themselves?
 
Hi friends,

i need some help with this Planetbuster script and hope someone can assist.
The J - has stop to work in case of his private life, i wish him all best !

J adjust me the script for my antimatter bomb some time ago and i find some bugs now.
http://forums.civfanatics.com/downloads.php?do=file&id=11673

This is the current script:

Code:
###Planetbreakerbegin###		
		if (pNukeUnit is not None and pNukeUnit.getUnitType() == gc.getInfoTypeForString('UNIT_ANTIMATTER_BOMB')):                       
                        iX = pPlot.getX()
                        iY = pPlot.getY()

			for iXLoop in range(iX - 1, iX + 2, 1):
				for iYLoop in range(iY - 1, iY + 2, 1):
						pPlot = CyMap().plot(iXLoop, iYLoop)
						pPlot.setImprovementType(-1)
						pPlot.setRouteType(-1)
						iFeature = pPlot.getFeatureType()
						if iFeature == gc.getInfoTypeForString("FEATURE_FALLOUT"):
                                                        pPlot.setFeatureType(-1,-1)
						for i in range(pPlot.getNumUnits (),-1,-1):
                                                        pUnit = pPlot.getUnit(i)
                                                        pUnit.kill(False,pUnit.getOwner())
                                                if pPlot.isCity():
                                                        pCity = pPlot.getPlotCity ()
                                                        gc.getPlayer(pCity.getOwner()).raze(pCity)
###Planetbreakerend###

It is working the way i like but there is one issue.
As soon as a city has a city cuture the nuke is unable to destroy it !
I test it with a blank map. Citys with count of 30 will razed simple. But if i add an culture of 100 for exampe the first nuke will set the City count to 12
next nuke to 7 than 5, 3, 1. Iam unable to destroy the city it will remain count 1.
Can somebody help me to fix this maybe ?

Cheers!
xas
 
Try replacing the last line with
Code:
pCity.kill()
 
HI platyping,

is it really so simple ????
I try this:

Code:
                                                if pPlot.isCity():
                                                        pCity = pPlot.getPlotCity ()
                                                        pCity.kill()
###Planetbreakerend###

And it is working :crazyeye:
I will run a few more tests this evening and will reply here

Cheers man !!!
 
YES - this seems to be working fine. Exactly what i wanted

Many Thanks platyping :goodjob:
 
Back
Top Bottom