How to revive a dead Civ?

Baldyr

"Hit It"
Joined
Dec 5, 2009
Messages
5,530
Location
Sweden
I'm having all kinds of issues with my current project. First I wasn't able to use barbarian units in the role of rebels in a historical event, since the human player has free kills. Then, when I decided to expand the scenario so that those free kills will be used up in other earlier events, it turns out that barbarian units have a habit of becoming invalid in-between game turns.

So, I've reverted to using another minor Civ for my Rebels, then. But, the problem is that they aren't really alive at that point. (I'm using the RFC mod for my scenario, by the way, so Civs will spawn on their historical dates.) Sure, the Civ will go online once I spawn them a unit, but their status as "alive" isn't registered before all my code is already executed (with a BeginGameTurn call-up). So any other code that needs CyPlayer.isAlive() to be True isn't gonna fire before the next turn - if that unit isn't killed and the Civ is dead once again... So the next spawn will start from zero and... I'm stuck.

So, is there a way - with Python - to set the alive status for a Civ? Because if I can do this before the units spawn, then all should be good, right? I've searched the API but can't seem to find what I'm looking for (under CyPlayer nor CyGame).
 
I see the problem:
In a normal game, a civ is considered dead when it doesn't have any cities and can't found one, this is making you troubles atm.

If you don't want to activate the "complete destruction needed" option (or however this is named in english), then you should just give a cities to the rebels. Create a pirate civ, or so, and assign them to these guys, or something like that.
 
If you don't want to activate the "complete destruction needed" option (or however this is named in english), then you should just give a cities to the rebels. Create a pirate civ, or so, and assign them to these guys, or something like that.
The way I can think off is to simply give the dead Civ a unit (like on plot (0, 0)) on the turn before the event. This way the Civ will already be set to "alive" status.

I've also been looking at how Rhye has implemented "rebirth" in RFC and I can't see that the code does anything at all to actually reinstate the Civ in question. Rhye's code does reset some pickled values like stability and number of cities, but it doesn't even spawn any units.

So maybe PyPlayer.acquireCity() is sufficient then? :confused:
 
Top Bottom