Religious Advisor Screen NOT Showing Influence Problem!!!

The Capo

godless Heathen
Joined
Jan 29, 2001
Messages
9,302
Location
Washington, DC
I am working on this mod, and I added some religions to it and now the Influences of all the religions don't show. Does anybody know why?

I have attatched an image showing it, there is a slot for Influence and it says Influence: on the left-hand side but nothing shows up, and I added the yellow box myself, that doesn't show up in the game.
 
The only thing I can tell you is to look for Python Errors. If you don't have any, then add a bunch of debug print statements to CvReligionScreen.py near the part where it displays the influence to see what's happening.
 
Yeah, that's the strangest part is that I am NOT getting any python errors, otherwise I would have posted them up. I will say this though, and I don't know much about python so maybe this has something to do with it but I can't see how it would; these extra religions are only available under the "choose religion" option, but the vanilla ones (in this case Islam, Judaism, Christianity and Confucianism) don't show the influence either. And I didn't produce this from worldbuilder or even use worldbuilder at all (someone suggested that to me) this is a straight up normal game. Also there are no other issues with the screen, everything else shows up just as it should. It even has a slot that says "Influence:" but nothing shows up in that row. Its very strange. I mean it doesn't effect gameplay, but it does suck to not see the influence. I could post up the python file and maybe someone could take a look at it for me. I'll do that tomorrow, I'm not at home right now.
 
Here is the python file; I got no error messages from this so I'm not sure exactly why it doesn't work. If anybody could help me figure this out that would be great. The problem is that the Influence doesn't show up.
 
Your indentation under the influence section is a little odd (particularly the position of the xLoop line) and some of the statements are commented out. Compare yours:
Code:
		# Influence...
		screen.setLabelAt("", "CivicList", localText.getText("TXT_KEY_RELIGION_SCREEN_INFLUENCE", ()), CvUtil.FONT_LEFT_JUSTIFY, self.LEFT_EDGE_TEXT, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		xLoop = self.X_RELIGION_START
		for i in range(gc.getNumReligionInfos()):
			if (gc.getGame().getReligionGameTurnFounded(i) >= 0):
				#szFounded = "0%"
				#else:
				szFounded = str(gc.getGame().calculateReligionPercent(i)) + "%"
			#screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
				xLoop += self.DX_RELIGION
			
		szFounded = "-"
		screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

with the original BTS 3.17:
Code:
		# Influence...
		screen.setLabelAt("", szArea, localText.getText("TXT_KEY_RELIGION_SCREEN_INFLUENCE", ()), CvUtil.FONT_LEFT_JUSTIFY, self.LEFT_EDGE_TEXT, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		xLoop = self.X_RELIGION_START
		for i in range(gc.getNumReligionInfos()):
			if (gc.getGame().getReligionGameTurnFounded(i) < 0):
				szFounded = "0%"
			else:
				szFounded = str(gc.getGame().calculateReligionPercent(i)) + "%"
			screen.setLabelAt("", szArea, szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
			xLoop += self.DX_RELIGION
			
		szFounded = "-"
		screen.setLabelAt("", szArea, szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
I would try using the original code (or at least the original loop logic) in that section.
 
Thanks for helping me out, I didn't make the Python code myself so I didn't want to toy with anything, mainly because I don't know any of it really. I'll see if what you are saying works.
 
Code:
               # Influence...
		screen.setLabelAt("", "CivicList", localText.getText("TXT_KEY_RELIGION_SCREEN_INFLUENCE", ()), CvUtil.FONT_LEFT_JUSTIFY, self.LEFT_EDGE_TEXT, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		xLoop = self.X_RELIGION_START
		for i in range(gc.getNumReligionInfos()):
			if (gc.getGame().getReligionGameTurnFounded(i) >= 0):
				#szFounded = "0%"
				#else:
				szFounded = str(gc.getGame().calculateReligionPercent(i)) + "%"
			#screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
				xLoop += self.DX_RELIGION
			
		szFounded = "-"
		screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

You commented out the lines for the text for the influence that is why.
Why are you not using what I made originally? Are you trying to add something new to the screen? I put my latest one here from the WoC.
 
Just to make sure, because I am not a modder, I just play Diplogames and I endeavored to make this mod for the Diplogaming CivGroup (over at Apolyton). I'm going to replace it with yours and see what happens, thanks.

And I just used the one from the JARM download, that's probably why this happened.
 
Alright Johnny, I used your file and the percentages showed up but, now all of the logos appear and since there are no greyscale images of my images this was the result...
 
I'm going to try and ONLY change the code on the part dresden suggested, and I'll tell you what happened. I'd rather not have the long litany of religions and just show the ones that were founded.
 
Hmmm, well Dresden's idea didn't work either. Its the same as before. Here is what happened. BTW I didn't plan on Judaism and Islam being founded first/together, but that's just how it worked out, this isn't a political statement in case anyone is wondering.

Any other ideas?
 
Maybe it will help if I showed you what it looks like now in the influence portion of the python file:

Code:
		# Influence...
		screen.setLabelAt("", szArea, localText.getText("TXT_KEY_RELIGION_SCREEN_INFLUENCE", ()), CvUtil.FONT_LEFT_JUSTIFY, self.LEFT_EDGE_TEXT, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		xLoop = self.X_RELIGION_START
		for i in range(gc.getNumReligionInfos()):
			if (gc.getGame().getReligionGameTurnFounded(i) < 0):
				szFounded = "0%"
			else:
				szFounded = str(gc.getGame().calculateReligionPercent(i)) + "%"
			screen.setLabelAt("", szArea, szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
			xLoop += self.DX_RELIGION
			
		szFounded = "-"
		screen.setLabelAt("", szArea, szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		self.iReligionSelected = gc.getPlayer(self.iActivePlayer).getStateReligion()
		if (self.iReligionSelected == -1):
			self.iReligionSelected = gc.getNumReligionInfos()
		self.iReligionExamined = self.iReligionSelected
		self.iReligionOriginal = self.iReligionSelected

So that is what it looks like now, I've also attatched the file as well in cause you need to look at the whole thing. I've been working hard on this mod so I really appreciate you guys for helping out.
 
I did not know you were wanting to add something sorry. Well I think EusebiusWorldReligion-Revival mod displays only the ones you can select, but I did not look more into it. It took me quite a while to figure out a way to get the screen to scroll so I am no expert by no means. I may look more into when I can.
 
No, its not that I want to add something. Let me explain this; I used the Just Another Religion Mod in my mod. I noticed the religious influences were not showing up in my mod. So I asked on their thread what was going on. They said "I don't know, JohnySmith made the python," so basically it is YOUR python. I don't want to add anything to it, I just want the influences to show up.
 
Well I am confused a little still. Do you just want grey images when religions are not founded or do you want the religions to not show at all on the screen when not founded? Grey images are really easy just desaturate an image then next save as the same name as before with a "_d" added to the end. Not showing when not founded of course will need some changes to the code.

Oh and the JARM changed that on my screen. I did not create for them the screen they just used what I had and altered it.
 
Okay, I get it now Johny; you actually didn't work with them they just used your code. And yes, I just want the religion to show when it is founded (although I didn't know about the saturation part), because I think its too much to have 14 religions up there. Anyway I managed to fix the issue and I figured I might as well post it up here.

Basically certain portions of the code do need to be commented out, but not all of them. THIS is what it should look like to work properly;

Code:
		# Influence...
		screen.setLabelAt("", "CivicList", localText.getText("TXT_KEY_RELIGION_SCREEN_INFLUENCE", ()), CvUtil.FONT_LEFT_JUSTIFY, self.LEFT_EDGE_TEXT, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		xLoop = self.X_RELIGION_START
		for i in range(gc.getNumReligionInfos()):
			if (gc.getGame().getReligionGameTurnFounded(i) >= 0):
				szFounded = "0%"
			#else:
				#szFounded = str(gc.getGame().calculateReligionPercent(i)) + "%"
				screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
				xLoop += self.DX_RELIGION
			
		szFounded = "-"
		screen.setLabelAt("", "CivicList", szFounded, CvUtil.FONT_CENTER_JUSTIFY, xLoop, self.Y_INFLUENCE, self.DZ, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		self.iReligionSelected = gc.getPlayer(self.iActivePlayer).getStateReligion()
		if (self.iReligionSelected == -1):
			self.iReligionSelected = gc.getNumReligionInfos()
		self.iReligionExamined = self.iReligionSelected
		self.iReligionOriginal = self.iReligionSelected

Notice the parts I commented out. If you do that not only will the influences show up but you will also only get the religions pop up when they are founded.

Thank you JohnySmith for helping me out, I really appreciate it and I will certainly give you a shout-out in the readme of the mod.

Here's an attatchment that shows what the screen looks like with the small little change made above.
 
I may use the code myself because I am working on 94 religions and it will help a lot to not show them if not founded. I could use that on the corporation screen as well. Well good that you figured it out and hope your mod goes well.
 
Well false alarm!

Apparently it just stays at 0% the whole time. Can you tell by looking at the code why? Because I don't know what I'm doing apparently.
 
I have it showing influence but the background behind the religions is still an issue I am looking at now.



 
Top Bottom