Modmodding Q&A Thread

Thanks Leoreth, that was a lot of help!

I think I got it done with Python event handlers for religion spread and acquired/lost Jewish cities (I still need to test though). But there's no event handler for opening/closing borders. Should I create one? (not that I know how). Or should I handle this in the DLL somewhere?
 
You're right, there currently is no event handler for diplomacy events, including open borders. If you want to create one, you need to do so in the DLL. You can work yourself through the process from one of the existing examples in CvEventReporter.cpp. Or you just implement the effect directly in the DLL.
 
Awesome, I made new event handlers and now it all works! Expect a beta release of the Israel modmod sometime soon, depending on how much playtesting I feel like doing.
 
That's great!
 
Yes, it would be great if everyone could bring their additional civ modules up to date with 1.15 after the release.
 
I have a weird bug in my mod. Upon loading the 600 AD scenario as China, I found that Xi'an has an edubba and an airport instead of a taixue and a forge. (The edubba appears right before the taixue, and the airport right before the forge, in the Buildings XML.) It's weird because the 600 AD scenario map correctly lists the forge and taixue on the Xi'an plot, and no other city or scenario is affected as far as I'm aware. In every other respect that I've seen, the buildings are correct.

Has anyone encountered something like this or does anyone have an idea what's going on?
 
Did you perhaps add a new building without editing Consts?
 
Did you perhaps add a new building without editing Consts?

Thanks, that wasn't the problem, but it led me to double-check and find that the building I added was misplaced within the list of constants, and that did it.
 
This may have been answered already, but for 1.14, what do I need to change so the human player always collapses to the core rather than gets defeated? I like to play the ancient civs and lead them through the ups and downs, including rebuilding the empire after collapse.

Additonally, what do I need to change so civs like Harappa and Polynesia spawn in games where they aren't player civs?
 
Additonally, what do I need to change so civs like Harappa and Polynesia spawn in games where they aren't player civs?

Change values of PLAYER_OCCURRENCE_HARRAPA and PLAYER_OCCURRENCE_POLYNESIA in ...\Assets\XML\GlobalDefinesAlt.xml from 0 to 1.
 
For the first question, I suggest you just run a diff with e.g. Winmerge on Stability.py to see the required changes.
 
I'm trying to merge two of Merjin's civ modmods, and have been running into the following error whenever I start a scenario:

Code:
Traceback (most recent call last):
  File "BugEventManager", line 400, in _handleDefaultEvent
  File "CvRFCEventHandler", line 112, in onGameStart
  File "Modifiers", line 41, in init
  File "Modifiers", line 37, in updateModifiers
  File "Modifiers", line 33, in updateModifier
  File "Modifiers", line 5, in getModifier
AttributeError: 'NoneType' object has no attribute 'getCivilizationType'

I'm currently trying to figure out what's causing this, though if anyone already knows what the cause is that'd help very much.

EDIT: I realized that since they both add a single civ, they probably both changed the MAX CIVs variable in CvDefines.h to 50 without any conflict, going to increase it to 51 and see if it works now.

Speaking of adding civs, I heard there's currently a maximum in the number of players, what exactly is that maximum?

EDIT2: The error is still occurring, pushing edits now

EDIT3: Apparently I forgot to increment the value I was talking about, no idea how that happened.

EDIT4: Even after changing MAX_CIV_PLAYERS to 51 I'm still getting the error.
 
Last edited:
The maximum is the one defined in the DLL.
 
Just an update saying that I'm absolutely stumped, I have zero idea what's causing this error.

I've gone through Leoreth's guide to adding civs to the game just in case I missed something, and unless I missed something I'm pretty sure I didn't miss a step.
 
I'm trying to merge the Israel mod now but have run into a crash when launching the 1700 AD scenario, I used to have the same issue with 600AD but I fixed it without realizing. The merge attempt is currently on the AllCivs branch, because I didn't notice I didn't click the TESTING branch. I think it may have something to do with the scenario file, but I can't for the life of me figure out where the error is, no matter how many times I roll through the diffs in winmerge.
 
No matter what I do I can't seem to find the source of these crashes. Does anyone have any advice? I've checked the logs but there doesn't seem to be anything about a crash.
 
Top Bottom