I have this in my map, but I am going to implement a system so that alliance doesn't need to be preserved, but I can still turn it back on whenever I detect the player has changed it.
It's pretty easy to do actually. If you know that P1-4 should always be allied, and P5-8 should always be allied, have a DC called "ally group" or some-such. Set this to 10 for P1-4, and set it to 100 for P5-8. You also need some additional triggers to monitor when players are actually present in the game (whether they never started, or left half way through), you can store this in player DCs or in switches if you want. Have these alliance checkers at the top of the trigger list so the rest of your triggers that depend on alliance status are correctly set up by the time they are executed.
So for players 1-4 you would have a trigger like this:
1. If allies ally group exactly 30, do nothing (alliance is correctly set)
2. If allies ally group is at most 29 and player 1, 2, 3, 4 are still in the game, set alliance for p1, p2, p3, p4
3. If allies ally group is at least 31 and player 1, 2, 3, 4 are still in the game, set alliance for p1, p2, p3, p4
This is the bare skeleton of what's required. The when checking "allies" death count it adds up the values for all of your allies, but does not include yourself. So while the "ally group" DC of the force would be 40 in total, your "allies" score would only be 30.
#1 is what we expect to see.
#2 means the player has un-allied with someone they should be allied with, so reset the alliance.
#3 means the player has allied with someone they should *not* be allied with, so reset the alliance.
If your player alliance is allowed to change during the game at a certain point, like half way through you change from alliance of 1,2,3,4 to 1,2 and 3,4, then you simply need to have 2 sets of these checking triggers for each phase of the game.
Post has been edited 1 time(s), last time on Aug 3 2011, 12:00 am by Lanthanide.
None.