Quick Modding Questions Thread

Should have thought of that myself :wallbash:.
Okay, that's not a problem:
PHP:
	def onCityBuilt(self, argsList):
		'City Built'
		city = argsList[0]
###remove feature, unless feature = X and civ = Y start
		pPlayer = gc.getPlayer(city.getOwner())
		pPlot = CyMap().plot(city.getX(),city.getY())
		if not ((pPlayer.getCivilizationType () == gc.getInfoTypeForString("CIVILIZATION_WHATEVER")) and pPlot.getFeatureType()==gc.getInfoTypeForString("FEATURE_JUNGLE")):
                        pPlot.setFeatureType(-1,0)
###remove feature, unless feature = X and civ = Y end	
		if (city.getOwner() == gc.getGame().getActivePlayer()):
			self.__eventEditCityNameBegin(city, False)	
		CvUtil.pyPrint('City Built Event: %s' %(city.getName()))


oh, and don't forget to activate Python exceptions, else we could easily miss something.
 
Ok guys, I am in trouble now :(

Apparently all the time I was working on my mod, I had vanilla BTS 3.0.9 (off the disks).

Yesterday I have updated to 3.19 and my mod have stopped working :(

The base game works.

My mod only contains changes to XML files - like units, techs, so I assume in the base game something has changed somewhere in schema files (maybe?) so my edited xmls are no longer compatible...

Could you advise how to battle this problem and identify what needs to be changed in my mod to get it working again.

thank you!
 
Could you advise how to battle this problem and identify what needs to be changed in my mod to get it working again.

My suggestion:

Open an XML file from your mod and the same XML file from BtS 3.19 side by side. Scroll down and compare the first entry in each (like from the first <UnitInfo> to the matching </UnitInfo>), not for the values in the tags but to compare the tags themselves to see if any were added (I don't think any were removed).

You could do this for each file you changed. On the other hand, you might start with the file that it initially complains about failing to load. When it fails to load a file there ought to be a pop-up message that includes the file name. Even if you have clicked through and seen multiple file names mentioned, it is possible that it is just one file but having that one fail to load messes up later files since the things that were supposed to be defined in the first one were not. After you fix that one, try to run the mod again and see what file, if any, it mentions first and fix that one. And so on.

Notepad++ can open files side by side and lock the scrolling (which you can do after you get the two files lined up, if there are a different number of comments before the actual data), which may make it easier.
 
Code:
	def citiesDestroyFeatures(self,argsList):
		iX, iY= argsList
##
		pPlot = CyMap().plot(iX, iY)
		pPlayer = gc.getPlayer(pPlot.getOwner())
		if pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_MONGOLIA") and pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_JUNGLE"):
			return False
##
Done and Tested
 
no need to add a "else return True".
Because there is already a return True in the default codes, I just didn't include it in the copy and paste.
 
my mod is loading again, but I do get bunch of errors on replaced buildings like:
"Bank - replaced by TXT_KEY_REPLACED_BY_BUILDING"

I guess they added something in some file my mod doesn't have.

any recommendations how to get those fixed? :)

The latest patch added some more text to the civilopedia. In earlier versions you did not see in the entries of UUs and UBs which unit/building they replace.
I guess the text string TXT_KEY_REPLACED_BY_BUILDING is not present in your mod, because you have one of the text XMLs in it, which got updated by the latest patch. -> you might want to check if the default BtS text XMLs got updated (just take a look at the date of the latest access), and see if you have to copy over some stuff.
 
yeah, I sort of figured this out last night - I started comparing xml files in my mod and started deleting those that I have never modified, so the mod would read BTS files. I haven't exactly figured out which xml file handles the replaced building entries, but after few deleted files I got it working ;)

thank you again for help!
 
more questions today :)

I have all 3 civ parts installed - Civ4, Warlords and BTS.
But I can't find the Warlord mods/scenarious that came with it (China Unification? Chengiz Khan?).

I see original mods like Greek World (which apperently no longer work?) and BTS mods, but can't seem to locate Warlords mods

any suggestions?

thank you!
 
@ChaosSlayer
They're located in Civilization 4/Warlords/Mods folder. In order to play them, you have to launch Warlords, not BTS. Likewise, use vanilla Civ4 to play the Greek World.
 
hmm, well the problem is that I don't have "mods" folder in my Warlords folder... :confused:

Are you looking in My Documents/My Games, or your installation folder? It's in the latter. Also, you can use Windows Search (Win+F) to look for "Chinese Unification".
 
Back
Top Bottom