Modmodding Q&A Thread

I was thinking of just editing the code so that Khmer farms on Rainforest are built twice as fast as normal, though this is a nice backup. Does anyone know where improvement build time is calculated and/or incremented?
CvPlot::getBuildTime

Also, just noticed I placed these in the omg thread and not the modmodding thread. Oops.

EDIT: Thanks!
 
Last edited:
AI Egypt has been improving their Stone with a Farm, only to improve it with a Quarry once they get Masonry. Where is the code that calculates the AI desire to build an improvement on a plot?
 
CvCityAI::AI_updateBestBuild(). Good luck.
 
I'm getting an ascii codec can't decode by at position 10 error on the line

Code:
    lAfter = [sName for sName in lNames[iOffset:] if not gc.getGame().isGreatPersonBorn(sName)]

Does anyone have any idea what could be causing it? I only ever touched the GreatPeople.py file while merging other mods into my own
 
When I use the move city feature in WorldBuilder in the 600 AD scenario, the name comes up as Fenghao, when my code should make it come up as Daxing. What did I do wrong?

Code:
# classical
{
    'Fenghao'        :    "Daxing",
 
The worldbuilder uses the getFoundName(). That function uses the cnm-maps and doesn't use the renames.

EDIT:
But I spotted a bug in a function. Will make a PR.
 
Last edited:
The worldbuilder uses the getFoundName(). That function uses the cnm-maps and doesn't use the renames.

EDIT:
But I spotted a bug in a function. Will make a PR.
How can I test if I did everything with the renames right then?
 
tTradingCompanyPlotLists in Consts.py is where I add cities to a trading company conquers, right? Just making sure in case I read the code wrong.
 
I'm running into a division by zero error after I added Polynesia to the 600 AD Starting Techs Array. Could someone give me the steps on adding a civ's starting techs to a scenario to see if I missed something?
 
Is it possible to brindle the initial spread of a religion from python?

I tried regions, but it doesn't work for Judaism. When it is founed sometimes it spreads to all cities, even if their region factor is iNone.
 
It is possible, but you have to turgle it first. I would love to eventually unturgle the code in Python but without scrungus support in the DLL that's not possible at the moment.
 
It is possible, but you have to turgle it first. I would love to eventually unturgle the code in Python but without scrungus support in the DLL that's not possible at the moment.
The current conversation aside, what are the steps for adding an existing civ to a later scenario? I'm trying to add polynesia but I'm getting
Spoiler :

Code:
Traceback (most recent call last):

  File "CvWBInterface", line 47, in applyInitialItems

  File "CvWBDesc", line 2028, in applyInitialItems

  File "CvWBDesc", line 1676, in applyCity

  File "CvWBDesc", line 1342, in apply

RuntimeError: unidentifiable C++ exception
ERR: Python function applyInitialItems failed, module CvWBInterface
Traceback (most recent call last):

  File "BugUtil", line 691, in <lambda>

  File "BugEventManager", line 706, in preGameStart

  File "CvAppInterface", line 74, in preGameStart

  File "CvScreensInterface", line 106, in showMainInterface

  File "CvMainInterface", line 463, in interfaceScreen

  File "CvMainInterface", line 377, in initState

  File "PLE", line 180, in PLE_CalcConstants

  File "PLE", line 851, in getMaxRow

ZeroDivisionError: integer division or modulo by zero
ERR: Python function preGameStart failed, module CvAppInterface
Traceback (most recent call last):
  File "BugEventManager", line 400, in _handleDefaultEvent
  File "CvRFCEventHandler", line 104, in onGameStart
  File "RiseAndFall", line 236, in setup
  File "RiseAndFall", line 261, in initScenario
  File "Civilizations", line 44, in initScenarioTechs
  File "Civilizations", line 53, in initTechs
  File "Civilizations", line 59, in initTech
RuntimeError: unidentifiable C++ exception



regardless of whether or not Polynesia's 600 AD Techs have been set in Civilizations.py
 
I am sorry if this is rude, but I do not understand why no one has responded. I would really appreciate some help.
 
The division by 0 error seems to be stemming from: Leverage? Wat? I end up getting the tech in game, so the error seems to be occurring after the fact.

EDIT: When I lowered the column to 1, I'm now getting the error from Sailing, I think this is a trade route related error.
 
Last edited:
I accidentally placed one of my cities on an Ice Tile. Whoops! Nevermind my incessant pestering for help.
 
I am sorry if this is rude, but I do not understand why no one has responded. I would really appreciate some help.
I have no idea what is wrong there, and I suppose nobody else does either. No point in posting if you have nothing to contribute.
 
I have no idea what is wrong there, and I suppose nobody else does either. No point in posting if you have nothing to contribute.
Was this really necessary? You posted 2 hours after I found the fix.
 
Yes. It's not appropriate to pester/guilt trip people who are subscribed to a thread and get notified every time a post is made. Same goes for triple posting, by the way. If you had deleted the post or edited out the repeated request after it has become obsolete this wouldn't even have been necessary.
 
Yes. It's not appropriate to pester/guilt trip people who are subscribed to a thread and get notified every time a post is made. Same goes for triple posting, by the way. If you had deleted the post or edited out the repeated request after it has become obsolete this wouldn't even have been necessary.
I'm sorry. I didn't mean to guilt trip anyone, though I was aware that I was pestering. My actions were inexcusable. I am absurdly sorry.

As for why I did not delete or edit the request out of the post, I prefer not to delete my posts if I make a mistake. I hate when people delete a post they made because it's offensive or because they no longer agree with what they said. If someone made a mistake they should accept it and learn from it, not shove it under the rug and pretend it never happened.
 
Top Bottom