Need help with Arcology Shielding graphics bug

justinian66

Chieftain
Joined
Jul 22, 2010
Messages
70
In some of the various mods ive been playing i've been having some graphics issues with the Arcology->Arcology Shielding->Deflector Shielding. In the original "Next War" Mod the Arcology graphics and building are replaced with the Arcology Shielding building and graphics and so forth when you upgrade to Deflector Shielding. Now in the most mods ive been playing with, such as the Neoteric Mod for example, the building and graphics remain in/on the city even after upgrading. Basicly i end up with the Arcology on top (which is HUGE) and then the Arcology Shielding under that, and then the deflector shielding underneath that one. All three are there instead of only the current upgrade just taking the place of the previous building.

Does anyone know how to fix this problem? Is it a problem with the XML BuildingInfo or BuidlingSchema files? The ArtDefines_Building File? Or is it something to do with Python files (which i am less familiar with)? A link to a tutorial or another thread dealing with this issue would be greatly appreciated.
 
Short explanation first:
In Next War, you don't see the older versions of the arcology, because they are destroyed via python if you build a better version, and that you then can't build the older version.


Okay, where to go:
In Next War, in Python\CvGameUtils, this section here is important:
PHP:
	def cannotConstruct(self,argsList):
		pCity = argsList[0]
		eBuilding = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
###this is new - start		
		# player can't build an arcology if they have shielding or advanced shielding
		if eBuilding == gc.getInfoTypeForString("BUILDING_ARCOLOGY"):
			if pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_ARCOLOGY_SHIELDING")) or pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_DEFLECTOR_SHIELDING")):
				return True
		
		# player can't build shielding if they have advanced
		if eBuilding == gc.getInfoTypeForString("BUILDING_ARCOLOGY_SHIELDING"):
			if pCity.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_DEFLECTOR_SHIELDING")):
				return True
###this is new - end
		return False

in Python\CvEventManager, this part is important:
PHP:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer()) and isWorldWonderClass(gc.getBuildingInfo(iBuildingType).getBuildingClassType())):
			# If this is a wonder...
			popupInfo = CyPopupInfo()
			popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
			popupInfo.setData1(iBuildingType)
			popupInfo.setData2(pCity.getID())
			popupInfo.setData3(0)
			popupInfo.setText(u"showWonderMovie")
			popupInfo.addPopup(pCity.getOwner())

		CvAdvisorUtils.buildingBuiltFeats(pCity, iBuildingType)
###this is new - start		
		if iBuildingType == CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY_SHIELDING"):
			pCity.setNumRealBuilding(CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY"), False)
		elif iBuildingType == CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_DEFLECTOR_SHIELDING"):
			pCity.setNumRealBuilding(CvUtil.findInfoTypeNum(gc.getBuildingInfo, gc.getNumBuildingInfos(), "BUILDING_ARCOLOGY_SHIELDING"), False)
###this is new - end
		if (not self.__LOG_BUILDING):
			return
		CvUtil.pyPrint('%s was finished by Player %d Civilization %s' 
			%(PyInfo.BuildingInfo(iBuildingType).getDescription(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDescription(0)))



If you now go to these files in the mods you have, and you search for the lines with "def" in it, you will find some variations of this - paste the code between "this is new - start" and " - end" to these files (including every white space, no kidding, do that) to the same section where they are here.
Then save, and try it out in your mod.

Attention: Make a copy of the files before.

-------------------

In My Documents\My Games\BtS\Civilization4.ini, please activate the python exceptions. This will help, if something went wrong.
 
Thank, The_J. I've solved the graphics issue, but i am still able to build the lower tier buildings after building the higher ones. So now I'm suffering the complaints of cities who demand an arcology to be built even when they have the deflector shielding :(.

As i said in the previous post, i'm currently working on the Neoteric mod. When i went into the python directory to look for the "CvGameUtils" file, there wasnt anyone with that name, or any that looked to have any similar contents to it after opening up both files. So i just copied the file from the original Next War mod into the Neoteric mod. I ended up with an error popup at the begining of my games stating:

“Error in GameStart event handler <bound method AIAutoPlay.onGameStart of <AIAutoPlay.AiAutoPlay instance at 0x3AF94828>>”
“Error in GameStart event handler <vound method RevolutionInit.onGameStart of <RevoultionInit.RevolutionInit instance at 0x3B0270D0>>”

This only started popping up after i copied the file over from the Next War mod so I'm pretty sure its that file thats causing the problem. And like i said earlier, im still verrrrry inexperienced when it comes to Python manipulation (though im trying to learn as i go), so some pointers on how to fix this problem would be very much appreciated.

Thanks
 
Thank, The_J. I've solved the graphics issue, but i am still able to build the lower tier buildings after building the higher ones. So now I'm suffering the complaints of cities who demand an arcology to be built even when they have the deflector shielding :(.

Oh, forgot that:
In Assets\XML\PythonCallbackDefines.xml, you have to change:
PHP:
	<Define>
		<DefineName>USE_CANNOT_CONSTRUCT_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>

to 1.

“Error in GameStart event handler <bound method AIAutoPlay.onGameStart of etc

That's because the mod you work with is based on BUG, and BUG has a special way how to handle python.
A tutorial how to do BUG python right can be found here.
 
Thank you again, The_J. That solved the problem.

However, I'm still getting those error messages at the begining of the game. I understand that it has to do with the BUG mod, but i havent seen any noticeable side affects and I am content with how the game is running as it is now. Should I, however, expect anything bad to come about if I dont solve that particular problem?
 
Some functions could not work, but this depends on the setup :dunno:.
Can't be more specific. If you don't want to fix it at the moment, then you should just look around if any function doesn't work. I don't think so, because BUG has no other functions tied to the one you've added, but you never know.
 
Top Bottom