Change Civ leader in-game?

Lord Civius

Emperor
Joined
Mar 11, 2008
Messages
1,767
Location
Florida
Is it possibe to change Civ leader in-game? Perhaps spawned by revolution or era change. I want to make a mod with several leaders from the same civ through the ages. If anyone has done it before or can help me out on how to do it I'd appreciate it.
 
I would also love to see this feature (on the era) implemented, especially as part of the options menu. Imagine an England that has Elizabeth in the Renaissance, Victoria in the Industrial, and Churchill in the Modern periods. Your neighbors' strengths and behavior would change over the course of the game.
 
I think a cooler thing is Civ3's system, where the LH changes through eras.
 
Yeah, I realized that would take a large amount of time to make them. Still, it's a cool thing.
 
Would it be possible to cue an Era leader change by "Random" Event? Basically, could an event be made to change to X leader under the conditions of X Civ and the discovery of X, Y, or Z technology? For example, when you discover any of the initial Industrial techs as the English, an event pops up with a 100% likelihood and announces the rise of Victoria.
 
I've already searched in the API, if there's a function to change a leader.
I've only found a function, which allows you to trigger a civilization (needs an ID, a civilization and a leader).
I have no idea, what happens, when anybody tries to trigger a new player with an existing ID and civilization, but with a different leader.
I guess, it'll chrash, but there's a small chance, that it could work.
I'll maybe try it out tomorrow.
 
The AI is better than nothing. It forces you to adapt to the changing strengths and strategies of your opponents.
 
That's a very good point about the whole game-breaking thing. I know that Ryse and Fall uses some sort of leader-changing mechanic for the AI; how does that effect the computer's strategy?
 
I guess, somebody will programm it, when you do all the leaderhead art ;).

I would say that making era-specific LHs based on the ones in the game would not really be that difficult. It at least wouldn't be as hard as creating a new LH. The animations are the same, the face is the same, you just have to alter the clothing really and perhaps some hair here and there.
 
That's a very good point about the whole game-breaking thing. I know that Ryse and Fall uses some sort of leader-changing mechanic for the AI; how does that effect the computer's strategy?

I have no idea.
but R&F has also an altered Dll, maybe there are additional AI changes.

And i've seen a command in the API, that lets you change the AI personality. That means, i could change lets say elisabeth to victoria, but also give victoria the elisabeth AI. Maybe it's some thing like that.

I would say that making era-specific LHs based on the ones in the game would not really be that difficult. It at least wouldn't be as hard as creating a new LH. The animations are the same, the face is the same, you just have to alter the clothing really and perhaps some hair here and there.

Yes, but you'd need 53 leaderheads for...err..how many eras are there? 4, 5? Whatever, lots of them.
 
mh, i come closer to the end.
The leaders are changed now using a dynamic list of civs, leaders and years. The changed leader has all techs, cities and units from the old one, also the same amount of gold and the same state religion.
I have to check, if my code successfully restores all attitude values (should, but i'm not sure).
Atm there are some problems with the diplomatic relations (all treaties are cancelled), but i guess, i'll get it to work.
Also the civics, espionage points, and current progress in tech research must be restored, but that's also not the most difficult thing.
 
This is an extremely interesting Mod if you can pull it off. There really isn't a balanced way to play the game through all the Eras with one leader type and few traits as the game has now changed from the initial "Get in your tanks and beat them up" sort of game that Civ 1 & 2 used to be.

At various times one needs different people with different skills [read "traits" here] to accomplish what is required. If one tries to add those traits at the beginning, even if one varies the traits to accomodate lower power throughout the game, the game becomes unbalanced. Either the human player is too powerful or the AI's are. In either case the game plays well only about halfway before the traits cumulative power begin to throw the game out of kilter.

I hope you're succesfull here and I'll follow your progress with great interest. Well done for attempting it. :)
 
This is what is used in RFRE. The Romans progress through: Consul, Caesar, Nero, Flavian, Hadrian, Commodus, Severan, Diocletian, and finally Justinian during the appropriate period.

Code:
    def changeCivLeader(self,playerIdx,newLeaderType):
          newPlayer = gc.getPlayer(playerIdx)
          py = PyPlayer(playerIdx)
          newCivType = newPlayer.getCivilizationType()
          teamIdx = gc.getPlayer(playerIdx).getTeam()
          ##  playerIdx, newCivType, newLeaderType, teamIdx, player.isHuman(), True
          success = game.changePlayer( playerIdx, newCivType, newLeaderType, teamIdx, newPlayer.isHuman(), True )

changePlayer is from the Revolutions dll.
 
Back
Top Bottom