Help with RuntimeError: unidentifiable C++ exception

RogerBacon

King
Joined
Nov 16, 2003
Messages
649
I get a "RuntimeError: unidentifiable C++ exception" with this code (but it seems to work fine):

myCivName = pPlayer.getCivilizationDescriptionKey()
message1 = myCivName
#CyInterface().addImmediateMessage(message1,"")
CvUtil.pyPrint(message1)

The first line is where the error is reported.

Roger Bacon
 
So the code works, but you get an exception? That's strange. If you check the python error logs they can often be slightly more informative than the in-game ones.

What is pPlayer defined as?
 
Yeah, the code definately works. The error message is in PythonErr2.log

Here is the code where pPlayer is defined:

def onBeginGameTurn(self, argsList):
'Called at the beginning of a game turn'
iPlayer = argsList
for iPlayer in range(gc.getMAX_PLAYERS()):
pPlayer = gc.getPlayer(iPlayer)

pPlayer.getCivilizationDescriptionKey() returns TXT_KEY_CIV_JAPAN_DESC so I know it is working. I have no idea why it gives an error... and such a strange error.

Roger Bacon
 
Back
Top Bottom