Modmodding Q&A Thread

In my mod, I get the following exception during autoplay:
Code:
Traceback (most recent call last):
  File "CvScreensInterface", line 693, in forceScreenRedraw
  File "CvMainInterface", line 1320, in redraw
  File "CvMainInterface", line 5327, in updateScoreStrings
  File "Scoreboard", line 369, in draw
  File "Scoreboard", line 347, in sort
  File "Scoreboard", line 347, in <lambda>
  File "Scoreboard", line 580, in sortKey
  File "Scoreboard", line 521, in rank
AttributeError: 'NoneType' object has no attribute 'rank'
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
Line 521 is the 3rd line in the following code:
Code:
    def rank(self):
        if self.isVassal():
            return self._master.rank()
        else:
            return self._rank
The error seems that when computing the score of a vassal, the game can't find the master, so the variable has NoneType and causes a cascade of mistakes. The exception happens dozens if not hundreds of times. It doesn't seem directly related to any changes I made (though I'm sure it is).

I saw the problem mentioned ion the forums, but didn't find a solution. Is anyone familiar with the problem?
 
I'm getting a really weird error.
Any civ spawning is creating 1 archer which appears in the bottom left hand part of the map. This error does not effect civs which are present at the start of the game.
Changes I have made recently:
-Changed the start date
-Changed the order of the civs
-Changed which civ is the first to spawn after the original starting civs.

I'm stumped at the moment. :confused:
 
In my mod, I get the following exception during autoplay:
Code:
Traceback (most recent call last):
  File "CvScreensInterface", line 693, in forceScreenRedraw
  File "CvMainInterface", line 1320, in redraw
  File "CvMainInterface", line 5327, in updateScoreStrings
  File "Scoreboard", line 369, in draw
  File "Scoreboard", line 347, in sort
  File "Scoreboard", line 347, in <lambda>
  File "Scoreboard", line 580, in sortKey
  File "Scoreboard", line 521, in rank
AttributeError: 'NoneType' object has no attribute 'rank'
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
Line 521 is the 3rd line in the following code:
Code:
    def rank(self):
        if self.isVassal():
            return self._master.rank()
        else:
            return self._rank
The error seems that when computing the score of a vassal, the game can't find the master, so the variable has NoneType and causes a cascade of mistakes. The exception happens dozens if not hundreds of times. It doesn't seem directly related to any changes I made (though I'm sure it is).

I saw the problem mentioned ion the forums, but didn't find a solution. Is anyone familiar with the problem?
It's likely that this is because you can contact the vassal and not the master, or vice versa.

I'm getting a really weird error.
Any civ spawning is creating 1 archer which appears in the bottom left hand part of the map. This error does not effect civs which are present at the start of the game.
Changes I have made recently:
-Changed the start date
-Changed the order of the civs
-Changed which civ is the first to spawn after the original starting civs.

I'm stumped at the moment. :confused:
Have you enabled Python exceptions? Looks like the Archer is equivalent to the Catapult in RFC.
 
Have you enabled Python exceptions? Looks like the Archer is equivalent to the Catapult in RFC.

Yeah python exceptions are enabled, but no errors are appearing. It just seems to be ignoring the create starting units function, and just giving me that random archer for every spawning civ.
 
It's likely that this is because you can contact the vassal and not the master, or vice versa.
Forgot to say that this happens during autoplay (for Israel, and it usually starts happening in the late 1800s). What you're saying makes sense, maybe it's related to the fact that some civs appear to be contacted during autoplay? I.e. sometimes it says something like "Netherlands is willing to open borders" during autoplay for some reason.
 
That could explain it. If that's the case, it is probably an existing bug in DoC that is just much more likely to be triggered for Israel, with the length of its autoplay and vicinity to other civs.
 
That is my suspicion as well. In any case, the problem seemingly vanished when I changed
Code:
if self.isVassal():
to
Code:
if self.isVassal() and self._master is not None:
.
 
That's probably a good fix.
 
So I worked out what was causing the problem with the spawning. It screwed up when I changed the date way points so that the mod ran for 500 turns instead of 375. Changing it back to 375 turns fixed the problem. However I still want the mod to run for 500 turns, so how can I extend the run time of a rhys and fall mod without screwing up the spawns!?
 
I don't have enough working knowledge about an old fashioned RFC mod to say, honestly I'm starting to feel uncomfortable answering a bunch of questions that are not even about this mod.
 
Fair enough, I will stop bugging you.
 
Question: Where can I adjust the tendency of each civ to use the culture slider?
 
There has been a commit a while ago when I addressed Chinese balance where I did that, look it up.
 
Found it, thanks!
 
Question: Where can I adjust the tendency of each civ to use the culture slider?
Working on something?

Also, can someone help me figure out why I'm getting this error:

Code:
Traceback (most recent call last):
  File "BugConfig", line 110, in unknown_endtag
  File "BugConfig", line 334, in endChild
  File "BugConfig", line 337, in end
  File "BugConfig", line 318, in process
  File "BugOptions", line 1482, in handle
  File "BugUtil", line 642, in getFunction
  File "BugUtil", line 629, in lookupFunction
  File "BugUtil", line 623, in lookupModule
ConfigError: No such module 'BugUpdateChecker'
Traceback (most recent call last):
  File "BugConfig", line 110, in unknown_endtag
  File "BugConfig", line 334, in endChild
  File "BugConfig", line 337, in end
  File "BugConfig", line 318, in process
  File "BugOptions", line 1482, in handle
  File "BugUtil", line 642, in getFunction
  File "BugUtil", line 631, in lookupFunction
ConfigError: Module 'BugUpdateChecker' must define function or class 'onLocalRootChanged'
Traceback (most recent call last):
  File "BugConfig", line 110, in unknown_endtag
  File "BugConfig", line 334, in endChild
  File "BugConfig", line 337, in end
  File "BugConfig", line 318, in process
  File "BugOptions", line 1482, in handle
  File "BugUtil", line 642, in getFunction
  File "BugUtil", line 631, in lookupFunction
ConfigError: Module 'BugUpdateChecker' must define function or class 'onRepositoryUrlChanged'

I thought that maybe BugUpdateChecker.py was accidentally deleted but nope, it's there.
 
Did you edit anything in its vicinity? It seems that BugUpdateChecker needs to implement some sort of interface that requires these functions.
 
Working on something?

Yeah. Trying to nerf AI civs that tend to tech too fast without adjusting tech costs or era modifiers. They're mostly civs that get a lot of commerce through trade routes and/or those that usually do cottage spam. I just wanted to see if it helps balance the game.
 
Looking at the contact part of LeaderHeadInfos XML. Does this indicate the likelihood that the AI civ will initiate contact for each situation? And does a higher number mean more or less likely?

Spoiler :

<ContactRands>
<ContactRand>
<ContactType>CONTACT_RELIGION_PRESSURE</ContactType>
<iContactRand>100</iContactRand>
</ContactRand>
 
Back
Top Bottom