EmperorFool
Deity
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.
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"])
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.
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.
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).
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.