Critical Error with Diplomacy Screen

deanej

Deity
Joined
Apr 8, 2006
Messages
4,859
Location
New York State
In my Star Trek mod I have a critical bug in the diplo interface that makes it impossible to demand resources out of vassals. When I select one of their resources, I get the following python exception:

Traceback (most recent call last):

File "CvDiplomacyInterface", line 42, in refresh

File "CvDiplomacy", line 210, in determineResponses

File "CvDiplomacy", line 315, in addUserComment

File "CvDiplomacy", line 394, in getDiplomacyComment

RuntimeError: Access violation - no RTTI data!
ERR: Python function refresh failed, module CvDiplomacyInterface

The only option available is to ask "what would make this deal work?"; there is no option to demand. What the heck is going on here and how can I fix it?
 
RTTI stands for RunTime Type Identification. In Python, C++, and other object oriented languages, each object has a small piece of data that identifies what type of object it is so that you can call the right functions on it.

What is on line 394 of your CvDiplomacy.py? The reason you only see some options is that the drawing code aborts as soon as it hits an exception that isn't handled. The game doesn't crash (thanks Python!); instead it just drops back to the event handling code so you can click what did get drawn.
 
I have seen this RTTI message with diplomacy before. Of course the message may come for any number of reasons. You probably know that each diplomacy text can be restricted to a single leaderhead; a lot of the initial contact messages are like this. The game takes the leaderhead name and then makes a list of all the possible texts of the right type. which are either unrestricted or apply to that leaderhead, and then randomly picks one. I have seen this message before when that list is empty, either there are no messages of the type, or they are all restricted to another leaderhead.

Might either of those apply in your case?
 
I don't think so. What's missing is the button to demand tribute. Since leaders don't say anything when you are just selecting a resource (do they? I've never demanded resources from a vassal before this test) I don't think that's the issue.

I've included the method in CvDiplomacy around line 394 (with line 394 in bold); it's the base BtS file since I didn't modify it.

Code:
	def getDiplomacyComment (self, eComment):
		"Function to get the user String"
		debugString = "CvDiplomacy.getDiplomacyComment: %s" %(eComment,)
		eComment = int(eComment)
		if DebugLogging:
			print debugString, eComment
		
		szString = ""
		szFailString = "Error***: No string found for eComment: %s"
		
		[B]if ( gc.getDiplomacyInfo(eComment) ):[/B]
			DiplomacyTextInfo = gc.getDiplomacyInfo(eComment)
			if ( not DiplomacyTextInfo ):
				print "%s IS AN INVALID DIPLOCOMMENT" %(eComment,)
				CvUtil.pyAssert(True, "CvDiplomacy.getDiplomacyComment: %s does not have a DiplomacyTextInfo" %(eComment,))
				return szFailString %(eComment,)
			
			szString = self.filterUserResponse(DiplomacyTextInfo)
			
		else:
			szString = szFailString %(eComment,)
		
		return szString
 
Do you get the error when you click on the resource to be demanded? Is this a resource you've added? Make sure all the XML text entries and art are set up correctly.
 
Yes. All of the resources are Final Frontier resources, though some have name changes and one has an art change. All text appears to be correct, I think the art is correct (it's the radiation model with a color change). It appears that the problem occurs when the game tries to get the "It's time for tribute, refusal means war" text.
 
It appears that the problem occurs when the game tries to get the "It's time for tribute, refusal means war" text.

Ah, yes. The options in the center change as soon as you pull down the first resource because when the list is empty you can't demand anything yet.
 
I'd start by validating everything about the resources you've added including their text keys and artwork.
 
How do you make sure a GameFont.tga file is 100% correct if all the icons appear to display fine?).

If they show up, it's fine. I can't think of anything else to try. This code is in the EXE so it's hard to diagnose. :(
 
Top Bottom