Modmodding Q&A Thread

It serves as a guide for which civs are in close proximity to each other, just search for the variable to see what it affects.
 
I have a python exception here. Occur when I launch the client, at StoredData.py

Code:
        def save(self):
                """Pickles and saves script data"""
		gc.getPlayer(con.iBarbarian).setScriptData(pickle.dumps(self.scriptDict))
		#BugData.getTable("StoredData").setData(self.scriptDict)

It says Attribute error: 'NoneType' object has no attribute 'setScriptData'. I can't figure out what the problem is, because I didn't touched this part. Maybe the problem caused in consts.py?
 
You probably added a civilization and didn't adjust the player constants correctly.
 
Yes, follow the guide.
 
I followed guide and looking for error parts :scan:

I sure that the problem occurred in somewhere the civs are ordered Alphabetically, but...
Nah it's always hard to the simplest wrong one when you wrote it by yourself :(
 
It's not explicitly mentioned in the guide, but it should be obvious that the text keys have to be inserted in the right position according to the position of the new civilization in the civ info XML.
 
I didn't changed some text XML parts yet, but still client booting python error message is not related with that, is it?
 
Text keys can always be missing without problems, you will simply see the key instead of any actual text.
 
I have tried to run this mod on pitboss and I know that there's a gazillion of things that'll go wrong simply because the code wasn't written with multiplayer in mind.

I've dealt with one python exception (caused by selection of Egyptian settler on the beginning of 3000BC game if Egypt's human), but the next one appearing is wierd to me:

Code:
File "PbAdmin", line 56, in __init__
RuntimeError: unindentifiable C++ exception

and that line in PbAdmin.py is:

Code:
self.title = wx.StaticText(self, -1, PB.getGamename() + " - " + PB.getGamedate(False))

where line 13 is:
Code:
PB = CyPitboss()

I haven't been able to find what or where CyPitboss is at all. :confused:

Does this mod change behaviour of anything in the above mentioned lines?
I don't understand why or how is this happening.
 
Not written with multiplayer in mind is quite the understatement. The mod is just not capable of simultaneous multiplayer at all.

Honestly, I don't know where multiplayer compatibility is violated but it probably is in a lot of places. Most importantly, the autoplay mechanic assumes only one human player.

I wouldn't recommend trying to change that unless you want to do some extensive work in an area where I can't help you.
 
I am aware of all that, but I'll give it a try.

Anyways, the problem was in getGameDate which was messed up probably by RFC's lack of calendar at the beginning (I couldn't really tell because CyPitBoss source is inaccessible) so that had to be replaced and the exception is gone.
 
In Plague.py lines 327-330:
Code:
                #deadly plague when human player isn't born yet, will speed up the loading
                if (gc.getGame().getGameTurn() < getTurnForYear(con.tBirth[utils.getHumanID()] + utils.getTurns(20))):
                        iDamage += 10
                        baseValue -= 5

What is exactly happening here? tBirth is in years, and getTurns is in turns and then they're added together? That makes the interval for deadly plague on standard speed [-3000, human player birth year + 20 years)? This doesn't seem like check whether human player is born.
 
You're right, there is a bracketing error, this is what it should look like:
Code:
                #deadly plague when human player isn't born yet, will speed up the loading
                if (gc.getGame().getGameTurn() < getTurnForYear(con.tBirth[utils.getHumanID()]) + utils.getTurns(20)):
                        iDamage += 10
                        baseValue -= 5
Correction will come with the next commit.
 
What do getCheatersCheck and setCheatersCheck in RiseAndFall.py do? I tried searching through all Python files but only found that they're used for storing and retrieving some data related to initMinorBetrayal but I don't understand what they do and when.
 
Don't know either.
 
It'll be great if you can explain a bit about how the game handle errors. You mentioned earlier somewhere iirc that if there's something wrong in a Python file, the worst it can happen is Python exception. What usually cause CTD?
 
Any error in the C++ code, missing graphics ...
 
Python code can call C++ methods obviously, but beyond that afaik not.
 
Top Bottom