View Full Version : [MODCOMP] Not Just Another Game Clock Mod
TheLopez Feb 07, 2006, 07:38 PM Not Just Another Game Clock Mod
By: TheLopez
Version: 0.4w
Patch Compatibility: Warlords v2.0.8.0
MP Compatible: ?
Download Mod v0.4w (http://forums.civfanatics.com/downloads.php?do=file&id=2504&act=down)
Version: 0.3.3
Patch Compatibility: v1.61
MP Compatible: ?
Download Mod v0.3.3 (http://forums.civfanatics.com/downloads.php?do=file&id=124&act=down)
Version: 0.2
Patch Compatibility: v1.52
MP Compatible: ?
Download Mod v0.2 (http://www.aracnet.com/~opus/Civiv/NotJustAnotherGameClockModv0.2.zip)
Description:
Just as the mod title says, this is not just another game clock mod. It is
much, much more. This mod provides you the flexibility to most if not all of
its different features. There are 12 main variables and one additional variable
per era that can be used to configure the Not Just Another Game Clock Mod
display information and are well documented in the "Not Just Another Game Clock Mod Config.ini"
http://www.aracnet.com/~opus/Civiv/NJAGCM.jpg
Installation Instructions:
1) Unzip this into the "civ4_install_folder\Mods\" folder.
2) Open the CivilizationIV.ini configuration file
3) Change the Mod line to read: Mod = Mods\Not Just Another Game Clock Mod
4) Load the game.
5) Then play as normal.
-----Notes to Modmakers-----
I have modified the CvMainInterface.py and Dr Elmer Jiggle's CvConfigParser.py
file. I have added #< NJAGCM Start > and #< NJAGCM End > in all of
the places that I have made changes to the files.
There are 12 main variables and one additional variable per era that can be
used to configure the Not Just Another Game Clock Mod display information and
are well documented in the INI file. Make sure that you put a copy of the "Not
Just Another Game Clock Mod Config.ini" in your directory and you update the
modName variable in the CvModName.py file with your mod's name.
I highly recommend that you use Dr Elmer Jiggle's INI parser if you want to
allow players to configure your mod through INI files.
If you use this mod, all I ask is that you give me credit.
-----Version Information-----
-----V0.3.x------
- Updated all code to be compatible with the v1.61 patch!
- Fixed a bug preventing the alternate options from being read into the mod.
-----v0.2------
- Added code to display the player's current era next to the players gold amount
on the left side of the screen
- Added a variable to allow turning the era information on and off
- Added a variable to allow turning the era reflection in game turn color feature
on and off
- Added functionality to dynamically read in the EraType/ColorType value pairs from
the INI file
-----v0.1------
- Setup Not Just Another Game Clock Mod infrastructure
- Added a variable to turn alternate time text on and off
- Added a variable to allow specifying the switching time between the primary
and alternate time text
- Added a variable to allow turning the game clock on and off
- Added a variable to allow turning the game turns on and off
- Added a variable to allow turning the game completed turns on and off
- Added a variable to allow turning the game completed percentage on and off
- Added a variable to allow turning the alternate game clock on and off
- Added a variable to allow turning the alternate game turns on and off
- Added a variable to allow turning the alternate game completed turns on and
off
- Added a variable to allow turning the game alternate completed percentage on
and off
-----===Credits & Thanks===-----
- Exavier
[TAB]Composite Mod - readme.txt format
- Homegrown
[TAB]For his Simple Game Clock mod
- Tubby Rower
[TAB]For his version of the game clock
- Goombaz
[TAB]For his Current turn at-a-glance mod
- Dr Elmer Jiggle
[TAB]For providing the INI file parser code allowing for players to
[TAB]customize this mod without having to touch the python code!!!
Drakonik Feb 07, 2006, 09:06 PM So, if I'm reading this correctly, you can only add one extra detail to your clock per era?
TheLopez Feb 07, 2006, 09:27 PM So, if I'm reading this correctly, you can only add one extra detail to your clock per era?
No. Basically lets say you add a new era into the vanilla game with the type ERA_FOOBAR. In the INI file you can specify that during ERA_FOOBAR you want the turns text to be set to blue. If you look at the image you will see that the current era is Ancient. By default I have set the color for the turns to be red. Basically if you don't want the era text displayed you can still tell which era you are in if you have the turns reflecting the era in color feature turned on.
Have I confused you enough yet? Take a look at the config INI file, the colors for each era are defined at the bottom of the file.
Drakonik Feb 07, 2006, 10:22 PM Oh. That makes more sense. More sense, but not enough sense. ;)
Drakonik Feb 07, 2006, 10:27 PM Not Just Another Game Clock Mod
1) Unzip this into the "civ4_install_folder\Mods\" folder.
2) Open the CivilizationIV.ini configuration file
3) Change the Mod line to read: Mod = Mods\Not Just Another Game Clock Mod
4) Load the game.
5) Then play as normal.
Now, what if I've already got a mod in that directory? Could I insert multiple mods in that spot with commas or soemthing?
TheLopez Feb 07, 2006, 11:04 PM Now, what if I've already got a mod in that directory? Could I insert multiple mods in that spot with commas or soemthing?
Well, this isn't a stand alone mod, it is a mod component. You need to combine it with an existing mod. Or you can put a ; in front of the existing line and put in the line indicated in the instructions.
Micha Feb 08, 2006, 06:45 AM Well, this isn't a stand alone mod, it is a mod component. You need to combine it with an existing mod. Or you can put a ; in front of the existing line and put in the line indicated in the instructions.
Now this last sentence makes no sense for me. It would come down to:
; newline oldline
Please give a small example how to combine two mods! (I know it´s somewhere in the FAQ or stickies, but I have little time and I´m sure others are curious for this, too)
Thanks :)
TheLopez Feb 08, 2006, 08:25 AM Now this last sentence makes no sense for me. It would come down to:
; newline oldline
Please give a small example how to combine two mods! (I know it´s somewhere in the FAQ or stickies, but I have little time and I´m sure others are curious for this, too)
Thanks :)
Micha,
Please read this thread about mod creation:
http://forums.civfanatics.com/showthread.php?t=132476
it should help you figure things out. Also, if you know that the answer is in the FAQ or stickies don't be lazy and go there to find out the information yourself.
[to_xp]Gekko Feb 08, 2006, 09:40 AM Great Job Lopez! :)
TheLopez Feb 08, 2006, 10:29 AM Gekko']Great Job Lopez! :)
Thanks [to_xp]Gekko.
To all: ideas for improving this mod component are welcome.
JDexter Feb 14, 2006, 08:02 AM Could you please release this so we can just put the files in customassets?
I'm not sure where the ini-parser dir has to go at all...
TheLopez Feb 14, 2006, 09:11 AM Could you please release this so we can just put the files in customassets?
I'm not sure where the ini-parser dir has to go at all...
JDexter,
This mod component modifies the CvMainInterface.py file and there are many other mods that touch the same file, this is one of the reasons why it has been released as a mod component. The other reason being that I have provided the ability to customize the settings through an INI file.
Pixelz Feb 14, 2006, 08:39 PM JDexter,
This mod component modifies the CvMainInterface.py file and there are many other mods that touch the same file, this is one of the reasons why it has been released as a mod component. The other reason being that I have provided the ability to customize the settings through an INI file.
At the moment this mod really messes up your saves by making them require this mod to load. This means that you can't easily send them to other people. I see your point with INI file parsing. Couldn't you release one version as a mod component and another one for copying into custom assets?
TheLopez Feb 14, 2006, 10:06 PM At the moment this mod really messes up your saves by making them require this mod to load. This means that you can't easily send them to other people. I see your point with INI file parsing. Couldn't you release one version as a mod component and another one for copying into custom assets?
The only way I will do that is if people understand that they will need to update the actual python file if they want to change the settings for the mod.
Is that a problem?
Pixelz Feb 14, 2006, 11:11 PM The only way I will do that is if people understand that they will need to update the actual python file if they want to change the settings for the mod.
Is that a problem?
Sounds good to me!
TheLopez Feb 14, 2006, 11:44 PM Sounds good to me!
Ok, I'll do it after I release the mercenaries mod.
TheLopez Apr 14, 2006, 10:41 AM Updated all code to be compatible with the v1.61 patch!
Jeckel Apr 15, 2006, 11:56 PM Hey there TheLopez, I just cut this mod's code from CvMainInterface.py to that in GP Trickle mod and when I start my game the turn text in the upper right corner flashes, not the normal change from main text to alternate text(which I have at 5 seconds), the primary text flashes about every half second.
when I was c/p pasting it into GP Trickle nothing jumped out that looked out of place. I commented out a few thing of the normal code where your parts seemed to replace it.
I tryed looking through it, but I just don't know enough about the Civ4 python code. Any ideas why it would be doing this or how I could fix it?
TheLopez Apr 16, 2006, 02:41 AM Let me know which mods you would liked merged and I'll upload them tomorrow... well later this morning.
Jeckel Apr 16, 2006, 10:00 AM Ok, that would be awesome. If you could put the Not Just Another Game Clock Mod together with the GP Trickle Plus Mod that would help me out. But if you wouldn't mine, I'm really dreaming of NJAGC, GP Trickle Plus, Mercenaries, and Military Bases Mods all together as one mod, no hurry, but this would be da bombest of da bomb. ;)
TheLopez Apr 16, 2006, 10:30 AM Ok, that sounds good to me. Let me do this first, I need to finish fixing the military bases mod so:
1) It is compatible with the v1.61 patch
2) It works like it is supposed to
and then I will assemble those components for you, does that sound fair to you?
Jeckel Apr 16, 2006, 11:39 AM Your a prince, that would put me back on track, even ahead of, where I was pre-v1.61 patch. :D
Does anyone else get a great feeling when they look at the assets folder and see a bunch of config.ini s? All the choices, simply spectacular. :>
Jeckel Apr 25, 2006, 07:23 PM Man TheLopez, Random Great Person Births, No Name Great Person renamer, MAD Nukes, can I dream that these will be included in the Great Options Mod.. :D
TheLopez Apr 25, 2006, 07:31 PM Only if you want them to be in there... so do you?
Jeckel Apr 27, 2006, 06:16 AM Wow, I'm humbled that you would put so much power in my hands. Then yes, I think those would make great additions. Seeing as you have put out quite a few new ones I will give a updated list of the ones I think should be included.
GP Trickle Plus Mod (The one I am currently useing and absolutely awesome)
Mercenaries Mod
Dead Civ Scoreboard Mod
Not Just Another Game Clock Mod (My all time fav, so simple, so wonderful)
Military Bases Mod
Random Great Person Births Mod
No Name Great Person Renamer Mod
M.A.D. Nukes Mod
That would be arguably the best combination mod ever and would have to earn you a couple more places in Civ heaven. :D
And I'm assuming your going to include, in the Great Options.ini file, a true/false option to on or off each included mod. If not I think this would be a valuble addition. Thanx again. :>
TheLopez Apr 27, 2006, 07:10 AM Wow, I'm humbled that you would put so much power in my hands. Then yes, I think those would make great additions. Seeing as you have put out quite a few new ones I will give a updated list of the ones I think should be included.
GP Trickle Plus Mod (The one I am currently useing and absolutely awesome)
Mercenaries Mod
Dead Civ Scoreboard Mod
Not Just Another Game Clock Mod (My all time fav, so simple, so wonderful)
Military Bases Mod
Random Great Person Births Mod
No Name Great Person Renamer Mod
M.A.D. Nukes Mod
That would be arguably the best combination mod ever and would have to earn you a couple more places in Civ heaven. :D
And I'm assuming your going to include, in the Great Options.ini file, a true/false option to on or off each included mod. If not I think this would be a valuble addition. Thanx again. :>
You are correct, I am going to include all of the above mods in the great options mod. And again, yes, I am going to include as many on-off switches for the different mods as possible.
Oh, BTW, one of the mods that isn't on your list is the Sniper mod that should be released pretty soon!!!
Jeckel Apr 27, 2006, 07:57 AM *grins widely* All that and the sniper mod to, I don't think my heart is going to survive the release of the GO mod, it just might burst ringht in my chest. :D
Mexico May 29, 2006, 05:19 AM i have set-up by default showing game completed percent and when i switch off time victory, i'v got this message. it is from line(s):
if(g_bShowGameCompletedPercent):
g_szTimeText = g_szTimeText + " " + " %2.2f" % (100 *(float(gc.getGame().getGameTurn()) / float(gc.getGame().getMaxTurns())))+ "%"
in method updateTimeText , because getMaxTurn in this case (no time victory) always return 0
(i know, that i can set no percentage in ini file, but this is for all games)
possibly workaround: when reading/setiing global variables, if getMaxTurn() return 0, set "percentage variables" to false for preventing showing them
Mexico from Realism team
Caesium Aug 17, 2006, 07:29 AM Will there be a warlords compatible version?
TheLopez Aug 17, 2006, 07:37 AM Well since you asked for it... I'll see what I can whip up...
Caesium Aug 18, 2006, 06:48 AM Sounds great :)
TheLopez Aug 18, 2006, 10:53 AM Updated with link to Warlords compatible version!!!
jray Nov 02, 2006, 10:29 AM TheLopez, did you know that there are several changes in CvMainInterface.py that are not marked by "# < NJAGCM Start >" and "# < NJAGCM End>"? Could you let us know whether they are accidental carry-overs from another mod, or intentional (and you just forgot the NJAGCM Start/End tags)? I'm experimenting with the mod, and I'm not sure how to deal with these parts of the code.
Below is the WinMerge patch file with the relevant diffs. (This is your version 0.3.3w compared to Warlords v2.08, which hasn't changed since v1.61 by the way). Thanks!
diff w /v208-061031(original)/Assets/Python/Screens/CvMainInterface.py /Not Just Another Game Clock(TheLopez)-v033w/extracted/Not Just Another Game Clock Mod/Assets/Python/Screens/CvMainInterface.py
337a468
> for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
339,340c470,473
< 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 )
---
> 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 )
344c477
< screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, i, -1 )
---
> screen.addStackedBarGFC( szStringHealth, 315 + (i * 34), yResolution - 146 + yRow, 32, 11, InfoBarTypes.NUM_INFOBAR_TYPES, WidgetTypes.WIDGET_GENERAL, k, -1 )
983a1140
> for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
985c1142
< szString = "PlotListButton" + str(i)
---
> szString = "PlotListButton" + str(j*self.numPlotListButtons()+i)
999a1157
>
1002a1161,1169
> if (CyInterface().isCityScreenUp()):
> iMaxRows = 1
> iSkipped = (gc.getDefineINT("MAX_PLOT_LIST_ROWS") - 1) * self.numPlotListButtons()
> iCount += iSkipped
> else:
> iMaxRows = gc.getDefineINT("MAX_PLOT_LIST_ROWS")
> iCount += CyInterface().getPlotListOffset()
> iSkipped = 0
>
1009c1176
< elif ((iCount == (self.numPlotListButtons() - 1)) and ((iVisibleUnits - iCount - CyInterface().getPlotListColumn()) > 1)):
---
> elif ((iCount == (gc.getDefineINT("MAX_PLOT_LIST_ROWS") * self.numPlotListButtons() - 1)) and ((iVisibleUnits - iCount - CyInterface().getPlotListColumn() + iSkipped) > 1)):
1012c1179
< if ((iCount >= 0) and (iCount < self.numPlotListButtons())):
---
> if ((iCount >= 0) and (iCount < self.numPlotListButtons() * gc.getDefineINT("MAX_PLOT_LIST_ROWS"))):
1061c1228
< screen.addDDSGFC( szStringIcon, szFileName, 312 + (iCount * 34), yResolution - 172, 12, 12, WidgetTypes.WIDGET_PLOT_LIST, iCount, -1 )
---
> screen.addDDSGFC( szStringIcon, szFileName, 312 + ((iCount % self.numPlotListButtons()) * 34), yResolution - 172 + (iCount / self.numPlotListButtons() - gc.getDefineINT("MAX_PLOT_LIST_ROWS") + 1) * 34, 12, 12, WidgetTypes.WIDGET_PLOT_LIST, iCount, -1 )
1066c1233
< if (iVisibleUnits > self.numPlotListButtons()):
---
> if (iVisibleUnits > self.numPlotListButtons() * iMaxRows):
1487a1655,1658
> iFreeSpecialistCount = 0
> for i in range(gc.getNumSpecialistInfos()):
> iFreeSpecialistCount += pHeadSelectedCity.getFreeSpecialistCount(i)
>
1490a1662,1673
>
> if (iFreeSpecialistCount > MAX_CITIZEN_BUTTONS):
> for i in range(gc.getNumSpecialistInfos()):
> if (pHeadSelectedCity.getFreeSpecialistCount(i) > 0):
> if (iCount < MAX_CITIZEN_BUTTONS):
> szName = "FreeSpecialist" + str(iCount)
> screen.setImageButton( szName, gc.getSpecialistInfo(i).getTexture(), (xResolution - 74 - (34 * iCount)), yResolution - 216, 32, 32, WidgetTypes.WIDGET_FREE_CITIZEN, i, 1 )
> screen.show( szName )
> bHandled = true
> iCount += 1
>
> else:
1495c1678
< screen.setImageButton( szName, gc.getSpecialistInfo(i).getTexture(), (xResolution - 74 - (34 * iCount)), yResolution - 216, 32, 32, WidgetTypes.WIDGET_CITIZEN, i, -1 )
---
> screen.setImageButton( szName, gc.getSpecialistInfo(i).getTexture(), (xResolution - 74 - (34 * iCount)), yResolution - 216, 32, 32, WidgetTypes.WIDGET_FREE_CITIZEN, i, -1 )
1512c1695
< if (pHeadSelectedCity.isSpecialistValid(i, 1) and iSpecialistCount < (pHeadSelectedCity.getPopulation() + pHeadSelectedCity.totalFreeSpecialists())):
---
> if (pHeadSelectedCity.isSpecialistValid(i, 1) and (pHeadSelectedCity.isCitizensAutomated() or iSpecialistCount < (pHeadSelectedCity.getPopulation() + pHeadSelectedCity.totalFreeSpecialists()))):
>
1873c2123
< szBuffer = u"%d%c" %(pHeadSelectedCity.getBaseYieldRate(YieldTypes.YI ELD_PRODUCTION), gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getCh ar())
---
> szBuffer = u"%d%c" %(pHeadSelectedCity.getYieldRate(YieldTypes.YIELD_ PRODUCTION), gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getCh ar())
1917c2167
< szBuffer = u"%d%c" %(pHeadSelectedCity.getCommerceRate(eCommerce), gc.getCommerceInfo(eCommerce).getChar())
---
> szBuffer = u"%d.%02d %c" %(pHeadSelectedCity.getCommerceRate(eCommerce), pHeadSelectedCity.getCommerceRateTimes100(eCommerc e)%100, gc.getCommerceInfo(eCommerce).getChar())
2144c2394
< iMaintenance = pHeadSelectedCity.getMaintenance()
---
> iMaintenance = pHeadSelectedCity.getMaintenanceTimes100()
2151c2401
< szBuffer = u"%d%c" %(-(pHeadSelectedCity.getMaintenance()), gc.getCommerceInfo(CommerceTypes.COMMERCE_GOLD).ge tChar())
---
> szBuffer = u"-%d.%02d %c" %(iMaintenance/100, iMaintenance%100, gc.getCommerceInfo(CommerceTypes.COMMERCE_GOLD).ge tChar())
2215c2465
< for h in range( gc.getMAX_CIV_PLAYERS() ):
---
> for h in range( gc.getMAX_PLAYERS() ):
2218d2467
< fPercent = fPercent / 100.0
2219a2469
> fPercent = fPercent / 100.0
2244c2494,2499
< szBuffer = localText.getText("INTERFACE_CITY_COMMERCE_RATE", (gc.getCommerceInfo(CommerceTypes.COMMERCE_CULTURE ).getChar(), gc.getCultureLevelInfo(pHeadSelectedCity.getCultur eLevel()).getTextKey(), pHeadSelectedCity.getCommerceRate(CommerceTypes.CO MMERCE_CULTURE)))
---
> iRate = pHeadSelectedCity.getCommerceRateTimes100(Commerce Types.COMMERCE_CULTURE)
> if (iRate%100 == 0):
> szBuffer = localText.getText("INTERFACE_CITY_COMMERCE_RATE", (gc.getCommerceInfo(CommerceTypes.COMMERCE_CULTURE ).getChar(), gc.getCultureLevelInfo(pHeadSelectedCity.getCultur eLevel()).getTextKey(), iRate/100))
> else:
> szRate = u"+%d.%02d" % (iRate/100, iRate%100)
> szBuffer = localText.getText("INTERFACE_CITY_COMMERCE_RATE_FLOAT", (gc.getCommerceInfo(CommerceTypes.COMMERCE_CULTURE ).getChar(), gc.getCultureLevelInfo(pHeadSelectedCity.getCultur eLevel()).getTextKey(), szRate))
2256c2511
< iFirst = float(pHeadSelectedCity.getGreatPeopleProgress()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold() )
---
> iFirst = float(pHeadSelectedCity.getGreatPeopleProgress()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold(false) )
2259c2514
< screen.setBarPercentage( "GreatPeopleBar", InfoBarTypes.INFOBAR_RATE, ( float(pHeadSelectedCity.getGreatPeopleRate()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold() ) ) )
---
> screen.setBarPercentage( "GreatPeopleBar", InfoBarTypes.INFOBAR_RATE, ( float(pHeadSelectedCity.getGreatPeopleRate()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold(false) ) ) )
2261c2516
< screen.setBarPercentage( "GreatPeopleBar", InfoBarTypes.INFOBAR_RATE, ( ( float(pHeadSelectedCity.getGreatPeopleRate()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold() ) ) ) / ( 1 - iFirst ) )
---
> screen.setBarPercentage( "GreatPeopleBar", InfoBarTypes.INFOBAR_RATE, ( ( float(pHeadSelectedCity.getGreatPeopleRate()) / float( gc.getPlayer( pHeadSelectedCity.getOwner() ).greatPeopleThreshold(false) ) ) ) / ( 1 - iFirst ) )
2264c2519
< iFirst = float(pHeadSelectedCity.getCulture(pHeadSelectedCi ty.getOwner())) / float(pHeadSelectedCity.getCultureThreshold())
---
> iFirst = float(pHeadSelectedCity.getCultureTimes100(pHeadSe lectedCity.getOwner())) / float(100 * pHeadSelectedCity.getCultureThreshold())
2410a2666,2667
> if (len(szBuffer) > 60):
> szBuffer = "<font=2>" + szBuffer + "</font>"
2604c2861
< if (((gc.getPlayer(ePlayer).getTeam() == gc.getGame().getActiveTeam()) and (gc.getTeam(gc.getGame().getActiveTeam()).getNumMe mbers() > 1)) or gc.getGame().isDebugMode()):
---
> if (((gc.getPlayer(ePlayer).getTeam() == gc.getGame().getActiveTeam()) and (gc.getTeam(gc.getGame().getActiveTeam()).getNumMe mbers() > 1)) or (gc.getTeam(gc.getPlayer(ePlayer).getTeam()).isVas sal(gc.getGame().getActiveTeam())) or gc.getGame().isDebugMode()):
jray Nov 03, 2006, 09:01 AM I just happened upon an extremely bizarre glitch. If your mod folder is named "playpen", then this mod does not work! Name it anything else you want, like Fred or Nancy or Baloney or even Playpen A, but Playpen breaks something. I wonder if Firaxis hard-coded that keyword.
jray Nov 03, 2006, 01:49 PM TheLopez, did you know that there are several changes in CvMainInterface.py that are not marked by "# < NJAGCM Start >" and "# < NJAGCM End>"? Could you let us know whether they are accidental carry-overs from another mod, or intentional (and you just forgot the NJAGCM Start/End tags)? I'm experimenting with the mod, and I'm not sure how to deal with these parts of the code.
To follow up on this, I tried reverting back to the original Firaxis code in all such places (where you don't have your NJAGCM tags). As a consequence, the plot list is malfunctioning. I can only control the first listed unit on each tile.
This seems totally counter-intuitive. When I look carefully at all the CvMainInterface.py code within the NJAGCM tags that changed, it is all totally related to the game clock, and not to the plot lists. Yet, the CvMainInterface.py code NOT within NJAGCM tags that changed IS all related to plot lists. So, did your game clock changes somehow break the plot list code, and so you made additional modifications to correct that? I'm confused!
TheLopez Nov 03, 2006, 04:20 PM jray, first or all are you using the vanilla Civ4 version or warlords version? If you are using the warlords version are you trying to use the current version with the v2.0.8 patch? If you are then that is the problem because it works fine for me in the unpatched warlords version. I will release a v2.0.8.0 compatible version soon. To answer your question, no, this mod does not touch any of the plot list code so I don't know why you are having those problems. Maybe you should post your CvMainInterface.py file so I can take a look at it.
Caesium Nov 04, 2006, 08:30 AM I will release a v2.0.8.0 compatible version soon.Can't await it ;)
jray Nov 04, 2006, 03:25 PM jray, first or all are you using the vanilla Civ4 version or warlords version? If you are using the warlords version are you trying to use the current version with the v2.0.8 patch? If you are then that is the problem because it works fine for me in the unpatched warlords version. I will release a v2.0.8.0 compatible version soon. To answer your question, no, this mod does not touch any of the plot list code so I don't know why you are having those problems. Maybe you should post your CvMainInterface.py file so I can take a look at it.
I'm using your v0.3.3.w and a Warlords 2.08 installation. The 2.08 part is not the problem... your mod works just fine for me in v2.08, which isn't surprising, since CvMainInterface.py didn't change between v2.00 and v2.08.
But I think your mod DOES touch the plot list code, or else I belong in the looney bin :). For example, look at line 338 in your v0.3.3w version of CvMainInterface.py:
for i in range(self.numPlotListButtons()):
and then the corresponding line (468) in the Firaxis-supplied CvMainInterface.py:
for j in range(gc.getDefineINT("MAX_PLOT_LIST_ROWS")):
That's only the first of many diffs involving plot lists.
So here's the strange thing: If I go through and revert the diffs NOT enclosed in your NJAGCM tags (i.e., the plot list diffs) back to the Firaxis code, then the plot list is messed up when I play. So... I'm just wondering why you altered the plot list code in the first place in this mod for the game clock... and why IT works and Firaxis's plot list code does NOT :).
I'm attaching three different versions, to make sure we're on the same page with all this:
CvMainInterface(njagcm-clock-and-plotlist).txt is the one that works well for me. It pretty much just takes your v0.3.3w and tweaks some things to make the clock different. And BTW, I'm not trying to steal your mod! It's just for my own practicing. So don't take the re-naming to "jrayGameClock" personally :).
CvMainInterface(njagcm-clock-only).txt is the result of me reverting the diffs I saw with Firaxis's CvMainInterface.py NOT enclosed by your NJAGCM tags back to how Firaxis had it. It results in plotlist problems (e.g., only being able to control the first unit on each tile).
CvMainInterface(all-firaxis).txt is the Firaxis-provided version.
jray Nov 04, 2006, 03:32 PM And FYI in case you're curious, here's how I tweaked things. I scrunched up the text a little bit so everything could fit without alternating, and dropped one decimal place and used EraColor for turns to make it a bit more readable. Now in the worst possible case (largest number of characters displaying), it all barely fits, at least on my computer with 1024x768 game resolution.
jray Nov 05, 2006, 12:30 AM Update: the plot list is messed up in both of my modified files. The CvMainInterface(njagcm-clock-and-plotlist).txt file results in all units getting icons in the plot list, not just the ones on the selected square.
I give up... maybe Firaxis changed something weird in the C code such that messing around with the game clock breaks the plot list. Or else I'm just making some dumb mistake. Please enlighten me if you can!
jray Nov 05, 2006, 08:53 AM 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.
TheLopez Nov 05, 2006, 01:54 PM 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.
jray Nov 06, 2006, 05:18 AM 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.
TheLopez Nov 06, 2006, 06:38 PM Ok, I am sick of this jray, let me deconstruct your message:
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:
for i in range( 20 ):
to
for i in range( gc.getMAX_PLAYERS() ):
The following lines were added 597-599 and 605-607
if (gc.getGame().isMPOption(MultiplayerOptionTypes.MP OPTION_ANONYMOUS)):
acOutput = localText.getText("SYSTEM_WAITING_FOR_PLAYER", (gc.getPlayer(messageControl.GetFirstBadConnection ()).getNameKey(), 0))
else:
if (gc.getGame().isMPOption(MultiplayerOptionTypes.MP OPTION_ANONYMOUS)):
acOutput = localText.getText("SYSTEM_PLAYER_JOINING", (gc.getPlayer(messageControl.GetFirstBadConnection ()).getNameKey(), 0))
else:
and last in the method updateScoreStrings the line:
for i in range( 20 ):
was changed to:
for i in range( 20 ):
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.
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:
# ************************************************** *******************************
# 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:
# ************************************************** *******************************
# 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:
# ************************************************** *******************************
# 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:
# ************************************************** *******************************
# 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:
#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.
jray Nov 06, 2006, 09:53 PM 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.p y
Sorry! :blush:
I'll start over from scratch with this newfound wisdom and let you know how things go...
jray Nov 06, 2006, 11:21 PM 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:.
TheLopez Nov 08, 2006, 10:30 AM Updated Warlords version to be compatible with the v2.0.8.0 patch.
ruff_hi Nov 11, 2006, 11:43 PM 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?
ruff_hi Dec 12, 2006, 02:53 AM 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.
# 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.
TheLopez Dec 13, 2006, 07:07 PM Thanks ruff_hi
Chazcon Dec 20, 2006, 04:54 PM 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 >
TheLopez Dec 21, 2006, 06:42 PM 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.
Chazcon Dec 21, 2006, 07:35 PM Maybe I'm just being stupid. I'll install it as-is and give it a go. Thanks TL.
|
|