View Full Version : python error(s) help


antaine
Jan 26, 2010, 10:11 AM
I've come up with a recompiled mod of Rhye's that functions, but has some bugs. It's returning the following errors on every turn. I'm not sure what I'm supposed to adjust to fix them:

-------------------------------

Traceback (most recent call last):

File "CvEventInterface", line 23, in onEvent

File "CvRFCEventManager", line 108, in handleEvent

File "CvRFCEventManager", line 119 in_handleDefaultEvent

File "CvRFCEventHandler", line 434, in onBeginGameTurn

File "Barbs", line 284, in checkTurn

TypeError: foundCity() takes exactly 8 arguments (7 given)

---------------------------------------



I've attached those files in txt format. Can anyone more experienced than I have a looksee and maybe figure out what I've got wrong?

Baldyr
Jan 26, 2010, 11:33 AM
This one was actually easy. :D

You forgot the Civ (iCarthage I assume in this case). Line 284 in barbs.py should read:
self.foundCity(iCarthage, lDublin, "Áth Cliath", iGameTurn, 1, -1, -1)
It could of course be iIndependent or iBarbarian, depending on what you're trying to do.

The code lists all the required variables on line 305.

edit: Once again, the other files should have nothing to do with the problem itself.

embryodead
Jan 26, 2010, 11:43 AM
For future ref. so that you can find it on your own - in such error messages, the error is triggered in the last file shown. The message tells you: Barbs.py, line 284, foundCity() is missing 1 argument (those are the parameters inside parentheses).

If you look at line 284 and compare it to other calls of the same function, e.g. line 286, you will see the first argument (player ID) is missing.

EDIT: Crosspost

Baldyr
Jan 26, 2010, 12:05 PM
It is also possible that the malfunctioning barbs.py file has disabled the rest of the Python in your modmod. Make sure everything else works ok (like stability or rise'n'fall) once you get rid of the error messages!

antaine
Jan 26, 2010, 03:17 PM
yup, that was it. Thanks.