I'd start with a new preset with all the different states you want, like
Diplomatic Relationship
In Alliance
In Non-Aggression Pact
Surrendered
At War
And another one for proposals.
Then make a new record (call it Diplomatic Status) with two variables: Relationship, Proposal
Then have a 2-dimensional array of Diplomatic Status type, so that for each player they have a Diplomatic Status for each other player. Though you might want to structure it a bit differently if, for example, a diplomatic relationship is always mutual, to avoid redundant storage in that case.
Then make some helper functions to make it easier to check any of several states, e.g. In Alliance and Non-Aggression Pact would both disable auto-attack, so you could make a function named "Is Hostile" that takes two player parameters and returns true if the relationship is either one of those two.
With those pieces in place, you should be able to make all the triggers necessary to show/hide dialog items (buttons to propose/accept relationships) and such.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'd start with a new preset with all the different states you want, like
Diplomatic Relationship
And another one for proposals.
Then make a new record (call it Diplomatic Status) with two variables: Relationship, Proposal
Then have a 2-dimensional array of Diplomatic Status type, so that for each player they have a Diplomatic Status for each other player. Though you might want to structure it a bit differently if, for example, a diplomatic relationship is always mutual, to avoid redundant storage in that case.
Then make some helper functions to make it easier to check any of several states, e.g. In Alliance and Non-Aggression Pact would both disable auto-attack, so you could make a function named "Is Hostile" that takes two player parameters and returns true if the relationship is either one of those two.
With those pieces in place, you should be able to make all the triggers necessary to show/hide dialog items (buttons to propose/accept relationships) and such.