Modmodding Q&A Thread

There's your problem. Compiling refers to the process of converting your modified C++ source files into a new DLL for the game. Simply modifying the source code doesn't have any effect on the game.

The adding a civ guide doesn't really specify this because it is an advanced procedure that basically assumes you're sufficiently familiar with programming (also because it's just a copy of a post in this thread which runs under the general assumption that you generally know about this stuff). I've updated it to make this clearer.

There are a couple of guides for setting up your SDK to compile the DLL, I think asaf's guide is preferable for beginners.
 
Also, the civilopedia won't open any more.

I had the same problem too. For me, it was always a mismatch between the iNumUnits (or iNumBuildings) and the "list" below it in consts.py. I added an unit in the "list" but I forgot to change the number, which resulted in the pedia not opening anymore.
 
Usually there should be a Python exception alerting you to a problem with this, like "too many variables to unpack".
 
That tutorial is less than helpful because none of the programs it told me download would download. I use codeblocks which has its own compiling plugin built in so I just need to know where to compile things or what to do. I know where the compiler button is. Do I compile the individual files? Do I have to build it to a certain file location? Do I have to compile the sln and suo files?
 
Then get the files elsewhere, VS 2010 Express is free, and Google is your friend for the required libraries.

It's not about compiling individual files, the game requires all of them linked into one DLL. The instructions to get your compiler to do that are in the makefile that comes with most of these guides (I'm actually using Nightinggale's makefile now). In the beginning I was using CodeBlocks instead as well (still don't know which of the two is the greater pain in the butt, I really need to check out CLion), so it's definitely possible, but then you have to figure more stuff out on your own.

I'm referring to these guides because they have all the steps in one place, but that comes with some assumptions about the software you're using. If you want to deviate from that it's fine, but in that case you're on your own.
 
Long time no see Leoreth :)

Is there any ways to change AI's state religion with codes? I want to change that into 'no state religion' status.
 
Do you want to define an event that triggers this, or do you just want to do this during the game? In case of the latter, you can do the following in the Python console:
Code:
from Consts import *
gc.getPlayer([player constant]).setLastStateReligion(-1)
You need to find the right player constant in Consts.py.
 
Umm, sorry but I misread it. I needed event one.

Seems like .setLastStateReligion one is not working on Python file it self. Is there similar method that defined already on it?
 
Nope, should work. setLastStateReligion is exposed to the PyPlayer wrapper.
 
No worries.
 
Depending on what you want to modify changing an XML define might be enough.

Otherwise, the code is somewhere in CvCity.cpp, can't look up the method right now.
 
That's why I'm a fan of commenting out :)
 
Thanks in advance.

Is there any method that make exception on flipping in civ respawn? I want to make Mogadishu under specific civs' control does not flips to Ethiopia when they respawn.

++ added: Making exception for specific area will be much better :)
 
Sure, but you would have to code that yourself. Will look up the best place when I have access to the code.
 
About Tamil's 3rd UHV goal, is there any more codes except the ones in the victory.py? I'm copying it for new civ but doesn't work :confused:

++ I guess you might be busy now, can you give me some help for the previous question?
 
Back
Top Bottom