Era Limited Civs

No reason you can't change this with XML. You could rename the Aztecs the Olmecs and the Zulu the Bantu and let them appear on Ancient starts. This modcomp is intended to empower xml, and the included xml is just an example of how to use it.
 
Hello,


I've heard about this MOD Comp this WE while listening to the latest MODCast, I've goota say it's pretty neat, this is something I've been looking for for a while (just didnt get the chance to see this topic).


However, I've got a small issue with this : (Besides the fact
that I've got the same error message than mentioned page 1 by
OS79 while compiling, but let's assume I'm just doing it wrong)

I've noticed the bug you mention with the Civs that are "clickable" and then unclickable.
This is pretty easy to understand actually, the game just saves up what you picked last time as an era, and impact the game from there on, restricting your Civ choice to the former settings played.

This is inadequate to my use, because my goal is to merge this into a competitive MULTIPLIER MOD. Therefore I'd like to implement this as an OPTION.

Is there any way to make this happen only when the map/mapscript is generate (=during/after the game launched) because I'd like players to be able to pick their civs/leaders freely (O yeah BTW, I'd be great to have the same for leaders...MP usually use Unrestricted leader as option) and the MOD only to kick in when A/ They've chosen Random B/ The option is checked.


I know this is pretty accurate request, but my SDK skills, while
decent enough, are not good enough to make this on my own. In
any case If I bring this MOD to another level I'll put in here.

Thx, Penny.
 
My SDK skills are basic myself. I really want to improve this modcomp (as a side effect of improving its implementation in my own mod), and have made some failed attempts (ie progress by elimination) toward this. I use a check of Start Era to determine which civs are available. Current Era doesn't seem to work at game start, presumably because there isn't an era yet. I have tried to change StartEra to CurrentEra later, so that barb civs (using the barb civ mod) could emerge appropriate to the era in which they emerged but it didn't work. Apparantly the list of playable civs is generated at game start and doesn't change ever after. Maybe instead of piggybacking a function that is really just for returning a civs playability, I should write a new function, with a new variable that uses start era and current era at different times or something.
 
Hello Tolish, Thx for your reply.

I've had the time to explore a bit further on this, and I've made this work trough an option from now on.

It still is not perfect rgd it being clickable or not, but if you uncheck-recheck the option and/or change the era it actually updates after 1 of 2 tries, so it's all good :p





I've got another bug though :

I've notice that in MY MOD the game crashes when the amount of players is BIGGER than the amount of civ available for that specific era.
In your MOD, it just spams infinitely the first civ in the list...
So if Modern you can have America + Germany + India, with 9 players, you'll have 7 Americas.

Any idea on this ? Regarding how to not make it america AND where I could have altered (my MOD has altered a lot of code now) this in mine ?


Thx again tholish ;)
 
I've fiddled with this mod a lot trying to make it spawn civs of the correct era combined with the python version of Barbarian Civs, but it never spawns any civs that were not available in the start era, even if I set it to use current era. However, some incarnations have reset to the new era quite quickly. As soon as you try to select a civ from the initially era inappropriate list, it blinks and rejects your choice (simply puts you back to no choice having been made) and your next choice offering is the era appropriate list. I used a local variable to mediate between separate blocks to see if current era is No era or equal to start era, and returned invalidity based on that variable. Perhaps I should update, but its not that big an improvement. All this modcomp seems to be able to do is prevent civs from being in the game that are not set to be viable in the start era of the game.

In my full mod I have 100 civs spanning 5 different eras, a 24 civ dll, and world sizes set for 18 civs on Huge, so I never run out of playable civs. I didn't know this modcomp crashed because I never play it under conditions where it might. I think the infinite America spawn would also occur if you made an otherwise vanilla mod with only one civ and tried to play a huge random map--11 Americas. Some safety mechanism built into civ. Separate issue of making a mod with too few civs. In your mod you must have messed with the safety mechanism.
 
However, some incarnations have reset to the new era quite quickly. As soon as you try to select a civ from the initially era inappropriate list, it blinks and rejects your choice (simply puts you back to no choice having been made) and your next choice offering is the era appropriate list. I used a local variable to mediate between separate blocks to see if current era is No era or equal to start era, and returned invalidity based on that variable. Perhaps I should update, but its not that big an improvement.

I don't really understand what you're saying. Do you mean you have partially solved the issues you described in your OP?:
Spoiler :
Another thing, it takes a little while for changes to take effect. You can start a custom game and see that initially only Aztec (Toltec), Carthage (Canaan), Egypt, India, and Sumeria are playable. If you change start era to Classical, you see that the only civs you can select are the same, but if you just start a game with random civs, you will get civs selected from Aztec, Bablyon, Carthage, Celtia, China, Egypt, Greece, Inca, India, Maya, Rome, and Sumeria. Also, if you mess around and take other actions and then come back, these civ selections will just snap into place. So its not perfect.


If so, I'd certainly be interested in it, as I have just discovered the problems you describe while trying to make the SMAX factions playable in Planetfall.
 
That was easier than I expected it to be. Even though I lost the version described above, the current FutureMod works just the same way. I just isolated the essentials and put it with my old XML. There was extra code in too many files. I am reuploading, sources will be included. The download uses the same hokey civ scheme as before, since I had it handy with the extra tags, but its made into a playable mod just for proof of principle. I tested this and it works exactly as described above. A blink, then a rejection of the anachronistic leader (set back to Random), then a new list of leaders fitting the era currently selected for the custom game.

The core code goes like this:
Code:
bool CvCivilizationInfo::isAIPlayable() const
{   //tholish added the next four lines
	if (GC.getGame().getCurrentEra()== NO_ERA)
	   {
		if (GC.getGame().getStartEra() < getMinEra())
		    return false;
	    if (GC.getGame().getStartEra()> getMaxEra())
		    return false;
	   }
	return m_bAIPlayable;
}

http://forums.civfanatics.com/downloads.php?do=file&id=12661


Ironically, now that I've got the CivicLeaders modcomp, I'm planning to use that instead of this because I have never been able to get this one to change the civs available during the game. It doesn't work with getCurrentEra, only with getStartEra, so for example when I combine it with the BarbCivs mod I don't get modern era civs emerging in the modern era if I started in the Ancient era, only Ancient Era civs will ever be in the game.
 
Top Bottom