[MODCOMP] Not Just Another Game Clock Mod

Okay, I changed my mind about the looney bin. Whoever designed Python to depend on indentation needs to go there in my place. No, that's not good enough for him. Send him to a desert tile surrounded by barbarians on forested hills :).

So I figured out the mistake that led to the problem reported in my previous post. Now my mod of your v0.3.3w that keeps your new plotlist code works fine. BUT, I went back and meticulously restored all the tabs and indentation for my version that tries to revert back to Firaxis' plotlist code, and I still can't get that right. It results in not being able to control any units besides the first one on any given tile.

If anyone has the inclination to help me troubleshoot, I'd appreciate it! Eventually I want to release my own game clock mod, and I want to clean out all the plotlist diffs so that it's JUST a game clock mod... if possible, that is.

Here are the new files.
 

Attachments

Ok, jray, I see what the problem is... the current version of this mod is only compatible with Warlords v2.0.0.0 not v2.0.8 which is why you are seeing so many differences. After rechecking my v0.3.3 code all changes made to the CvMainInterface.py file are wrapped by < ... Start > and < ... End > tags.
 
TheLopez said:
Ok, jray, I see what the problem is... the current version of this mod is only compatible with Warlords v2.0.0.0 not v2.0.8 which is why you are seeing so many differences. After rechecking my v0.3.3 code all changes made to the CvMainInterface.py file are wrapped by < ... Start > and < ... End > tags.

I don't understand... the CvMainInterface.py issued by Firaxis did not change at all between Warlords v2.00 and Warlords v2.08. Your v0.3.3w mod is just as compatible with v2.08 as it was with v2.00. In v2.00 it had extra plotlist diffs, and in v2.08 it still has the same plotlist diffs. For example, that change that I mentioned a few posts back, where you changed

for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):

to

for i in range(self.numPlotListButtons()):

without putting your <... Start> and <... End> tags around it.
 
Ok, I am sick of this jray, let me deconstruct your message:

jray said:
I don't understand... the CvMainInterface.py issued by Firaxis did not change at all between Warlords v2.00 and Warlords v2.08.
You are absolutely wrong that the CvMainInterface.py didn't change between v2.0.0.0 and v2.0.8.0. According to windiff line 533 changed from:
Code:
		for i in range( 20 ):
to
Code:
		for i in range( gc.getMAX_PLAYERS() ):

The following lines were added 597-599 and 605-607
Code:
					if (gc.getGame().isMPOption(MultiplayerOptionTypes.MPOPTION_ANONYMOUS)):
						acOutput = localText.getText("SYSTEM_WAITING_FOR_PLAYER", (gc.getPlayer(messageControl.GetFirstBadConnection()).getNameKey(), 0))
					else:
Code:
					if (gc.getGame().isMPOption(MultiplayerOptionTypes.MPOPTION_ANONYMOUS)):
						acOutput = localText.getText("SYSTEM_PLAYER_JOINING", (gc.getPlayer(messageControl.GetFirstBadConnection()).getNameKey(), 0))
					else:

and last in the method updateScoreStrings the line:
Code:
		for i in range( 20 ):
was changed to:
Code:
		for i in range( 20 ):


jray said:
Your v0.3.3w mod is just as compatible with v2.08 as it was with v2.00.
This statement is not true, I have not certified v0.3.3w as compatible with the v2.0.8.0 Warlords patch. I have already updated the mod to be compatible and will upload the update soon.

jray said:
In v2.00 it had extra plotlist diffs, and in v2.08 it still has the same plotlist diffs. For example, that change that I mentioned a few posts back, where you changed

for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):

to

for i in range(self.numPlotListButtons()):

without putting your <... Start> and <... End> tags around it.
Again, you are incorrect, here is the block that you are referring to from the v1.61 compatible version of the mod:

Code:
		# *********************************************************************************
		# PLOT LIST BUTTONS
		# *********************************************************************************

		for i in range(self.numPlotListButtons()):
			szString = "PlotListButton" + str(i)
			screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
			screen.hide( szString )
			
			szStringHealth = szString + "Health"
			screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, i, -1 )
			screen.hide( szStringHealth )

		# End Turn Text		
		screen.setLabel( "EndTurnText", "Background", u"", CvUtil.FONT_CENTER_JUSTIFY, 0, yResolution - 188, -0.1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		screen.setHitTest( "EndTurnText", HitTestTypes.HITTEST_NOHIT )

		# Three states for end turn button...
		screen.setImageButton( "EndTurnButton", "", xResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosX, yResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosY, iEndOfTurnButtonSize, iEndOfTurnButtonSize, WidgetTypes.WIDGET_END_TURN, -1, -1 )
		screen.setStyle( "EndTurnButton", "Button_HUDEndTurn_Style" )
		screen.setEndTurnState( "EndTurnButton", "Red" )
		screen.hide( "EndTurnButton" )
and here is the same block from the unmodified version of CvMainInterface.py:
Code:
		# *********************************************************************************
		# PLOT LIST BUTTONS
		# *********************************************************************************

		for i in range(self.numPlotListButtons()):
			szString = "PlotListButton" + str(i)
			screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
			screen.hide( szString )
			
			szStringHealth = szString + "Health"
			screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, i, -1 )
			screen.hide( szStringHealth )

		# End Turn Text		
		screen.setLabel( "EndTurnText", "Background", u"", CvUtil.FONT_CENTER_JUSTIFY, 0, yResolution - 188, -0.1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		screen.setHitTest( "EndTurnText", HitTestTypes.HITTEST_NOHIT )

		# Three states for end turn button...
		screen.setImageButton( "EndTurnButton", "", xResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosX, yResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosY, iEndOfTurnButtonSize, iEndOfTurnButtonSize, WidgetTypes.WIDGET_END_TURN, -1, -1 )
		screen.setStyle( "EndTurnButton", "Button_HUDEndTurn_Style" )
		screen.setEndTurnState( "EndTurnButton", "Red" )
		screen.hide( "EndTurnButton" )
As you can see these two versions are identical.

Here is the same block of code from both Warlords v2.0.0.0 and v2.0.8.0:
Code:
		# *********************************************************************************
		# PLOT LIST BUTTONS
		# *********************************************************************************

		for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
			for i in range(self.numPlotListButtons()):
				k = j*self.numPlotListButtons()+i
				yRow = (j - gc.getDefineINT("MAX_PLOT_LIST_ROWS") + 1) * 34
				szString = "PlotListButton" + str(k)
				screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169 + yRow, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, k, -1, ButtonStyles.BUTTON_STYLE_LABEL )
				screen.hide( szString )
				
				szStringHealth = szString + "Health"
				screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146 + yRow, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, k, -1 )
				screen.hide( szStringHealth )

		# End Turn Text		
		screen.setLabel( "EndTurnText", "Background", u"", CvUtil.FONT_CENTER_JUSTIFY, 0, yResolution - 188, -0.1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		screen.setHitTest( "EndTurnText", HitTestTypes.HITTEST_NOHIT )

		# Three states for end turn button...
		screen.setImageButton( "EndTurnButton", "", xResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosX, yResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosY, iEndOfTurnButtonSize, iEndOfTurnButtonSize, WidgetTypes.WIDGET_END_TURN, -1, -1 )
		screen.setStyle( "EndTurnButton", "Button_HUDEndTurn_Style" )
		screen.setEndTurnState( "EndTurnButton", "Red" )
		screen.hide( "EndTurnButton" )

If you look carefully the v1.61 code block only has one for loop while the warlords version has 2 for loops.

Here is the same code from one of your files:
Code:
		# *********************************************************************************
		# PLOT LIST BUTTONS
		# *********************************************************************************

#firaxis-v208# 		for i in range(self.numPlotListButtons()):
#firaxis-v208# 			szString = "PlotListButton" + str(i)
#firaxis-v208# 			screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
#firaxis-v208# 			screen.hide( szString )
#firaxis-v208# 			szStringHealth = szString + "Health"
#firaxis-v208# 			screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, i, -1 )
#firaxis-v208# 			screen.hide( szStringHealth )
#NJAGCM-v033w# 		for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
#NJAGCM-v033w# 			for i in range(self.numPlotListButtons()):
#NJAGCM-v033w# 				k = j*self.numPlotListButtons()+i
#NJAGCM-v033w# 				yRow = (j - gc.getDefineINT("MAX_PLOT_LIST_ROWS") + 1) * 34
#NJAGCM-v033w# 				szString = "PlotListButton" + str(k)
#NJAGCM-v033w# 				screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169 + yRow, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, k, -1, ButtonStyles.BUTTON_STYLE_LABEL )
#NJAGCM-v033w# 				screen.hide( szString )
#NJAGCM-v033w#
#NJAGCM-v033w# 				szStringHealth = szString + "Health"
#NJAGCM-v033w# 				screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146 + yRow, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, k, -1 )
#NJAGCM-v033w# 				screen.hide( szStringHealth )
		for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
			for i in range(self.numPlotListButtons()):
				k = j*self.numPlotListButtons()+i
				yRow = (j - gc.getDefineINT("MAX_PLOT_LIST_ROWS") + 1) * 34
				szString = "PlotListButton" + str(k)
				screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169 + yRow, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, k, -1, ButtonStyles.BUTTON_STYLE_LABEL )
				screen.hide( szString )

				szStringHealth = szString + "Health"
				screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146 + yRow, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, k, -1 )
				screen.hide( szStringHealth )

		# End Turn Text
		screen.setLabel( "EndTurnText", "Background", u"", CvUtil.FONT_CENTER_JUSTIFY, 0, yResolution - 188, -0.1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		screen.setHitTest( "EndTurnText", HitTestTypes.HITTEST_NOHIT )

		# Three states for end turn button...
		screen.setImageButton( "EndTurnButton", "", xResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosX, yResolution - (iEndOfTurnButtonSize/2) - iEndOfTurnPosY, iEndOfTurnButtonSize, iEndOfTurnButtonSize, WidgetTypes.WIDGET_END_TURN, -1, -1 )
		screen.setStyle( "EndTurnButton", "Button_HUDEndTurn_Style" )
		screen.setEndTurnState( "EndTurnButton", "Red" )
		screen.hide( "EndTurnButton" )

See anything familiar from v1.61 and v2.0.0.0/v2.0.8.0?

It is my assertion that you started from the v1.61 version of the mod or tried to merge in the warlords version of the mod into the v1.61 vanilla version of the CvMainInterface.py file. My "proof" to make this assertion is that the second loop is missing from the "v2.08 firaxis" code from the file that you commented out in your code:
Code:
#firaxis-v208# 		for i in range(self.numPlotListButtons()):
#firaxis-v208# 			szString = "PlotListButton" + str(i)
#firaxis-v208# 			screen.addCheckBoxGFC( szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 315 + (i * 34), yResolution - 169, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
#firaxis-v208# 			screen.hide( szString )
#firaxis-v208# 			szStringHealth = szString + "Health"
#firaxis-v208# 			screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, i, -1 )
#firaxis-v208# 			screen.hide( szStringHealth )

Any questions?

If you want please upload your actual CvMainInterface.py file that you are working on I'll look at it but I am pretty sure that there is nothing wrong with the [MODCOMP] Not Just Another Game Clock Mod or the unaltered firaxis code.
 
Oh my, I think I figured out my malfunction now. I was accidentally working from

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\Python\Screens\CvMainInterface.py

instead of

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets\Python\Screens\CvMainInterface.py

Sorry! :blush:

I'll start over from scratch with this newfound wisdom and let you know how things go...
 
Yep, all is well when I actually look at the CORRECT Firaxis .py files. I'm really sorry for wasting your time on such silliness :blush:.
 
Updated Warlords version to be compatible with the v2.0.8.0 patch.
 
TheLopez - I like this mod and I am (slowly) folding it into my cobbled SG mod. However, your init file settings are leaving me somewhat confused. Here are your values with my comments on them in brackets (after playing around with the options and looking at the results in game) ...

  • Alternate Time Text (do I display an alternate time text?)
  • Alternating Time (if so, how many seconds between flipping between the two)
  • Show Turns (show the in game date)
  • Show Game Clock (show the real time)
  • Show Game Completed Percent (played turns over max turns)
  • Show Game Completed Turns (played turns)
  • Alternate Show Turns (show the date in the alternate text)
  • Alternate Show Game Clock (show the time in the alternate text)
  • Alternate Show Game Completed Percent (show %age in the alternate text)
  • Alternate Show Game Completed Turns (show turns played in the alternate text)
  • Show Era (show era)
  • Show Reflect Era In Turn Color (change in game date to era colour)

Most of them are straight forward, but I was very confused by 'show turns' meaning the in-game date.

Q: have I got all my comments correct?
 
I've found an error in the NJAGCM code to do with the turn counter. It only pops up if you start from a non-ancient era.

PHP:
#  g_szTimeText = g_szTimeText + " Turn " + unicode(gc.getGame().getGameTurn())
  g_szTimeText = g_szTimeText + " Turn " + unicode(gc.getGame().getElapsedGameTurns())

The top line is the original code and the bottom line is the fix. getGameTurn returns the game turn counting from play starting at 4000BC while get elapsed game turns starts from 0 and counts up by 1. Now maxturns returns the total number of turns that it is possible to play so if you start from future tech, then your getGameTurn is 150% of the maximum.
 
Thanks ruff_hi
 
So am I correct in assuming that if I comment out the following line, I don't have to include the INI parser, and then the only file that is changed is CvMainInterface.py ?

(and yes I realize I'll have to change variables in this file)


# < NJAGCM Start >
import CvConfigParser
# < NJAGCM End >
 
So am I correct in assuming that if I comment out the following line, I don't have to include the INI parser, and then the only file that is changed is CvMainInterface.py ?

(and yes I realize I'll have to change variables in this file)


# < NJAGCM Start >
import CvConfigParser
# < NJAGCM End >


Nope that isn't correct. You will have to remove a bunch of other lines which I cannot remember off the top of my head right now.
 
Maybe I'm just being stupid. I'll install it as-is and give it a go. Thanks TL.
 
Back
Top Bottom