Error Messages

strategyonly

C2C Supreme Commander
Joined
Mar 13, 2006
Messages
20,999
Location
MN
Does anyone know what these are, and mainly how to FIX them?

Traceback (most recent call last):

File "CvWBInterface", line 271, in applyInitialItems

File "CvWBDesc", line 1720, in applyInitialItems

File "CvWBDesc", line 1152, in applyCity

File "CvWBDesc", line 900, in apply

RuntimeError: unidentifiable C++ exception
ERR: Python function applyInitialItems failed, module CvWBInterface



Traceback (most recent call last):

File "BugUtil", line 692, in <lambda>

File "BugEventManager", line 577, in preGameStart

File "CvAppInterface", line 100, in preGameStart

File "CvScreensInterface", line 86, in showTechChooser

File "CvTechChooser", line 241, in interfaceScreen

File "CvTechChooser", line 256, in ConstructTabs

File "CvTechChooser", line 302, in DrawTechChooser

File "CvTechChooser", line 351, in placeTechs

Code:
# BUG - Tech Era Colors - start
			szTechRecordShadow = sPanelWidget + "TechRecordShadow" + str(i)
			iShadowOffset = 9
			screen.attachPanelAt( sPanel, szTechRecordShadow, u"", u"", True, False, PanelStyles.PANEL_STYLE_TECH, iX - 6 + iShadowOffset, iY - 6 + iShadowOffset, self.getXStart() + 6, 12 + ( self.BOX_INCREMENT_HEIGHT * self.PIXEL_INCREMENT ), WidgetTypes.WIDGET_TECH_CHOOSER_ERA, gc.getTechInfo(i).getEra(), -1 )
			[B]self.setTechPanelShadowColor(screen, szTechRecordShadow, gc.getTechInfo(i).getEra())[/B]
			screen.hide( szTechRecordShadow )
# BUG - Tech Era Colors - end


AttributeError: type object 'CvPythonExtensions.WidgetTypes' has no attribute 'WIDGET_TECH_CHOOSER_ERA'
ERR: Python function preGameStart failed, module CvAppInterface
 
The tech chooser widget issue would seem to indicate that you have not got BUG set up correctly for this. Maybe a missing configuration file, or perhaps it is not being loaded in your init.xml file. That widget type is normally defined in the "BUG Advisors.xml" file so that file should be listed in a load tag in init.xml.
 
The tech chooser widget issue would seem to indicate that you have not got BUG set up correctly for this. Maybe a missing configuration file, or perhaps it is not being loaded in your init.xml file. That widget type is normally defined in the "BUG Advisors.xml" file so that file should be listed in a load tag in init.xml.


Can you take a look at this TechChooser i added a few era's Prehistoric, Transhuman, and Galactic: what did i do wrong? Since CFC wont let anyone put attachments here yet???? Note it only takes so many words, so i had to delete alot.


Spoiler :
Code:
			#reset so that it offsets from the tech record's panel
			iX = 6
			iY = 6

			if ( gc.getTeam(gc.getPlayer(self.iCivSelected).getTeam()).isHasTech(i) ):
				screen.setPanelColor(szTechRecord, 85, 150, 87)
				self.aiCurrentState.append(CIV_HAS_TECH)
			elif ( gc.getPlayer(self.iCivSelected).getCurrentResearch() == i ):
				screen.setPanelColor(szTechRecord, 104, 158, 165)
				self.aiCurrentState.append(CIV_IS_RESEARCHING)
			elif ( gc.getPlayer(self.iCivSelected).isResearchingTech(i) ):
				screen.setPanelColor(szTechRecord, 104, 158, 165)
				self.aiCurrentState.append(CIV_IS_RESEARCHING)
			elif ( gc.getPlayer(self.iCivSelected).canEverResearch(i) ):
# Rise of Mankind 2.91 - tech tree colors - start
				if (RoMOpt.isRoMTechTreeColors()):
					# Prehistoric Era
					if ( gc.getTechInfo(i).getEra() == 0 ):
						screen.setPanelColor(szTechRecord, 160, 10, 20)				
					# Ancient Era
					elif ( gc.getTechInfo(i).getEra() == 1 ):
						screen.setPanelColor(szTechRecord, 160, 100, 160)
					# Classical Era
					elif ( gc.getTechInfo(i).getEra() == 2 ):
						screen.setPanelColor(szTechRecord, 160, 100, 100)
					# Medieval Era
					elif ( gc.getTechInfo(i).getEra() == 3 ):
						screen.setPanelColor(szTechRecord, 160, 160, 100)
					# Renaissance Era
					elif ( gc.getTechInfo(i).getEra() == 4 ):
						screen.setPanelColor(szTechRecord, 120, 100, 25)
					# Industrial Era
					elif ( gc.getTechInfo(i).getEra() == 5 ):
						screen.setPanelColor(szTechRecord, 60, 200, 60)
					# Modern Era
					elif ( gc.getTechInfo(i).getEra() == 6 ):
						screen.setPanelColor(szTechRecord, 100, 104, 160)
					# Transhuman Era
					elif ( gc.getTechInfo(i).getEra() == 7 ):
						screen.setPanelColor(szTechRecord, 50, 160, 250)
					# Galactic Era
					elif ( gc.getTechInfo(i).getEra() == 8 ):
						screen.setPanelColor(szTechRecord, 15, 15, 15)
					# Future Era
					else:
						screen.setPanelColor(szTechRecord, 50, 160, 250)
				else:
					screen.setPanelColor(szTechRecord, 100, 104, 160)
# Rise of Mankind 2.91 - tech tree colors - end
				self.aiCurrentState.append(CIV_NO_RESEARCH)
			else:
				screen.setPanelColor(szTechRecord, 206, 65, 69)
				self.aiCurrentState.append(CIV_TECH_AVAILABLE)


				if ( gc.getTeam(gc.getPlayer(self.iCivSelected).getTeam()).isHasTech(i) ):
					screen.setPanelColor(szTechRecord, 85, 150, 87)
				elif ( gc.getPlayer(self.iCivSelected).getCurrentResearch() == i ):
					screen.setPanelColor(szTechRecord, 104, 158, 165)
				elif ( gc.getPlayer(self.iCivSelected).isResearchingTech(i) ):
					screen.setPanelColor(szTechRecord, 104, 158, 165)
				elif ( gc.getPlayer(self.iCivSelected).canEverResearch(i) ):
# Rise of Mankind 2.91 - tech tree colors - start
					if (RoMOpt.isRoMTechTreeColors()):
						# Prehistoric Era
						if ( gc.getTechInfo(i).getEra() == 0 ):
							screen.setPanelColor(szTechRecord, 160, 10, 20)				
					# Ancient Era
						if ( gc.getTechInfo(i).getEra() == 1 ):
							screen.setPanelColor(szTechRecord, 160, 100, 160)
						# Classical Era
						elif ( gc.getTechInfo(i).getEra() == 2 ):
							screen.setPanelColor(szTechRecord, 160, 100, 100)
						# Medieval Era
						elif ( gc.getTechInfo(i).getEra() == 3 ):
							screen.setPanelColor(szTechRecord, 160, 160, 100)
						# Renaissance Era
						elif ( gc.getTechInfo(i).getEra() == 4 ):
							screen.setPanelColor(szTechRecord, 160, 160, 50)
						# Industrial Era
						elif ( gc.getTechInfo(i).getEra() == 5 ):
							screen.setPanelColor(szTechRecord, 60, 200, 60)
						# Modern Era
						elif ( gc.getTechInfo(i).getEra() == 6 ):
							screen.setPanelColor(szTechRecord, 100, 104, 160)
						# Transhuman Era
						elif ( gc.getTechInfo(i).getEra() == 7 ):
							screen.setPanelColor(szTechRecord, 50, 160, 250)
						# Galactic Era
						elif ( gc.getTechInfo(i).getEra() == 8 ):
							screen.setPanelColor(szTechRecord, 15, 15, 15)
						# Future Era
						else:
							screen.setPanelColor(szTechRecord, 50, 160, 250)
							#screen.setPanelColor(szTechRecord, 0, 160, 160)
					else:
						screen.setPanelColor(szTechRecord, 100, 104, 160)
# Rise of Mankind 2.91 - tech tree colors - end
				else:
					screen.setPanelColor(szTechRecord, 206, 65, 69)

# BUG - GP Tech Prefs - start
		self.updateTechPrefs()
# BUG - GP Tech Prefs - end

# BUG - Tech Era Colors - start
	def setTechPanelShadowColor(self, screen, sPanel, iEra):
		szEra = gc.getEraInfo(iEra).getType()
		iColor = ClockOpt.getEraColor(szEra)
		if iColor != -1:
			color = gc.getColorInfo(iColor)
			if color:
				rgb = color.getColor() # NiColorA object
				if rgb:
					screen.setPanelColor(sPanel, int(100 * rgb.r), int(100 * rgb.g), int(100 * rgb.b))
# BUG - Tech Era Colors - end

	# Will draw the arrows
	def drawArrows(self, screen, sPanel, bANDPreReq, bORPreReq):
#		BugUtil.debug("cvTechChooser: drawArrows")

		iLoop = 0

		ARROW_X = ArtFileMgr.getInterfaceArtInfo("ARROW_X").getPath()
		ARROW_Y = ArtFileMgr.getInterfaceArtInfo("ARROW_Y").getPath()
		ARROW_MXMY = ArtFileMgr.getInterfaceArtInfo("ARROW_MXMY").getPath()
		ARROW_XY = ArtFileMgr.getInterfaceArtInfo("ARROW_XY").getPath()
		ARROW_MXY = ArtFileMgr.getInterfaceArtInfo("ARROW_MXY").getPath()
		ARROW_XMY = ArtFileMgr.getInterfaceArtInfo("ARROW_XMY").getPath()
		ARROW_HEAD = ArtFileMgr.getInterfaceArtInfo("ARROW_HEAD").getPath()

		for i in range(gc.getNumTechInfos()):
			bFirst = 1
			fX = (self.BOX_INCREMENT_WIDTH * self.PIXEL_INCREMENT) - 8
			if (not gc.getPlayer(0).canEverResearch(i)) : continue
			if bANDPreReq:
				for j in range( gc.getNUM_AND_TECH_PREREQS() ):
					eTech = gc.getTechInfo(i).getPrereqAndTechs(j)
					if ( eTech > -1 ):
						fX = fX - X_INCREMENT
						iX = 30 + ( (gc.getTechInfo(i).getGridX() - 1) * ( ( self.BOX_INCREMENT_X_SPACING + self.BOX_INCREMENT_WIDTH ) * self.PIXEL_INCREMENT ) )
# Rise of Mankind 2.7 - more techs vertically
#						iY = ( gc.getTechInfo(i).getGridY() - 1 ) * ( self.BOX_INCREMENT_Y_SPACING * self.PIXEL_INCREMENT ) + 5
						iY = ( gc.getTechInfo(i).getGridY() - 1 ) * ( self.BOX_INCREMENT_Y_SPACING * self.PIXEL_INCREMENT )
# Rise of Mankind 2.7 - more techs vertically
						szTechPrereqID = "TechPrereqID" + str((i * 1000) + j)
						screen.addDDSGFCAt( szTechPrereqID, sPanel, gc.getTechInfo(eTech).getButton(), iX + fX, iY + 6, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_HELP_TECH_PREPREQ, eTech, -1, False )

						#szTechPrereqBorderID = "TechPrereqBorderID" + str((i * 1000) + j)
						#screen.addDDSGFCAt( szTechPrereqBorderID, sPanel, ArtFileMgr.getInterfaceArtInfo("TECH_TREE_BUTTON_BORDER").getPath(), iX + fX + 4, iY + 22, 32, 32, WidgetTypes.WIDGET_HELP_TECH_PREPREQ, eTech, -1, False )

			j = 0

			if bORPreReq:
				for j in range( gc.getNUM_OR_TECH_PREREQS() ):
					eTech = gc.getTechInfo(i).getPrereqOrTechs(j)
					if ( eTech > -1 ):
						iX = 24 + ( (gc.getTechInfo(eTech).getGridX() - 1) * ( ( self.BOX_INCREMENT_X_SPACING + self.BOX_INCREMENT_WIDTH ) * self.PIXEL_INCREMENT ) )
						iY = ( gc.getTechInfo(eTech).getGridY() - 1 ) * ( self.BOX_INCREMENT_Y_SPACING * self.PIXEL_INCREMENT ) + 5

						# j is the pre-req, i is the tech...
						xDiff = gc.getTechInfo(i).getGridX() - gc.getTechInfo(eTech).getGridX()
						yDiff = gc.getTechInfo(i).getGridY() - gc.getTechInfo(eTech).getGridY()

# Rise of Mankind - more techs vertically
						if (yDiff == 0):
							screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(3) + 1, self.getWidth(xDiff), 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
							screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(3) + 1, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
						elif (yDiff < 0):
							if ( yDiff == -6 ):
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(1) + 10, self.getWidth(xDiff) / 2, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(1) + 10, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(1) + 8 - self.getHeight(yDiff, 0) + 125, 8, self.getHeight(yDiff, 0) - 8 - 115, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XMY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(1) - self.getHeight(yDiff, 0) + 125, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(1) - self.getHeight(yDiff, 0) + 125, ( self.getWidth(xDiff) / 2 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(1) - self.getHeight(yDiff, 0) + 125, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
							elif ( yDiff == -2 and xDiff == 2 ):
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(2) + 10, self.getWidth(xDiff) * 5 / 6, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XY, iX + self.getXStart() + ( self.getWidth(xDiff) * 5 / 6 ), iY + self.getYStart(2) + 10, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) * 5 / 6 ), iY + self.getYStart(2) + 8 - ( self.getHeight(yDiff, 3) / 2 ) + 15, 8, ( self.getHeight(yDiff, 3) / 2 ) - 8 - 5, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XMY, iX + self.getXStart() + ( self.getWidth(xDiff) * 5 / 6 ), iY + self.getYStart(2) - ( self.getHeight(yDiff, 3) / 2 ) + 15, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) * 5 / 6 ), iY + self.getYStart(2) - ( self.getHeight(yDiff, 3) / 2 ) + 15, ( self.getWidth(xDiff) / 6 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(2) - ( self.getHeight(yDiff, 3) / 2 ) + 15, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
							else:
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(2) - 5, self.getWidth(xDiff) / 2, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(2) - 5, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + ( self.getYStart(2) / 2 ) + 8 - ( self.getHeight(yDiff, 3) / 2 ) + 10, 8, ( self.getHeight(yDiff, 3) / 2 ) - 8 - 10, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_XMY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + ( self.getYStart(2) / 2 ) - ( self.getHeight(yDiff, 3) / 2 ) + 10, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + ( self.getYStart(2) / 2 ) - ( self.getHeight(yDiff, 3) / 2 ) + 10, ( self.getWidth(xDiff) / 2 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + ( self.getYStart(2) / 2 ) - ( self.getHeight(yDiff, 3) / 2 ) + 10, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
						elif (yDiff > 0):
							if ( yDiff == 2 and xDiff == 2):
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(4) * 2 - 15, self.getWidth(xDiff) / 6, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXMY, iX + self.getXStart() + ( self.getWidth(xDiff) / 6 ), iY + self.getYStart(4) * 2 - 15, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) / 6 ), iY + self.getYStart(4) * 2 + 8 - 15, 8, ( self.getHeight(yDiff, 3) / 2 ) - 8 - 30, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXY, iX + self.getXStart() + ( self.getWidth(xDiff) / 6 ), iY + self.getYStart(4) / 2 + ( self.getHeight(yDiff, 3) / 2 ), 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) / 6 ), iY + self.getYStart(4) / 2 + ( self.getHeight(yDiff, 3) / 2 ), ( self.getWidth(xDiff) * 5 / 6 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(4) / 2 + ( self.getHeight(yDiff, 3) / 2 ), 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
							elif ( yDiff == 4 and xDiff == 1):
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(5), self.getWidth(xDiff) / 3, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXMY, iX + self.getXStart() + ( self.getWidth(xDiff) / 3 ), iY + self.getYStart(5), 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) / 3 ), iY + self.getYStart(5) + 8, 8, self.getHeight(yDiff, 0) - 8 - 95, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXY, iX + self.getXStart() + ( self.getWidth(xDiff) / 3 ), iY + self.getYStart(5) + self.getHeight(yDiff, 0) - 100, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) / 3 ), iY + self.getYStart(5) + self.getHeight(yDiff, 0) - 100, ( self.getWidth(xDiff) * 2 / 3 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(5) + self.getHeight(yDiff, 0) - 100, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
							else:
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + self.getXStart(), iY + self.getYStart(4) + 5, self.getWidth(xDiff) / 2, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXMY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(4) + 5, 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_Y, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(4) + 8 + 5, 8, ( self.getHeight(yDiff, 3) / 2 ) - 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_MXY, iX + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(4) + (self.getHeight(yDiff, 3) / 2 ), 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_X, iX + 8 + self.getXStart() + ( self.getWidth(xDiff) / 2 ), iY + self.getYStart(4) + (self.getHeight(yDiff, 3) / 2 ), ( self.getWidth(xDiff) / 2 ) - 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )
								screen.addDDSGFCAt( self.getNextWidgetName("TechArrow"), sPanel, ARROW_HEAD, iX + self.getXStart() + self.getWidth(xDiff), iY + self.getYStart(4) + (self.getHeight(yDiff, 3) / 2 ), 8, 8, WidgetTypes.WIDGET_GENERAL, -1, -1, False )

# Rise of Mankind 2.7 - more techs vertically

		return

# BUG - GP Tech Prefs - start
	def resetTechPrefs (self):
		self.pPrefs = TechPrefs.TechPrefs()
	
	def updateTechPrefs (self):
#		BugUtil.debug("cvTechChooser: updateTechPrefs")

		# If we are the Pitboss, we don't want to put up an interface at all
		if ( CyGame().isPitbossHost() ):
			return

		# These don't seem to be setup when screen is first opened
		if (gc.getNumTechInfos() <= 0 or gc.getNumFlavorTypes() <= 0):
			return

		# Get the screen and player
		screen = self.getScreen()
		pPlayer = gc.getPlayer(self.iCivSelected)

		# Don't show tech prefs during advanced start setup
		if (pPlayer.getAdvancedStartPoints() >= 0):
			return

		# Check to see if option is disabled
		if (not BugOpt.isShowGPTechPrefs()):
			if (self.bPrefsShowing):
				# ... and if so, remove icons if they are currently showing
				screen.hide( "GreatPersonHeading")
				for i, f in enumerate(FLAVORS):
					screen.hide( "GreatPerson" + str(f) )
					screen.hide( "GreatPersonTech" + str(f) )
					screen.hide( "GreatPersonTechNext" + str(f) )
				self.bPrefsShowing = False
			return
		# Always redraw the GP icons because otherwise they are prone to disappearing
		# discover icon heading
		iIconSize = 48
		iX = PREF_ICON_LEFT + 5 * PREF_ICON_SIZE / 4 - iIconSize / 2
		iY = PREF_ICON_TOP - iIconSize - 40
		screen.addDDSGFC( "GreatPersonHeading", ArtFileMgr.getInterfaceArtInfo("DISCOVER_TECHNOLOGY_BUTTON").getPath(), iX, iY, iIconSize, iIconSize, WidgetTypes.WIDGET_GENERAL, -1, -1 )

		for i, f in enumerate(FLAVORS):
			# GP icon
			iUnitClass = gc.getInfoTypeForString(UNIT_CLASSES[i])
			iUnitType = gc.getUnitClassInfo(iUnitClass).getDefaultUnitIndex()
			pUnitInfo = gc.getUnitInfo(iUnitType)
			iX = PREF_ICON_LEFT
			iY = PREF_ICON_TOP + 4 * i * PREF_ICON_SIZE
			screen.addDDSGFC( "GreatPerson" + str(f), pUnitInfo.getButton(), iX, iY, PREF_ICON_SIZE, PREF_ICON_SIZE, WidgetTypes.WIDGET_TECH_PREFS_ALL, f, -1 )
		self.bPrefsShowing = True

		# Remove any techs researched since last call, creating tree if necessary
		if (not self.pPrefs):
			self.resetTechPrefs()
		self.pPrefs.removeKnownTechs()

		# Add all techs in research queue to set of soon-to-be-known techs
		sTechs = set()
		for i in range(gc.getNumTechInfos()):
			if (pPlayer.isResearchingTech(i)):
				sTechs.add(self.pPrefs.getTech(i))

		# Update the buttons to reflect the new tech prefs
		for i, f in enumerate(FLAVORS):
			# GP button
			screen.show( "GreatPerson" + str(f) )

			# Current tech GP will pop
			szButtonName = "GreatPersonTech" + str(f)
			pTech = self.pPrefs.getNextResearchableFlavorTech(f)
			iX = PREF_ICON_LEFT + 3 * PREF_ICON_SIZE / 2
			iY = PREF_ICON_TOP + 4 * i * PREF_ICON_SIZE
			if (pTech):
				screen.addDDSGFC( szButtonName, pTech.getInfo().getButton(), iX, iY, PREF_ICON_SIZE, PREF_ICON_SIZE, WidgetTypes.WIDGET_TECH_PREFS_CURRENT, f, -1 )
			else:
				screen.addDDSGFC( szButtonName, self.NO_TECH_ART, iX, iY, PREF_ICON_SIZE, PREF_ICON_SIZE, WidgetTypes.WIDGET_TECH_PREFS_CURRENT, f, -1 )
			screen.show( szButtonName )

			# Tech GP will pop once selected techs are researched
			szButtonName = "GreatPersonTechNext" + str(f)
			pTech = self.pPrefs.getNextResearchableWithFlavorTech(f, sTechs)
			iX = PREF_ICON_LEFT + 3 * PREF_ICON_SIZE / 2
			iY = PREF_ICON_TOP + 4 * i * PREF_ICON_SIZE + 3 * PREF_ICON_SIZE / 2
			if (pTech):
				screen.addDDSGFC( szButtonName, pTech.getInfo().getButton(), iX, iY, PREF_ICON_SIZE, PREF_ICON_SIZE, WidgetTypes.WIDGET_TECH_PREFS_FUTURE, f, -1 )
			else:
				screen.addDDSGFC( szButtonName, self.NO_TECH_ART, iX, iY, PREF_ICON_SIZE, PREF_ICON_SIZE, WidgetTypes.WIDGET_TECH_PREFS_FUTURE, f, -1 )
			screen.show( szButtonName )
# BUG - GP Tech Prefs - end

	def TechRecord (self, inputClass):
		return 0

	# Clicked the parent?
	def ParentClick (self, inputClass):
		return 0

	def CivDropDown( self, inputClass ):
		if ( inputClass.getNotifyCode() == NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED ):
			screen = self.getScreen()
			iIndex = screen.getSelectedPullDownID("CivDropDown")
			self.iCivSelected = screen.getPullDownData("CivDropDown", iIndex)
			self.updateTechRecords(false)

	# Will handle the input for this screen...
	def handleInput (self, inputClass):
#		BugUtil.debug("cvTechChooser: handleInput")
#		BugUtil.debugInput(inputClass)

		# Get the screen
		screen = self.getScreen()

		szWidgetName = inputClass.getFunctionName() + str(inputClass.getID())

		# Advanced Start Stuff
		pPlayer = gc.getPlayer(self.iCivSelected)
		if (pPlayer.getAdvancedStartPoints() >= 0):
#			BugUtil.debug("cvTechChooser: handleInput - advancedstart")
			# Add tech button
			if (inputClass.getFunctionName() == "AddTechButton"):
				if (pPlayer.getAdvancedStartTechCost(self.m_iSelectedTech, true) != -1):
					CyMessageControl().sendAdvancedStartAction(AdvancedStartActionTypes.ADVANCEDSTARTACTION_TECH, self.iCivSelected, -1, -1, self.m_iSelectedTech, true)	#Action, Player, X, Y, Data, bAdd
					self.m_bTechRecordsDirty = true
					self.m_bSelectedTechDirty = true

			# Tech clicked on
			elif (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
				if (inputClass.getButtonType() == WidgetTypes.WIDGET_TECH_TREE):
					self.m_iSelectedTech = inputClass.getData1()
					self.updateSelectedTech()

		' Calls function mapped in TechChooserInputMap'
		# only get from the map if it has the key
		if ( inputClass.getNotifyCode() == NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED ):
#			BugUtil.debug("cvTechChooser: handleInput - dropdown")
			self.CivDropDown( inputClass )
			return 1

		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
			if szWidgetName == self.sTechSelectTab:
				self.sTechTabID = self.sTechSelectTab
				self.ShowTab()

			elif szWidgetName == self.sTechTradeTab:
				self.sTechTabID = self.sTechTradeTab
				self.ShowTab()



		return 0

	def getNextWidgetName(self, sName):
#		BugUtil.debug("cvTechChooser: getNextWidgetName %i %i", self.nWidgetCount, len(self.sWidgets))
		szName = sName + str(self.nWidgetCount)
		self.nWidgetCount += 1
		self.sWidgets.append(szName)
		return szName

	def deleteWidgets(self):
#		BugUtil.debug("cvTechChooser: deleteWidgets %i %i", self.nWidgetCount, len(self.sWidgets))
		screen = self.getScreen()
		for w in self.sWidgets:
#			BugUtil.debug("cvTechChooser: deleteWidgets '%s'", w)
			screen.deleteWidget(w)

		self.nWidgetCount = 0
		self.sWidgets = []
		return





	def getXStart(self):
		return ( self.BOX_INCREMENT_WIDTH * self.PIXEL_INCREMENT )

	def getXSpacing(self):
		return ( self.BOX_INCREMENT_X_SPACING * self.PIXEL_INCREMENT )

	def getYStart(self, iY):
		return int((((self.BOX_INCREMENT_HEIGHT * self.PIXEL_INCREMENT ) / 6.0) * iY) - self.PIXEL_INCREMENT )

	def getWidth(self, xDiff):
		return ( ( xDiff * self.getXSpacing() ) + ( ( xDiff - 1 ) * self.getXStart() ) )

	def getHeight(self, yDiff, nFactor):
		return ( ( nFactor + ( ( abs( yDiff ) - 1 ) * 6 ) ) * self.PIXEL_INCREMENT )

	def update(self, fDelta):
		if (CyInterface().isDirty(InterfaceDirtyBits.Advanced_Start_DIRTY_BIT)):
			CyInterface().setDirty(InterfaceDirtyBits.Advanced_Start_DIRTY_BIT, false)

			if (self.m_bSelectedTechDirty):
				self.m_bSelectedTechDirty = false
				self.updateSelectedTech()

			if (self.m_bTechRecordsDirty):
				self.m_bTechRecordsDirty = false
				self.updateTechRecords(true)

			if (gc.getPlayer(self.iCivSelected).getAdvancedStartPoints() < 0):
				# hide the screen
				screen = self.getScreen()
				screen.hide("AddTechButton")
				screen.hide("ASPointsLabel")
				screen.hide("SelectedTechLabel")

		return

	def updateSelectedTech(self):
		pPlayer = gc.getPlayer(CyGame().getActivePlayer())

		# Get the screen
		screen = self.getScreen()

		szName = ""
		iCost = 0

		if (self.m_iSelectedTech != -1):
			szName = gc.getTechInfo(self.m_iSelectedTech).getDescription()
			iCost = gc.getPlayer(CyGame().getActivePlayer()).getAdvancedStartTechCost(self.m_iSelectedTech, true)

		if iCost > 0:
			szText = u"<font=4>" + localText.getText("TXT_KEY_WB_AS_SELECTED_TECH_COST", (iCost, pPlayer.getAdvancedStartPoints())) + u"</font>"
			screen.setLabel( "ASPointsLabel", "Background", szText, CvUtil.FONT_LEFT_JUSTIFY, self.X_ADVANCED_START_TEXT, self.Y_ADD_TECH_BUTTON + 3, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		else:
			screen.hide("ASPointsLabel")

		szText = u"<font=4>"
		szText += localText.getText("TXT_KEY_WB_AS_SELECTED_TECH", (szName,))
		szText += u"</font>"
		screen.setLabel( "SelectedTechLabel", "Background", szText, CvUtil.FONT_LEFT_JUSTIFY, self.X_ADVANCED_START_TEXT + 250, self.Y_ADD_TECH_BUTTON + 3, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )

		# Want to add
		if (pPlayer.getAdvancedStartTechCost(self.m_iSelectedTech, true) != -1):
			screen.show("AddTechButton")
		else:
			screen.hide("AddTechButton")

	def onClose(self):
		pPlayer = gc.getPlayer(self.iCivSelected)
		if (pPlayer.getAdvancedStartPoints() >= 0):
			CyInterface().setDirty(InterfaceDirtyBits.Advanced_Start_DIRTY_BIT, true)
		return 0

class TechChooserMaps:

	TechChooserInputMap = {
		'TechRecord'			: CvTechChooser().TechRecord,
		'TechID'				: CvTechChooser().ParentClick,
		'TechPane'				: CvTechChooser().ParentClick,
		'TechButtonID'			: CvTechChooser().ParentClick,
		'TechButtonBorder'		: CvTechChooser().ParentClick,
		'Unit'					: CvTechChooser().ParentClick,
		'Building'				: CvTechChooser().ParentClick,
		'Obsolete'				: CvTechChooser().ParentClick,
		'ObsoleteX'				: CvTechChooser().ParentClick,
		'Move'					: CvTechChooser().ParentClick,
		'FreeUnit'				: CvTechChooser().ParentClick,
		'FeatureProduction'			: CvTechChooser().ParentClick,
		'Worker'				: CvTechChooser().ParentClick,
		'TradeRoutes'			: CvTechChooser().ParentClick,
		'HealthRate'			: CvTechChooser().ParentClick,
		'HappinessRate'			: CvTechChooser().ParentClick,
		'FreeTech'				: CvTechChooser().ParentClick,
		'LOS'					: CvTechChooser().ParentClick,
		'MapCenter'				: CvTechChooser().ParentClick,
		'MapReveal'				: CvTechChooser().ParentClick,
		'MapTrade'				: CvTechChooser().ParentClick,
		'TechTrade'				: CvTechChooser().ParentClick,
		'OpenBorders'		: CvTechChooser().ParentClick,
		'BuildBridge'			: CvTechChooser().ParentClick,
		'Irrigation'			: CvTechChooser().ParentClick,
		'Improvement'			: CvTechChooser().ParentClick,
		'DomainExtraMoves'			: CvTechChooser().ParentClick,
		'AdjustButton'			: CvTechChooser().ParentClick,
		'TerrainTradeButton'	: CvTechChooser().ParentClick,
		'SpecialBuildingButton'	: CvTechChooser().ParentClick,
		'YieldChangeButton'		: CvTechChooser().ParentClick,
		'BonusRevealButton'		: CvTechChooser().ParentClick,
		'CivicRevealButton'		: CvTechChooser().ParentClick,
		'ProjectInfoButton'		: CvTechChooser().ParentClick,
		'ProcessInfoButton'		: CvTechChooser().ParentClick,
		'FoundReligionButton'	: CvTechChooser().ParentClick,
		'CivDropDown'			: CvTechChooser().CivDropDown,
		}
 
What doesn't work?

That doesn't do what the BUG version does - it is a lot more direct than the BUG version both in what it does and in how it has minimal setup. The BUG version sets stuff up in various places such as using colors for the eras that are actually defined in the clock options for varying the color of the game clock by era (in "Not Just Another Game Clock.xml" - something I forgot to mention in my previous post). The BUG version of tech tree era colors adds a panel behind each tech panel (referred to via szTechRecordShadow instead of szTechRecord in the BUG code) that is offset a little, making it look like a shadow, and colors that new panel based on era. What you have above should change the color of the regular tech panels, but only for techs that have no researched points at all spent on them yet and are not the tech currently being researched even if it has 0 research spent on it (unless there is a bug in there somewhere with the syntax). Previously and currently researched techs get their usual colors.

You could apparently remove the setTechPanelShadowColor function from what you have since you don't use it.

Unless that is the point. If you are trying to make it do what BUG does instead then you'd want to keep that function and define all the additional shadow panels and do the other stuff the bug version does too.
 
What doesn't work?

That doesn't do what the BUG version does - it is a lot more direct than the BUG version both in what it does and in how it has minimal setup. The BUG version sets stuff up in various places such as using colors for the eras that are actually defined in the clock options for varying the color of the game clock by era (in "Not Just Another Game Clock.xml" - something I forgot to mention in my previous post). The BUG version of tech tree era colors adds a panel behind each tech panel (referred to via szTechRecordShadow instead of szTechRecord in the BUG code) that is offset a little, making it look like a shadow, and colors that new panel based on era. What you have above should change the color of the regular tech panels, but only for techs that have no researched points at all spent on them yet and are not the tech currently being researched even if it has 0 research spent on it (unless there is a bug in there somewhere with the syntax). Previously and currently researched techs get their usual colors.

You could apparently remove the setTechPanelShadowColor function from what you have since you don't use it.

Unless that is the point. If you are trying to make it do what BUG does instead then you'd want to keep that function and define all the additional shadow panels and do the other stuff the bug version does too.


Nope i HATE what BUG does with the shadow stuff, just looks weird. So everything is set for JUST the tech tree itself changing colors. But if i add anything before Ancient for some reason it causes errors and CTD, someplace when playing the game.



EDIT: If my TechChooser.py is correct, which i think it is, ???

I put in a debugger and found out that in the Era near the Future one i had two (2) techs that did not belong , because of no definition in the TechInfos, but were there anyways, by mistake, do you think that could cause the CTD's? I am only in the Prehistoric era now??
 
The only problem I see right now is that in the second set for color adjustments, the ancient tech is using an "if" instead of an "elif". That would make the Prehistoric's color never get used since if you are in the Prehistoric era that second "if" would fall through to the "else" and change it from the prehistoric color to that new color. But that is not much of a problem since it only affects techs that the player can never research.

Things that are not properly defined can cause CTDs, although that is typically due to improperly defined art. Some CTDs might be caused by Python trying to get information from the DLL for things that don't exist, typically either using an index of -1 or one that is above the highest actual value. This may be reported in the error log as "unidentifiable C++ exception" (your first error message in the first post is one of these).

You should probably search all your Python files in the mod for "ERA_ANCIENT" (or just "ERA_") to find out if the eras are being referenced anywhere else. If so, you'd want to add you new era there too. Eras are also used in the CIV4CityLSystem and CIV4PlotLSystem XML files, so if there are buildings or improvements that only have appearances correctly defined for specific eras (nothing for ERA_ALL) it might be possible that a new era could be crashing due to no defined artwork for something. Also if the default art is bad but it is normally overridden by correct art specifically defined for the pre-existing eras then it could be an issue too. Figuring out what is going on in the LSystem files is not exactly simple.
 
The only problem I see right now is that in the second set for color adjustments, the ancient tech is using an "if" instead of an "elif". That would make the Prehistoric's color never get used since if you are in the Prehistoric era that second "if" would fall through to the "else" and change it from the prehistoric color to that new color. But that is not much of a problem since it only affects techs that the player can never research.

Things that are not properly defined can cause CTDs, although that is typically due to improperly defined art. Some CTDs might be caused by Python trying to get information from the DLL for things that don't exist, typically either using an index of -1 or one that is above the highest actual value. This may be reported in the error log as "unidentifiable C++ exception" (your first error message in the first post is one of these).

You should probably search all your Python files in the mod for "ERA_ANCIENT" (or just "ERA_") to find out if the eras are being referenced anywhere else. If so, you'd want to add you new era there too. Eras are also used in the CIV4CityLSystem and CIV4PlotLSystem XML files, so if there are buildings or improvements that only have appearances correctly defined for specific eras (nothing for ERA_ALL) it might be possible that a new era could be crashing due to no defined artwork for something. Also if the default art is bad but it is normally overridden by correct art specifically defined for the pre-existing eras then it could be an issue too. Figuring out what is going on in the LSystem files is not exactly simple.

Yeah i agree, but in my Prehistoric era the only change i made for building is the BAND/Settler that uses Mongolia as a starting village/city. All the rest are the same because i use "Fake" buildings otherwise (Art/empty) for the other buildings.

And thx for that if/elif i didnt see that either.

Let me see now if things work, and thx for answering so quickly.;)
 
Top Bottom