RevDCM Specific Code Proposals

I'm actually thinking about disabling the Revolutions aspect for now until my mod is further developed but can't find how to disable it in the options or XML; is there a way to do this using RevDCM? (e.g. DuneWars is based on this modpack, but doesn't employ Revolutions.)

There is good news and bad news about starting with revdcm. The good news is there are a lot of things in there you can use, if you want to. The bad news is, there is no way to prevent the revolutions options from getting accidentally turned on. You can edit CIV4GameOptions.xml and set the defaults to off, and set the option buttons to invisible. But, the options can still get turned on by CivilizationIV.ini. We still get occasional support issues in DW when the options get accidentally turned on.
 
There is good news and bad news about starting with revdcm. The good news is there are a lot of things in there you can use, if you want to. The bad news is, there is no way to prevent the revolutions options from getting accidentally turned on. You can edit CIV4GameOptions.xml and set the defaults to off, and set the option buttons to invisible. But, the options can still get turned on by CivilizationIV.ini. We still get occasional support issues in DW when the options get accidentally turned on.

You can force the options to be read from the XML, not the Ini, in the RevDCM.ini

;
Code:
 Read Game options from XML, not .ini
ForceGameOptions = 0

Works fine for me; it always reads from XML.
 
Alright Phungus, I've done it. Everything is working, I've done extensive testing.

There are a LOT of changes, I only included changed files to make it easier. However, there were some deleted files, here's what to delete after the merge:

The Entire RevInquisitions folder can be deleted (Keeping it will cause issues), and delete the ReadME_CIV4MemoryInfos.xml.

Also, I included a tiny bit of Revolution AI code in CvCityAI, it makes the AI try to add more defenders to cities with high RevIndex's. It helps them keep revolting cities.

I also added some AI code for Civics that allow inquisitions. ;)

Be careful merging...

One last note:

I don't know how to set global defines from the BUG panel, nor how to read a BUG Panel value into the SDK, so I added a new Global Define for the respawning of holy cities. You will need to make it be set from the RevDCM options. Other than that, everything works great.,

Tell me if you have any issues.
View attachment RevolutionDCM.rar
 
Thanks Afforess. I need some clarification though, I didn't see a CvUtil.py file in there, have you moved that code over to the SDK as well?
 
Thanks Afforess. I need some clarification though, I didn't see a CvUtil.py file in there, have you moved that code over to the SDK as well?

Yep, you should be able to remove that code too, I just forgot to clean it out. Everything is in the SDK. Everything. ;)
 
Just out of curiosity for updating LoR, do you know if the added mission in CvEnums breaks save game compatibility? I know the building class prereq array will, so I'm going to skip merging that into LoR for now, but I'd like to merge in the Inquisitions stuff; problem being I need to know if it breaks save game compatibility, otherwise I must retain the python for now.
 
It failed to compile:
1>CvPlayerAI.cpp
1>CvPlayerAI.cpp(20707) : error C2511: 'bool CvPlayerAI::isReligiousState(int)' : overloaded member function not found in 'CvPlayerAI'
1> c:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\BST\src\Working\CvGameCoreDLL\CvPlayerAI.h(13) : see declaration of 'CvPlayerAI'

Also I never saw isBigReligiousState declared, but it is referenced as well.
 
It failed to compile:


Also I never saw isBigReligiousState declared, but it is referenced as well.

NVM, my bad, in CvPlayerAI, change this line:

bool CvPlayerAI::isReligiousState(int iThreshold)

to this line:

bool CvPlayerAI::isReligiousState(int iThreshold) const
 
Of course, I also reextracted the file to make sure I didn't accidently reverse the direction of winmerge. Something is wrong with the upload; I've rechecked and everything is identical to your uploaded files.
 
Sorry, I didn't mean to post that post above, stupid enter key. I put the solution above :blush:
 
It compiled. Haven't had a chance to test it yet.

There are a bunch of Inquisitions values defined in GlobalDefinesAlt. I've moved them to the end so it's all together, and am uploading the file for you. I figure you might want to make some changes to the SDK code and use these XML adjustable values instead of hardcoded values set in the SDK. Please upload any changes you make to the dll if that's the case, and I'll merge them in.
 
It compiled. Haven't had a chance to test it yet.

There are a bunch of Inquisitions values defined in GlobalDefinesAlt. I've moved them to the end so it's all together, and am uploading the file for you. I figure you might want to make some changes to the SDK code and use these XML adjustable values instead of hardcoded values set in the SDK. Please upload any changes you make to the dll if that's the case, and I'll merge them in.

I used all the existing values (and added a bunch more) in the Global Alt Defines already, no need to worry, I didn't hardcode anything.
 
You can force the options to be read from the XML, not the Ini, in the RevDCM.ini

True. That exchanges one problem (options may get turned on when switching mods) for another one (options switch themselves off from one game to another). There is no *good* solution.
 
I used all the existing values (and added a bunch more) in the Global Alt Defines already, no need to worry, I didn't hardcode anything.

If this is the case could you take a look a look at GlobalDefinesAlt and remove the values in there that are no longer used? Always good to clean things up and removed left overs when things are updated, and I'm not totally sure myself what's in there now that is no longer referenced.
 
The only unused one is this:

Code:
  <Define>
    <!-- Highly recommended to keep off. AI is clueless about it. -->
    <DefineName>OC_FOREIGN_INQUISITIONS</DefineName>
    <iDefineIntVal>0</iDefineIntVal>
  </Define>

I didn't implement this, you can only do inquisitions in your own team.
 
OK. Going through the code and finding stuff to cut. I ran into this:

Code:
if RevDCMOpt.isOC_RESPAWN_HOLY_CITIES():
This used to be defined in the RevDCM options tabs, but now it's in GlobalDifnes alt, how do I call something in GlobalDefinesAlt in Python?

Edit:
Nevermind, found it by searching the Python/SDK forums (surprisingly only one thread hit the search paramaters). The call is CyGlobalContext.getDefineINT("GDA_PARAMETER")
 
OK. Going through the code and finding stuff to cut. I ran into this:

Code:
if RevDCMOpt.isOC_RESPAWN_HOLY_CITIES():
This used to be defined in the RevDCM options tabs, but now it's in GlobalDifnes alt, how do I call something in GlobalDefinesAlt in Python?
Umm, I think you should have deleted it from GlobalDefinesAlt.xml and keep it in RevDCM options tab. Originally it was in GlobalDefinesAlt.xml and it was moved to RevDCM options tab so that this setting can be changed during the game from BUG options... so the GlobalDefinesAlt was leftover from this change. Same for all other inquisition defines. I think you can delete most (python based) inquisition defines from GlobalDefinesAlt since they been handled through BUG components for long time now. All those modifiers were from OrionVeteran's Inquisition mod.
 
Umm, I think you should have deleted it from GlobalDefinesAlt.xml and keep it in RevDCM options tab. Originally it was in GlobalDefinesAlt.xml and it was moved to RevDCM options tab so that this setting can be changed during the game from BUG options... so the GlobalDefinesAlt was leftover from this change. Same for all other inquisition defines. I think you can delete most (python based) inquisition defines from GlobalDefinesAlt since they been handled through BUG components for long time now. All those modifiers were from OrionVeteran's Inquisition mod.

Can't do that now... The global Define Alt values are all now needed for the SDK, deleting them will cause bad things to happen. However, you could make them all set from the RevDCM tab still. You can change global defines mid game.
 
I cut out that tab and all associative python, as I don't know how to make the dll reference a python boolean. If you can change the SDK to reference the value of isOC_RESPAWN_HOLY_CITIES() I can put that tab back in, but for now I don't know how to make it work with the current code, since inquisitions were moved over to the SDK.

Edit:
Nevermind, figured it out. Actually the bug module stuff is pretty usefull.
 
Top Bottom