I made a modcomp that adds two integer variables "minera" and "maxera" to CivilizationInfos. Whenever there is a check for whether a civ is playable or ai playable, I just made these part of the process so that for instance, if the start era of the game is Ancient, only civs with appropriate minera and maxera XML values can appear. I wanted to use CurrentEra, but it doesn't work, (I guess because at game start it is as of yet No Era? )
This gets the right results, partly. I set civs up with settings for the era they can appear, so that Rome can only appear in the Ancient or Classical eras; the HRE can only appear in gamees that start in the Medieval and Rennaissance eras and so forth.
What you really get is the list of available civs is always from the last game you played until you add a few leaders and the Custom Game setup gets the idea. Normally Start Now gets you the ancient era, but if the last game you played was another era, the human player can select from that former era and all the ai civs will be from the ancient era.
However, what I want is to have Barbarian Civ (which I currently have in the standalone python form for 3.19) and Revolution (which I mean to add soon from the new multiplayer standalone 3.19 version that is being made (!)) mods also in my mod, so that appropriate civs emerge for the current era. Thus you could start as Rome in the Ancient Era, limited to only real ancient era civs, but when you get to the Middle Ages the Byzantine Empire might emerge from a Revolution, or a barbarian civ might become the Holy Roman Empire.
I have modified the modcomp in my own mod to open it all up wide once the start of the game is over
but no civ ever emerges that is not from the original start era. I have experimented with other changes to try to "reset" start era, to no avail. I have searched for a list being made somewhere that decides once per game what civs are playable, but I have not found it. In fact, why does Civ remember the era of the last game played? I have had two versionf of my mod in the mod folder and renamed them and started, and the last era started is still remembered. Any suggestions or enlightenment?
This gets the right results, partly. I set civs up with settings for the era they can appear, so that Rome can only appear in the Ancient or Classical eras; the HRE can only appear in gamees that start in the Medieval and Rennaissance eras and so forth.
What you really get is the list of available civs is always from the last game you played until you add a few leaders and the Custom Game setup gets the idea. Normally Start Now gets you the ancient era, but if the last game you played was another era, the human player can select from that former era and all the ai civs will be from the ancient era.
However, what I want is to have Barbarian Civ (which I currently have in the standalone python form for 3.19) and Revolution (which I mean to add soon from the new multiplayer standalone 3.19 version that is being made (!)) mods also in my mod, so that appropriate civs emerge for the current era. Thus you could start as Rome in the Ancient Era, limited to only real ancient era civs, but when you get to the Middle Ages the Byzantine Empire might emerge from a Revolution, or a barbarian civ might become the Holy Roman Empire.
I have modified the modcomp in my own mod to open it all up wide once the start of the game is over
Code:
bool CvCivilizationInfo::isAIPlayable() const
{ //tholish added the next six lines
if (GC.getGame().getCurrentEra() > GC.getGame().getStartEra())
return true;
if (GC.getGame().getStartEra() < getMinEra())
return false;
if (GC.getGame().getStartEra()> getMaxEra())
return false;
return m_bAIPlayable;
but no civ ever emerges that is not from the original start era. I have experimented with other changes to try to "reset" start era, to no avail. I have searched for a list being made somewhere that decides once per game what civs are playable, but I have not found it. In fact, why does Civ remember the era of the last game played? I have had two versionf of my mod in the mod folder and renamed them and started, and the last era started is still remembered. Any suggestions or enlightenment?