Python Interpretation

tlucky4life

Sachem
Joined
Jan 5, 2003
Messages
105
Location
Shawnee
Hello I am combining two mods, my flavor units and erubius's religion mod. My mod has no python add-ins in it, Erubuses mod does. I have semi successfully combined the two. I have gotten my frankenstien into the actual game however I get a python error message after each turn. I dont speak python yet and was wondering if anyone could be my translator and piont me in the right direction. Here is the error message.

Traceback (most recent call last)

File"CvGameInterface"' line 178, in AI_doDiplo
File "TPGameUtils", line 197, in AI_doDiplo

Attribute Error ; 'CyGlobal Context', object has no attribute 'Cygame'

Any help would be highly apriciated
 
tlucky4life said:
Hello I am combining two mods, my flavor units and erubius's religion mod. My mod has no python add-ins in it, Erubuses mod does. I have semi successfully combined the two. I have gotten my frankenstien into the actual game however I get a python error message after each turn. I dont speak python yet and was wondering if anyone could be my translator and piont me in the right direction. Here is the error message.

Traceback (most recent call last)

File"CvGameInterface"' line 178, in AI_doDiplo
File "TPGameUtils", line 197, in AI_doDiplo

Attribute Error ; 'CyGlobal Context', object has no attribute 'Cygame'

Any help would be highly apriciated

Find the TPGameUtils.py file, and open it up (preferably with an editter that show line numbers at that allow you to jump to a specific line number).

Go to line 197, and find find out what it says. If you can't figure out the error from that, then post that area of the code here.
 
Thanks for the fast reply The error message starts out EXEPTION

Here is the TPGameUtils line 191 the error was a 191 not 197

# Having some problems with this getting called early in the game.
if (gc.CyGame().getGameTurn() < 3):
return False


The last line is line 191

Here is the CvGame Interface line 178

def AI_doDiplo(argsList):
'AI decides does diplomacy for the turn - return 0 to let AI handle it, return 1 to say that the move is handled in python '
#CvUtil.pyPrint( "CvGameInterface.AI_doDiplo" )
return gameUtils().AI_doDiplo(argsList)

The line that starts 'AI is line 178 These are verbatum, I feal like a giant in a glass house in python
 
tlucky4life said:
Thanks for the fast reply The error message starts out EXEPTION

Here is the TPGameUtils line 191 the error was a 191 not 197

# Having some problems with this getting called early in the game.
if (gc.CyGame().getGameTurn() < 3):
return False

Try changing it from gc.CyGame() to gc.getGame(). Alternatively, turn it all into just CyGame(). So, either do one of these two:

Code:
if (gc.getGame().getGameTurn() < 3):

Code:
if (CyGame().getGameTurn() < 3):

Is that actually part of the mod? If so, it should be giving the original mod-maker errors as well, unless for some reason that code is never being called by the original mod.
 
I tryed them both and after three turns I got the same error message.


Exception

Traceback

File CvGameinterface line 178
File TPGameUtils 217
File "ewr" line308 in __ne__

Attribute error NoneType object has no attribute 'iReligionID'

Thanks for the help on this
 
tlucky4life said:
I tryed them both and after three turns I got the same error message.


Exception

Traceback

File CvGameinterface line 178
File TPGameUtils 217
File "ewr" line308 in __ne__

Attribute error NoneType object has no attribute 'iReligionID'

Thanks for the help on this

This is not the same error message. It's on a different line and gives a different output. It's a differenet problem altogether.

There's once again a problem with the code, only this time it's not a simple Syntax error. You are best to see if you can get support from the mod maker.
 
Back
Top Bottom