Ruff's Cobbled SG Modpack

So I've made some more minor fixes, this time to sevo's Raw Commerce mod.

1. Raw Plot Commerce now excludes 50% bonus for capital under Bureaucracy. It counts only the tiles themselves as the label implies.

2. Total label says if there's a bonus for the capital, what % it is, and includes it in the value.

For example:
Code:
Worked Plots:             10
Trade Routes:              2
Buildings:                 8
Total (+50% for Capital): 30
The changes are in one location in CyMainInterface.py starting on line 2618.
Code:
#sevo raw commerce start
				# EF fixed label texts
				if RuffMod.get_boolean('RawCommerce', 'Enabled', False):
					szBuffer = "Worked Tiles:"
					screen.setLabel( "MaintenanceTextb", "Background", szBuffer, CvUtil.FONT_LEFT_JUSTIFY, 15, 141, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTextb" )

					szBuffer = "Trade Routes:"
					screen.setLabel( "MaintenanceTextc", "Background", szBuffer, CvUtil.FONT_LEFT_JUSTIFY, 15, 161, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTextc" )

					szBuffer = "Buildings and Specialists:"
					screen.setLabel( "MaintenanceTextd", "Background", szBuffer, CvUtil.FONT_LEFT_JUSTIFY, 15, 181, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTextd" )

					# EF added getYieldRateModifier() (e.g. 50% for capital)
					iYieldRateModifier = pHeadSelectedCity.getBaseYieldRateModifier(YieldTypes.YIELD_COMMERCE, 0)
					# Show Total Net Commerce
					if (iYieldRateModifier != 100):
						szBuffer = u"<color=205,180,55,255>Total (%+d%% for Capital):</color>" %(iYieldRateModifier - 100)
					else:
						szBuffer = "<color=205,180,55,255>Total:</color>"
					screen.setLabel( "MaintenanceTexte", "Background", szBuffer, CvUtil.FONT_LEFT_JUSTIFY, 15, 201, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTexte" )

					iBuildingYield = 0
					# I'd like to get the net plot info, but CyPlot.getYield is all !@#$ up.  It doesn't seem to work at all.
					# Calculate the building & Specialist info instead.
					for ii in range (gc.getNumBuildingInfos()):
						if (pHeadSelectedCity.hasBuilding(ii)):
							iBuildingYield += gc.getBuildingInfo(ii).getYieldChange(YieldTypes.YIELD_COMMERCE)

					# EF fixed labels in show() and changed getYieldRate() to getBaseYieldRate()
					# Show Plot Commerces
					szBuffer = u"%d %c" %( pHeadSelectedCity.getBaseYieldRate(YieldTypes.YIELD_COMMERCE) - iBuildingYield - pHeadSelectedCity.getExtraSpecialistYield(YieldTypes.YIELD_COMMERCE) - iNetTradeAmount, gc.getYieldInfo(YieldTypes.YIELD_COMMERCE).getChar())
					screen.setLabel( "MaintenanceTextf", "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, 225, 141, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTextf" )
					
					# Show  trade route commerces
					szBuffer = u"%d %c" %( iNetTradeAmount, gc.getYieldInfo(YieldTypes.YIELD_COMMERCE).getChar() )
					screen.setLabel( "MaintenanceTextg", "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, 225, 161, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTextg" )

					# Show Modifiers
					szBuffer = u"%d %c" %( iBuildingYield + pHeadSelectedCity.getExtraSpecialistYield(YieldTypes.YIELD_COMMERCE), gc.getYieldInfo(YieldTypes.YIELD_COMMERCE).getChar())
					screen.setLabel( "MaintenanceTexth", "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, 225, 181, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTexth" )
		
					# Show Total Net Commerce
					szBuffer = u"<color=205,180,55,255>%d</color> %c" %( pHeadSelectedCity.getYieldRate(YieldTypes.YIELD_COMMERCE), gc.getYieldInfo(YieldTypes.YIELD_COMMERCE).getChar() )
					screen.setLabel( "MaintenanceTexti", "Background", szBuffer, CvUtil.FONT_RIGHT_JUSTIFY, 225, 201, -0.3, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.show( "MaintenanceTexti" )
#sevo raw commerce end

I also replaced the magic number "2" with its constant YieldTypes.YIELD_COMMERCE and fixed the labels holding the values in the last four show() calls. I assume those were typos, though for some reason it worked before (and after). Go figure.

Do you want me to keep posting these? I'll post over in the sevo RC mod thread if there is one, too.
 
Do you want me to keep posting these?
Yes. I will be returning to this mod (one day) to update it with fixes and improvements. Too busy actually playing at the moment.
 
Cool, take your time to enjoy the game. I just wanted to make sure you were interested.

My next task is to fix a bug in the tech-trading advisor. I've noticed a few times where the same tech is listed under "Wants" and "Can Research."

Also, I was trying to think of some way to represent the difference between "Won't Trade" and "Can't Trade" without adding a new column, maybe by dropping down to a new line of icons (just as they wrap when you've got a lot they want).
 
there is a bug in the 'can research' part ... see the HOF suggestions thread, my post, for solution. What do you mean by 'cannot trade'? Remember, that this screen is not allowed to show spoiler information (eg a tech that the AI has that the human doesn't know the AI has via the trading screen).
 
I have a pretty strange problem I guess... Everything works just fine, but if I open up options Alt+J I don't seem to be able to close them again :/ Tried Exit button, Alt+J, Escape, Alt+F4 even but no go. I have to close the whole game through Task Manger and than I loose all the settings I selected :/

Any ideas?
 
:hmm: that is a new one. No immediate suggestion but if you can turn on error checking in the civ4.ini (or warlords) file [the game ini file, not the ruffmod ini file] and post the python log files (found in civ4/log directory), I can have a look at it.

Code:
; Set to 1 for no python exception popups
HidePythonExceptions = 0

; Enable the logging system
LoggingEnabled = 1

; Overwrite old network and message logs
OverwriteLogs = 1

; Enable message logging
MessageLog = 1
 
I'm sorry about this, false alert, I renamed Custom assets folder and reinstalled the whole thing and everything seems to be fine now. Am really sorry :(
 
no prob - glad it works for you. Have fun!
 
Sorry to disturb you again, just wanted to ask if this mod works with Better AI? I've read of some little problem a few pages back, just wonder if that has been already addressed ?
 
I think the answer to that is ... maybe, maybe not. Some games are ok and others arn't. Try it and see.
 
Sadly it didn't work out, I got a lot of assert errors. It was worth a try ;)
 
What do you mean by 'cannot trade'? Remember, that this screen is not allowed to show spoiler information (eg a tech that the AI has that the human doesn't know the AI has via the trading screen).

"Cannot trade" shows up in the normal foreign advisor and means that you know the AI has it but you just traded for its prerequisite this turn. I also thought there was another reason this happens but cannot think of it now.

Now, fitting it on the screen is another issue. :) If the IconGrid used to display the techs can accept a forced "newline," it might be okay. Something like this:

Code:
Won't Trade
-----------
W W W
C

Actually, I'll give that a whirl right now and see what I can come up with.
 
I'm a bit short on time right now, so it's tabled on my end. However, I've uploaded a ZIP of the two files I modified if anyone wants the changes I mentioned above. They both go into

CustomAssets\python\screens

Make sure to back up your previous versions. ;)

Note: These files work with the Warlords expansion pack only. (Thx Ruff!)
 
i tried the naming feature but it does not work. My newly built unit are just named warrior, archer, etc (warlords 2.08)
 
i tried the naming feature but it does not work. My newly built unit are just named warrior, archer, etc (warlords 2.08)
Was that the CIV specific random names component? I've had other reports of problems with that code. As far as I know, the other random name options work. This issue is on my list of known bugs.
 
Was that the CIV specific random names component? I've had other reports of problems with that code. As far as I know, the other random name options work. This issue is on my list of known bugs.
yes, it was.
 
Sadly it didn't work out, I got a lot of assert errors. It was worth a try ;)

If you're running just this mod with BetterAI, it works fine. You can safely ignore all asserts as I've played many games like this. Simply click "Ignore Always" for all asserts. You'll only get one or two when you start/load a game and then you're done. I will sometimes get one the first time I open up the foreign advisor's INFO pane (if anyone has no religion), but again this is trivial.

Unfortunately, the BetterAI guys haven't released a non-assert version AFAIK.
 
Top Bottom