Asaf
Sleep Deprived
- Joined
- Mar 22, 2010
- Messages
- 1,326
Download here.
This mod comp allows for a civic to have another civic as a prerequisite.
For example: If slavery is defined as vassalage's prerequisite, then you cannot switch to vassalage unless you also switch (or already switched) to slavery.
Appropriate changes were made to the UI to allow only 'legal' civic switches.
A new civic selection algorithm was written for the AI to enable it to switch multiple civics at once when needed so by the dependencies.
The attached XML files contain the example of slavery as a prereq civic for vassalage.
This Mod is based on BTS 3.19.
Notes for Modders:
XML Changes
The civic infos schema was modified, and you can use the new <CivicPrereq> tag, like this:
Python API changes:
(Existing changed methods usage was updated in existing Python code)
- Civic info has a new method: getCivicPrereq() which returns the prereq civic's type (-1 if none).
- CyPlayer::canDoCivics now receives a 2nd parameter - a boolean (bIgnoreDependency): If true, ignores any prereq for this civic, false will check if the prereq is already selected.
- CyPlayer::canRevolution was split to 2 methods:
- CyPlayer::canRevolutionAny() - same as canRevolution(0) was: checks whether revolution is at all possible
- CyPlayer::canRevolutionList(civics) - receives a python list of civics (each corresponds to a specific category) and returns true iff this switch is possible (taking into account dependencies as well).
- API for CyPlayer::revolution was fixed and now it receives a list of civics (same as canRevolutionList).
C++ code
All changes were marked with 'Civics Dependency' comments.
Take a look at the new civics selection algorithm in CvPlayerAI::AI_doCivics() if you're interested.
Credits:
* DannyDaemonic - the fast Makefile (1.0). Downloaded from: http://forums.civfanatics.com/showthread.php?t=370861
* Some code in CvPlayerAI.cpp was taken from Better BTS AI Mod
This mod comp allows for a civic to have another civic as a prerequisite.
For example: If slavery is defined as vassalage's prerequisite, then you cannot switch to vassalage unless you also switch (or already switched) to slavery.
Appropriate changes were made to the UI to allow only 'legal' civic switches.
A new civic selection algorithm was written for the AI to enable it to switch multiple civics at once when needed so by the dependencies.
The attached XML files contain the example of slavery as a prereq civic for vassalage.
This Mod is based on BTS 3.19.
Notes for Modders:
Spoiler :
XML Changes
The civic infos schema was modified, and you can use the new <CivicPrereq> tag, like this:
Code:
<CivicInfo>
<CivicOptionType>CIVICOPTION_LEGAL</CivicOptionType>
<Type>CIVIC_VASSALAGE</Type>
<Description>TXT_KEY_CIVIC_VASSALAGE</Description>
<Civilopedia>TXT_KEY_CIVIC_VASSALAGE_PEDIA</Civilopedia>
<Strategy>TXT_KEY_CIVIC_VASSALAGE_STRATEGY</Strategy>
<Button>,Art/Interface/Buttons/Civics/Vassalage.dds,Art/Interface/Buttons/Civics_Civilizations_Religions_Atlas.dds,1,4</Button>
<TechPrereq>TECH_FEUDALISM</TechPrereq>
[B]<CivicPrereq>CIVIC_SLAVERY</CivicPrereq>[/B]
<iAnarchyLength>1</iAnarchyLength>
...
Python API changes:
(Existing changed methods usage was updated in existing Python code)
- Civic info has a new method: getCivicPrereq() which returns the prereq civic's type (-1 if none).
- CyPlayer::canDoCivics now receives a 2nd parameter - a boolean (bIgnoreDependency): If true, ignores any prereq for this civic, false will check if the prereq is already selected.
- CyPlayer::canRevolution was split to 2 methods:
- CyPlayer::canRevolutionAny() - same as canRevolution(0) was: checks whether revolution is at all possible
- CyPlayer::canRevolutionList(civics) - receives a python list of civics (each corresponds to a specific category) and returns true iff this switch is possible (taking into account dependencies as well).
- API for CyPlayer::revolution was fixed and now it receives a list of civics (same as canRevolutionList).
C++ code
All changes were marked with 'Civics Dependency' comments.
Take a look at the new civics selection algorithm in CvPlayerAI::AI_doCivics() if you're interested.
Credits:
* DannyDaemonic - the fast Makefile (1.0). Downloaded from: http://forums.civfanatics.com/showthread.php?t=370861
* Some code in CvPlayerAI.cpp was taken from Better BTS AI Mod