Ruff's Cobbled SG Modpack

this is useful info - mainly changing the code to live in the /mod/ directories. I started from the HOF version of MSDA because of the 'cheats' re wonder builds.

Is there a way that the code can know if it is in the customassets directory or under the mod directory? If so, I can build that into my mod and make it an option.

Just look at what I did to your code last summer. Basically, I built upon CvPath.py. You don't need to make it an option to set - just make it work "plug and play" whichever way it is installed. You can also see how I've got the latest GreatPersonMod version working in all three locations - now that there are no more issues with CustomMods.
 
Just look at what I did to your code last summer. Basically, I built upon CvPath.py. You don't need to make it an option to set - just make it work "plug and play" whichever way it is installed. You can also see how I've got the latest GreatPersonMod version working in all three locations - now that there are no more issues with CustomMods.
Thx - I will d/l a copy of your mod and take a look at that part.
 
WARNING: The warlords version (v2.0.3 and prior) contains a spoiler in that it shows items pillaged by any CIV at any location. Thus it is possible to learn about a civ that you haven't met yet.

v2.0.4 now only reports on pillages by your units OR on your land.
 
ruff_hi, you should take a look at this bug report I posted in the Better AI forum.
http://forums.civfanatics.com/showpost.php?p=5057063&postcount=134

EDIT:
Please note my other post below the one linked. After removing the cobbled mod I no longer get assert errors from BetterAI.
Perhaps the changes they incorporated in the latest build broke something? :dunno:
 
Hmm - I'm not sure if the EFA bug is impacting on the betterAI or the other way around. I'll look at the holy city bug and update my mods.

Thx for the message.
 
Just gave your Warlods version a wirl. Ver nice indeed, exactly what I was looking for!

Two questions:

1. Is there a way to disable the Great Person Mod? In Warlords it appears you don't need to change the names of all the great people in order to tell who they are. The type is automatically put in parenthesis as well as displaying who the GP belongs to. Right now I'm getting something like this:
Moses (Prophet) (Great Prophet) was born in ...
It's annoying to look at.

2. I'm having trouble turning the alert off for culture expansion. It's telling me the turn before when a city will expand its borders. I've tried checking and unchecking (while refreshing with alt-tab) the option, but it still comes up. I've noticed in your INI file that some variables are true/false while others are 0 or 1. Perhaps your in-game options menu is setting this particular variable incorrectly?
 
Just gave your Warlods version a wirl. Ver nice indeed, exactly what I was looking for!

Thanks.

1. Is there a way to disable the Great Person Mod? In Warlords it appears you don't need to change the names of all the great people in order to tell who they are. The type is automatically put in parenthesis as well as displaying who the GP belongs to. Right now I'm getting something like this:
Moses (Prophet) (Great Prophet) was born in ...
It's annoying to look at.

No. Not via the ini file as that change is an XML change. You can track down the XML file that contains the GPs names and delete it - that should do it.

2. I'm having trouble turning the alert off for culture expansion. It's telling me the turn before when a city will expand its borders. I've tried checking and unchecking (while refreshing with alt-tab) the option, but it still comes up. I've noticed in your INI file that some variables are true/false while others are 0 or 1. Perhaps your in-game options menu is setting this particular variable incorrectly?
Really. I played 1 or 2 games with alerts and then found all of them annoying and turned them all off. I'll have a look at the culture alert in particular. I don't think that 0/1 or false/true makes much of a difference as (to me) python seems to treat them both the same.
 
Thanks for the removal instructions on the GP mod. Makes things nicer to look at.

If you're interested here's a quick bug report.

1. Culture announcements are fickle. Sometimes they work, other times they don't. Personally, I would just like to be able to turn it off.

2. Buildings screen of the domestic advisor:
a. Military Academy isn't listed. This is handy to remember where you put all of them
b. In general this screen is screwed up. Other Civs' unique buildings are shown in here etc. The 'available buildings' option doesn't seem to remove the buildings you can't build (esp other civs' unique ones).

3. City screen of the domestic advisor:
a. Landmarks isn't functioning properly. National wonders are not being shown with the little period graphic. The power indicator in this column appears to be working.
 
ruff_hi:
I got a response from Iustus in the Better AI thread about the problem I mentioned in my post above. Here's a link to the original post in that forum.
http://forums.civfanatics.com/showpo...&postcount=134

Anyways, this is what he had to say:
Might want to forward on to ruff_hi the following info, do not call AI_getAttitude on yourself:

3895: AI_getAttitude (which always calls the second one)
3909: AI_getAttitudeVal

That is the cause of this assert. Somewhere in his python code, he is looping over every player, and calling AI_getAttitude, well dont call it on yourself!

-Iustus

(note, edited to use vanilla line numbers)
 
hmmn - I thought I had an if statement stopping that. I'll check the code and upload a fix if I haven't. Thx
 
Congrats for your modpack,Ruff, it's really useful. I've just noticed a problem so far: text under units (Plot Enhancement) is blurred, as you may notice in the attached screenshot. I play at 1280x1024. How can I solve this?
Thanks!

And :)

Edit: Ignore my post please, it's probably something related with my graphics settings.
 

Attachments

  • Civ4ScreenShot0005.JPG
    Civ4ScreenShot0005.JPG
    228.3 KB · Views: 120
(note, lines are from Look & Feel mod, they may be different or even fixed in your original)

There is a bug in autologEventManager.py (part of Ruff autologger, modified from HOF mod, modified from autolog)

It is technically illegal to call getAttitudeInfo on yourself.

insert at lines 740, 799, 861:
Code:
if iCiv1 == iCiv2:
	continue

to fix this bug. (Note, I have not tested this fix)

Spoiler fixes in context :

Code:
# store civ attitudes
for iCiv1 in range(0, ziMaxCiv, 1):
	for iCiv2 in range(0, ziMaxCiv, 1):
		[B]if iCiv1 == iCiv2:
			continue[/B]
		zKey = ziMaxCiv * iCiv1 + iCiv2
		self.CIVAttitude[zKey] = gc.getAttitudeInfo(gc.getPlayer(iCiv1).AI_getAttitude(iCiv2)).getDescription()

Code:
# check if the attitude has changed
if (NewAutoLog.Enabled()
and RuffMod.get_boolean('AUTOLOG', 'LOG_ATTITUDE', True)):
	for iCiv1 in range(0, ziMaxCiv, 1):
		for iCiv2 in range(0, ziMaxCiv, 1):
			[B]if iCiv1 == iCiv2:
				continue[/B]
			zKey = ziMaxCiv * iCiv1 + iCiv2
			zsNewAttitude = gc.getAttitudeInfo(gc.getPlayer(iCiv1).AI_getAttitude(iCiv2)).getDescription()

			if (gc.getTeam(gc.getPlayer(iCiv1).getTeam()).isHasMet(gc.getActivePlayer().getTeam())
			and gc.getTeam(gc.getPlayer(iCiv2).getTeam()).isHasMet(gc.getActivePlayer().getTeam())
			and self.CIVAttitude[zKey] != zsNewAttitude
			and iCiv1 != gc.getGame().getActivePlayer()):
				zsCiv1 = gc.getPlayer(iCiv1).getName() + "(" + gc.getPlayer(iCiv1).getCivilizationShortDescription(0) + ")"
				zsCiv2 = gc.getPlayer(iCiv2).getName() + "(" + gc.getPlayer(iCiv2).getCivilizationShortDescription(0) + ")"
				message = "Attitude Change: %s towards %s, from '%s' to '%s'" % (zsCiv1, zsCiv2, self.CIVAttitude[zKey], zsNewAttitude)
				NewAutoLog.writeLog(12, message)
Code:
# dump attitude
for iCiv1 in range(0, ziMaxCiv, 1):
	for iCiv2 in range(0, ziMaxCiv, 1):
		[B]if iCiv1 == iCiv2:
			continue[/B]
		zsCiv1 = gc.getPlayer(iCiv1).getCivilizationAdjective(0)  #getCivilizationShortDescription(0)
		zsCiv2 = gc.getPlayer(iCiv2).getCivilizationAdjective(0)  #getCivilizationShortDescription(0)
		zsNewAttitude = gc.getAttitudeInfo(gc.getPlayer(iCiv1).AI_getAttitude(iCiv2)).getDescription()
		zKey = ziMaxCiv * iCiv1 + iCiv2
		message = "Attitude, %s, %s, %s, %s" % (zsCiv1, zsCiv2, self.CIVAttitude[zKey], zsNewAttitude)
		NewAutoLog.writeLog(1, message)


-Iustus
 
I updated the Sevopedia in Ruff's mod to version 2.2a. All options except 'Enabled' are fully dynamic, only the enabling/disabling of the Sevopedia requires a reload. I also made it work in any of MODS, CustomAssets, and CustomMods directories.



Ruff's Cobbled SG Modpack v. 2.0.4w with Sevopedia updated to 2.2a

@Ruff: Feel free to incorporate this into your next version.

P.S. Yeah, I know the last option is kind of pointless, you can comment the lines out for it in CvRuffModScreen.py if you want.
 
First, thanks Ruff and all those that helped put this together. I don't know how I enjoyed cIV before it! :goodjob:

Now, I started poking through the code to check out what modding in cIV is like, and I've added a couple items to the Exotic Foreign Advisor and fixed a bug. I see the bug has been addressed, but I wanted to know if the mod is being updated? If so I'll post the changes I've made.

On the info page:

* When human has same religion as an AI, a * is displayed next to the icon.

* Same thing when the player has the AI's favorite civic.

I wanted to make it so that the civic button is highlighted with a box when any civics are the same as the human, but I have had no success in finding API info for the graphics. How did people figure the calls out? Coming from Java I can guess how the panel stuff works, but some of the parameters are tough to guess ("False, False", "-1, -1"?). I found the wiki and other pages, but nothing describes this part of the API. Actually, I haven't found much of an API spec short of the argument types and names. Am I missing something?

Again, great mod!
 
@E-Fool, thx for the compliments. Yes, this mod is being updated but not in the past month or so. There is a bit of a list of outstanding items but RL and playing CIV have got in the way a bit.

Re the API - I have no idea. I'm the sort of modder who hacks about by copying code that is sort of close to what I want and going from there. When I get stuck, I post a question in the modders forum and get really good and quick responses.
 
...but I have had no success in finding API info for the graphics. How did people figure the calls out? Coming from Java I can guess how the panel stuff works, but some of the parameters are tough to guess ("False, False", "-1, -1"?). I found the wiki and other pages, but nothing describes this part of the API. Actually, I haven't found much of an API spec short of the argument types and names. Am I missing something?

You can look at Locutus's API, but he has not kept it up to date, and for most functions the info isn't that much better.
 
Glad to hear things are still progressing. Being a coder, it was hard to resist rewriting the code (to understand it and make it more legible) when I made changes, thus a diff will take a little more work to extract just the features I added, if you want them.

@Gaurav: I looked there and on the civ4wiki, but as I said all I could find were parameter types and sometimes names. More helpful than nothing, but the graphics calls are still pretty darn nebulous. :)
 
Glad to hear things are still progressing. Being a coder, it was hard to resist rewriting the code (to understand it and make it more legible) when I made changes, thus a diff will take a little more work to extract just the features I added, if you want them.
Feel free to post your version. I have a nifty program (beyond compare) that I can run against your version and my version. If I see too many changes, I'll just give up and leave it :D.
 
@Gaurav: I looked there and on the civ4wiki, but as I said all I could find were parameter types and sometimes names. More helpful than nothing, but the graphics calls are still pretty darn nebulous. :)
Yup. I've requested an update from Locutus at APolyton, and documention for CyGInterfaceScreen from Firaxis, but got no response for either. I generally just play around, and end up finding problems like this.
 
My changes are in CvExoticForeignAdvisor's drawInfo method. Here's the whole method for you diffing pleasure.
Code:
	def drawInfo (self, bInitial):
#		ExoticForPrint ("Entered drawInfo")

		screen = self.getScreen()

		# Get the Players
		objActivePlayer = gc.getPlayer(self.iActiveLeader)
					
		# Put everything inside a main panel, so we get vertical scrolling
		mainPanelName = self.getNextWidgetName()
		screen.addPanel(mainPanelName, "", "", True, True, 50, 100, self.W_SCREEN - 100, self.H_SCREEN - 200, PanelStyles.PANEL_STYLE_EMPTY)

		ltCivicOptions = range (gc.getNumCivicOptionInfos())

		# loop through all players and display leaderheads
		# Their leaderheads		
		for iLoopPlayer in range(gc.getMAX_PLAYERS()):
			objLoopPlayer = gc.getPlayer(iLoopPlayer)
			if (iLoopPlayer != self.iActiveLeader and objLoopPlayer.isAlive() and (gc.getTeam(objLoopPlayer.getTeam()).isHasMet(objActivePlayer.getTeam()) or gc.getGame().isDebugMode()) and not objLoopPlayer.isBarbarian() and not objLoopPlayer.isMinorCiv()):

				objLeaderHead = gc.getLeaderHeadInfo (objLoopPlayer.getLeaderType())

				# Player panel
				playerPanelName = self.getNextWidgetName()
				screen.attachPanel(mainPanelName, playerPanelName, objLoopPlayer.getName(), "", False, True, PanelStyles.PANEL_STYLE_MAIN)

#				screen.attachLabel(playerPanelName, "", "   ")

				screen.attachImageButton(playerPanelName, "", objLeaderHead.getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, -1, False)
						
				infoPanelName = self.getNextWidgetName()
				screen.attachPanel(playerPanelName, infoPanelName, "", "", False, False, PanelStyles.PANEL_STYLE_EMPTY)

				szPlayerReligion = ""
				if (objLoopPlayer.isStateReligion()):
					nReligion = objLoopPlayer.getStateReligion()
					objReligion = gc.getReligionInfo (nReligion)

#					religionName = self.getNextWidgetName()
					if (objLoopPlayer.hasHolyCity (nReligion)):
						szPlayerReligion = u"%c" %(objReligion.getHolyCityChar())
					elif objReligion:
						szPlayerReligion = u"%c" %(objReligion.getChar())

					if (objActivePlayer.isStateReligion() and nReligion == objActivePlayer.getStateReligion()):
						szPlayerReligion += " *"

				screen.attachTextGFC(infoPanelName, "", szPlayerReligion, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

				screen.attachTextGFC(infoPanelName, "", localText.getText("TXT_KEY_FOREIGN_ADVISOR_TRADE", (self.calculateTrade (self.iActiveLeader, iLoopPlayer), 0)), FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

				screen.attachTextGFC(infoPanelName, "", localText.getText("TXT_KEY_CIVICS_SCREEN_TITLE", ()) + ":", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

				for nCivicOption in ltCivicOptions:
					nCivic = objLoopPlayer.getCivics (nCivicOption)
					screen.attachImageButton (infoPanelName, "", gc.getCivicInfo (nCivic).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_CIVIC, nCivic, 1, False)
					
				nFavoriteCivic = objLeaderHead.getFavoriteCivic()
				screen.attachTextGFC(infoPanelName, "", localText.getText("TXT_KEY_PEDIA_FAV_CIVIC", ()) + ":", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
				objCivicInfo = gc.getCivicInfo (nFavoriteCivic)
				screen.attachImageButton (infoPanelName, "", objCivicInfo.getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_CIVIC, nFavoriteCivic, 1, False)
				screen.attachTextGFC(infoPanelName, "", "(" + gc.getCivicOptionInfo (objCivicInfo.getCivicOptionType()).getDescription() + ")", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
				
				if (objActivePlayer.isCivic (nFavoriteCivic)):
					screen.attachTextGFC(infoPanelName, "", "*", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
Main cleanup I did was to declare local variables like
Code:
objLoopPlayer = gc.getPlayer(iLoopPlayer)
so the code is easier to read. You can safely ignore those changes, but replace the var as appropriate.

First change is the bug fix for player religion as well as putting an asterisk after the icon if the AI has the same religion as the player.
Code:
szPlayerReligion = ""
if (objLoopPlayer.isStateReligion()):
	nReligion = objLoopPlayer.getStateReligion()
	objReligion = gc.getReligionInfo (nReligion)
	if (objLoopPlayer.hasHolyCity (nReligion)):
		szPlayerReligion = u"%c" %(objReligion.getHolyCityChar())
	elif objReligion:
		szPlayerReligion = u"%c" %(objReligion.getChar())

	if (objActivePlayer.isStateReligion() and nReligion == objActivePlayer.getStateReligion()):
		szPlayerReligion += " *"

screen.attachTextGFC(infoPanelName, "", szPlayerReligion, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
Next is adding an asterisk after the AI's favorite civic if the player is using it.
Code:
if (objActivePlayer.isCivic (nFavoriteCivic)):
	screen.attachTextGFC(infoPanelName, "", "*", FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
Enjoy!
 
Back
Top Bottom