• Civilization 7 has been announced. For more info please check the forum here .

Trouble making a civ change to another while using same Team Number in WBS!

Wow, that's really old. Any reason to remain on such an old version of BTS? I don't have those source files around anymore.
 
Thanks for the help so far!
I updated to Civ Version 319 and found that the CvEventManager in "Changing Leaders"
works now. I would need the leaderlist in CvEventManager to change its own leaders
and civilizations without swapping infos from a dead unused civ to a living one.
Swapping one civ for another doesn't work when all your civs are being
used in the game. Is there a way to kill off or reset a civ like "Team 0" without
making it become Team 17?

Example :
"Team 1"= Holy Roman starts with civtype "Civilization_Holy Roman"
and leadertype " Charlemange"
at Year 1840 "Team 1" infos are reset with "Germany" and "Frederick"
 
You should take a look at the file, which i've added here.

Besides, that i've added nearly everything, which needs to be transfered to the new civ (units, research progress, state religion, etc), i've made it easy to customize.
You'll find:
PHP:
                LeaderList.append(["CIVILIZATION_PERSIA",-522,"LEADER_DARIUS",-1])
                LeaderList.append(["CIVILIZATION_OTTOMAN",1520,"LEADER_SULEIMAN",-1])
                LeaderList.append(["CIVILIZATION_MONGOL",1260,"LEADER_KUBLAI_KHAN",-1])
                LeaderList.append(["CIVILIZATION_EGYPT",-1279,"LEADER_RAMESSES",-1])
                LeaderList.append(["CIVILIZATION_HOLY_ROMAN",1806,"LEADER_FREDERICK","CIVILIZATION_GERMANY"])

First the civ, which should change, then the year, the new leader, and if needed, the new civ.
In the py-files all is labeled with ###changing leaders###.
But it's still not all done, like already said (espionage and some treaties), but i hope to come back to this next week.


No, i haven't seen a way, to make it work with the same player number :dunno:. You need to kill a civ at the beginning.
Or use a more civs dll (i guess, nobody will create a mod which has initially 50 civs on the map).

I've taken a look at CvCivilizationInfos, but there's no function to change anything :(.
If EmperorFool doesn't know a way...
 
I haven't seen any functions on CvPlayer needed for this exposed to Python via CyPlayer. That's the real problem. As well, I don't even think CvPlayer is directly capable if this, but I haven't investigated too far. The game is really geared to a static set of players at the start. Creating players during colonization is the exception to this rule, and it's code would be the place to start looking.

Your best bet would be to expose and/or add some functions in the DLL that you could use from Python. This sounds like something a lot of people would really like to have. I'll take a look in the next few days to see if I can spot a quick solution. Ping this thread if I haven't replied in a week to remind me (I'm subscribed).

As for transferring the trade deals and treaties, take a look at BUG's TradeUtil and DealUtil modules. They have functions for pulling up Python representations of the current deals for any given player. You may be able to grab the information, store it in a temporary form elsewhere, create your new player, kill off the old player, and recreate the deals. If you try to do this and need some help with those modules, I will gladly add some functions where I can.
 
As for transferring the trade deals and treaties, take a look at BUG's TradeUtil and DealUtil modules. They have functions for pulling up Python representations of the current deals for any given player. You may be able to grab the information, store it in a temporary form elsewhere, create your new player, kill off the old player, and recreate the deals. If you try to do this and need some help with those modules, I will gladly add some functions where I can.

Thanks for offering your help :).
I've already looked at the BUG files, but i'll really need some advice with them.

One problem: Besides the trades, i already to, what you suggest.
I spawn a new player, add it to the old player's team, store the deals (open borders, etc), kill the old player, restore the deals.
The big problem here: Open borders and defensive pacts are still immediatly canceled at the end of the round.
Being master + vassal work, but only after i kill all the old deals before restoring them...:crazyeye:...
 
Are those deals canceled because the new player isn't liked as much as the old player? Are the attitudes being copied exactly? Also, even once you get an AI to the right attitude you have to wait a while before they are willing to sign a DP or OB. I wonder if that's being checked each turn even after you create the deals.
 
Are those deals canceled because the new player isn't liked as much as the old player? Are the attitudes being copied exactly? Also, even once you get an AI to the right attitude you have to wait a while before they are willing to sign a DP or OB. I wonder if that's being checked each turn even after you create the deals.

Most of the attitudes are transfered, so that's not a problem.
The deals are just canceled.

I've looked just right now at my code, and i should test something other.
Atm i add the new player to the old players team. Then i store the information for the deals, cancel these deals, kill the old player, restore the deals.
The result of this is, that one time the deals with the old player are canceled, and two times for the new player.
I guess, i should store and cancel the deals before adding the new player, because i think, that the first canceling might override the restoring.
 
I agree that it's probably safer to store all of the data about a player you wish to copy, kill the player, create the new player, and finally push out the copied data. Is there also data in the CvPlayerAI that you need to copy? It really sounds like the "new" player's AI is deciding to cancel the deals, but then how does it get around the 10-turn minimum deal length for turn-based deals?
 
I have completly no idea.

The most strange thing:
The AI is not able to sign open borders directly after canceling ("it's the wrong time now", something like that), but will sign a defensive pact :crazyeye:.


I guess, it could be a SDK bug, that the deals are maybe not asigned to the right player...or so.
 
I haven't seen any functions on CvPlayer needed for this exposed to Python via CyPlayer. That's the real problem. As well, I don't even think CvPlayer is directly capable if this, but I haven't investigated too far. The game is really geared to a static set of players at the start. Creating players during colonization is the exception to this rule, and it's code would be the place to start looking.

Your best bet would be to expose and/or add some functions in the DLL that you could use from Python. This sounds like something a lot of people would really like to have. I'll take a look in the next few days to see if I can spot a quick solution. Ping this thread if I haven't replied in a week to remind me (I'm subscribed).

As for transferring the trade deals and treaties, take a look at BUG's TradeUtil and DealUtil modules. They have functions for pulling up Python representations of the current deals for any given player. You may be able to grab the information, store it in a temporary form elsewhere, create your new player, kill off the old player, and recreate the deals. If you try to do this and need some help with those modules, I will gladly add some functions where I can.

Anything yet?
 
Top Bottom