Quick Modding Questions Thread

When I settle on forests/flood plains the forest/flood plain disappears. Is there a way to change it so they stay on the city plot?
 
In Python\CvGameUtils.py, change
PHP:
	def citiesDestroyFeatures(self,argsList):
		iX, iY= argsList
		return True

to
PHP:
	def citiesDestroyFeatures(self,argsList):
		iX, iY= argsList
		return False

Attention: The number of whitespaces before the beginnings of the lines do matter here, so don't mess with them.
 
Thanks The J.

How about if I wanted cities to destroy forests only but not flood plains?
 
Code:
    def citiesDestroyFeatures(self,argsList):
        iX, iY= argsList
	pPlot = CyMap().plot(iX, iY)
	eFeature = pPlot.getFeatureType()
	eFloodPlains = gc.getInforTypeForString("FEATURE_FLOOD_PLAINS")
	return eFeature != eFloodPlains
Or just:
Code:
    def citiesDestroyFeatures(self,argsList):
	return CyMap().plot(*argsList).getFeatureType() != gc.getInforTypeForString("FEATURE_FLOOD_PLAINS")
 
Interesting that #1 works :think:. I guess i'm still not really in python.
What seems... interesting about it? :confused: I never tested it so unless someone does I wouldn't state that it works... :blush:
 
Looking at modding The Internet but I notice that Projects are very limited in their functions. Are Projects only referenced from Civ4ProjectInfo.xml? You can't reference Projects from Buildings, Units, Events or anything else?
 
XML in itself is limited, because it only consists of game settings. If you wanna go beyond simply changing settings you need to re-program the game. So it would be possible to do whatever you want with, say, Projects.

So, what do you propose to do with The Internet?
 
It could be added that there is a projectBuilt call from the SDK to the CvEventManager Python module. This means that you can intersect the game at this juncture any time a project has been completed in the game, and run whatever code you want. It is also possible to use the beginGameTurn callup to have some code executed on any consecutive game turn.

This means that it is quite possible to script your own effects for, say, the Internet Project. Give a holler if you need code.
 
It could be added that there is a projectBuilt call from the SDK to the CvEventManager Python module. This means that you can intersect the game at this juncture any time a project has been completed in the game, and run whatever code you want. It is also possible to use the beginGameTurn callup to have some code executed on any consecutive game turn.

This means that it is quite possible to script your own effects for, say, the Internet Project. Give a holler if you need code.

No thanks, don't want to put that much effort into. Just wanted to make The Internet a little more attractive to build (and Computers is a pretty sucky technology to boot). I've been tweaking other Wonders (i.e. Chichen Itza) and buildings and was just surprised about the Projects being hard to mod.

I'm going to move the Laboratory from Superconductors to Computers - perhaps reduce the cost of the Project. Adding a Modern Carrier at Superconductors, etc...
 
But... but... programming is fun!
 
OK, one for the experts. I'm designing a Particle Accelerator National Wonder at Superconductors (with Fission). It costs 1000 Hammers and provides a Great Scientist when it's completed (via an event). Is this worthwhile or should I reduce the hammer cost? Is this only a net gain in 500 beakers (since GS provides ~1500 beakers)?
 
Hmm... Good idea for a NW anyway.
 
OK, real simple question here:
What XML file/line controls when a resource is rendered obsolete (such as fur, Ivory).
I would think it would be in the tech info, but I couldn't find it.
I would like to make coal obsolete when fusion is researched (coal/shale plants will also obsolete, it will be paired with a rather cheap fusion reactor building becoming available).
I'd also like to make a synthetic fuel factory, producing the bonus "Synthetic_Fuel" for that city, requiring a fusion powerplant to build, with oil becoming completely obsolete by future tech (all oil requiring units will also be able to be built with Synthetic_Fuel).
 
What XML file/line controls when a resource is rendered obsolete (such as fur, Ivory).
TechObsolete in Civ4BonusInfos.XML.
I would like to make coal obsolete when fusion is researched (coal/shale plants will also obsolete, it will be paired with a rather cheap fusion reactor building becoming available).
I'd also like to make a synthetic fuel factory, producing the bonus "Synthetic_Fuel" for that city, requiring a fusion powerplant to build, with oil becoming completely obsolete by future tech (all oil requiring units will also be able to be built with Synthetic_Fuel).
This might be possible within the confines of the XML. Someone else would have to figure this out for you however... :p
 
Hmm, I only see that file (Bonus Info) in the warlords, and vanilla folders, I don't see a BTS specific one.
Is there any difference between the warlords and vanilla files?
(ie, which bonus info should I start with)
 
Firstly, you don't edit the game files. At all. Instead, you put edited copies of the files in CustomAssets (or something) and load them modularly.

Secondly, always edit the most current version of any XML file (Vanilla -> Warlords -> BtS).

The reason there is no BtS specific version of the Civ4BonusInfos.XML file is that the specifics of bonuses didn't change from Warlords. So the game will load the Warlords file by default. Unless you load another file, that is.
 
Back
Top Bottom