Flintlock1415
Emperor
For my next project, I need to control what nations can declare war or peace. I also need the flexibility to:
*Change who can declare war/peace from different triggers (e.g. certain turns)
*Set a team to a different war status without any interference from what is already defined.
I plan on doing this for every Civ in my mod's scenario, but for now I'll just start with the simplest relationship: the Normans and the English. They will be at war for the entire scenario, so this should be the easiest to implement. I think this function will be my best friend for most of what I'm trying to do:
The difficult part of this is how to structure the code. Normally I can structure it pretty well, just with a lot of syntax and operation errors. I think what I want to is use canChangeWarPeace as my main function, while setting it true or false with a set of if statements. I'll try some pseudocode here, and hopefully I can get some input on what to change. (wow this is a lot harder than I thought)
As you can tell by the comments, I am having trouble with how to get a TeamID from only knowing the civ/leader ID, and I have know idea on how to get the team that the active player is trying to change status with.
For all I know, I'm completely misusing this function (with I really think is true the more I think about it) but I couldn't come up with any other ways to do it.
Any help or ideas are very welcome, Thanks!
*Change who can declare war/peace from different triggers (e.g. certain turns)
*Set a team to a different war status without any interference from what is already defined.
I plan on doing this for every Civ in my mod's scenario, but for now I'll just start with the simplest relationship: the Normans and the English. They will be at war for the entire scenario, so this should be the easiest to implement. I think this function will be my best friend for most of what I'm trying to do:
Code:
BOOL canChangeWarPeace(TeamType eTeam)
bool (int /*TeamTypes*/ eTeam)
The difficult part of this is how to structure the code. Normally I can structure it pretty well, just with a lot of syntax and operation errors. I think what I want to is use canChangeWarPeace as my main function, while setting it true or false with a set of if statements. I'll try some pseudocode here, and hopefully I can get some input on what to change. (wow this is a lot harder than I thought)
PHP:
##########################
## Python Controlled War##
##########################
pPlayer = gc.getActivePlayer()
iTeam = pPlayer.getTeam()
iTeamNormandy = gc.getTeam()## I don't know how to get a team from an integer
iTeamEngland = gc.getTeam()## see above
iRivalTeam = ## I don't how to check for the team that who is the target of war/peace
def canChangeWarPeace(self, bValue):
if iTeam == iTeamNormandy and iRivalTeam == iTeamEngland:
return false
else:
return true
For all I know, I'm completely misusing this function (with I really think is true the more I think about it) but I couldn't come up with any other ways to do it.
Any help or ideas are very welcome, Thanks!