I agree with Roy that using two unused players would be the easiest way to accomplish what you want. His system would probably be the fastest and most compact way to implement it as well.
However, I wouldn't implement it in that exact way personally, due to it being split up over two trigger cycles. It will often result in the first player in the game being able to see the swap happen, as their units will change to the unused player's color momentarily on the minimap. Additionally, if they were engaged in a fight with someone else, their units may take longer to continue attacking nearby enemies, which would result in a disadvantage.
You're also opening yourself up to unnecessary trigger conflicts and oversights in the future, such as the one Wormer noticed. This becomes especially true as new triggers are added, especially if you're implementing them in a similar way. You should never use "Wait" outside of hyper triggers, it's akin to using "Goto" in other programming languages.
These things might not bother you at all, or not enough to warrant changing them. However, if you do want to, then making the system finish within a single cycle will solve the issues mentioned. It will also make the triggers more straightforward, since they will follow the normal order of execution.
Trying to keep it as simple as possible, this is one way you could do it:
Force 1(Your conditions to start swap)Force 1 has suffered exactly 0 deaths of CantinaSet deaths of Cantina to 1 for Current PlayerSet deaths of Cave to 1 for Force 1Preserve Trigger ^ This detects which player is first (Cantina DC) and it will let you figure out which player is last (Cave DC).
Force 1Force 1 has suffered exactly 1 death of CantinaSet deaths of Cave to 0 for Current PlayerGive all [Any Unit] owned by Current Player at Anywhere to Player 10Give all [Any Unit] owned by Player 9 at Anywhere to Current PlayerGive all [Any Unit] owned by Player 10 at Anywhere to Player 9Preserve Trigger ^ This begins the same exchange between all the players, as before. It also removes the Cave death from each player as their swap finishes.
Force 1Player 1 has suffered exactly 1 death of CantinaForce 1 has suffered exactly 0 deaths of CaveSet deaths of Cantina to 0 for Force 1Give all [Any Unit] owned by Player 9 at Anywhere to Player 1 Preserve Trigger Force 1Player 2 has suffered exactly 1 death of CantinaForce 1 has suffered exactly 0 deaths of CaveSet deaths of Cantina to 0 for Force 1Give all [Any Unit] owned by Player 9 at Anywhere to Player 2 Preserve Trigger Force 1Player 3 has suffered exactly 1 death of CantinaForce 1 has suffered exactly 0 deaths of CaveSet deaths of Cantina to 0 for Force 1Give all [Any Unit] owned by Player 9 at Anywhere to Player 3 Preserve Trigger ^ And then you make another one for each remaining player. This is designed to be as easy to duplicate as possible, so making six copies of the first one is easy.
Of course, as with any system, you'd need to add an action to clear "your conditions" from the first trigger before the trigger cycle ends, otherwise it would repeat every cycle.
As for your timer question, as Wormer said, you'll want to use hyper triggers. They are a critical part of nearly all trigger systems, and should be in every map you make by default.
Just create the trigger as he wrote it there, with 63 "Wait 0" actions followed by 1 "Preserve Trigger". That is a single hyper trigger.
You want to have 4 of these hyper triggers (not 3). The difference between 3 and 4 is how long your triggers will run super fast (12 times a second instead of 1 time every 1.5 seconds) without any hiccups. 3 hypers only gives you 6 hours, which is reached all the time, as people go AFK or play solo or are chatting or just take a long time. 4 hypers gives you 16 days, which is not only never going to happen on your map, but it's realistically possible that no one has reached that on any map (but there's always that one guy).
Also, it's not important to put your hyper triggers at the bottom of the trigger list. It doesn't matter, because you shouldn't be using any other Wait actions in your map.
Once the hyper triggers are added to your map, your triggers will be running about 12 cycles per second. Timers like the one you described become extremely easy to implement. For a 5 minute timer, you would change it to 300 seconds, and then multiply by 12 cycles per second, to arrive at 3600 trigger cycles.
To implement a timer, you can do this:
Force 1AlwaysAdd 1 death to Cave-in for Current PlayerPreserve Trigger ^ This is measuring the number of trigger cycles that pass.
If you want to use "has been 5 minutes" as a condition, you would need to know how many trigger cycles that equals. Since 12 trigger cycles is equal to 1 second, the result is that 5 minutes is equal to 3600 trigger cycles (as shown earlier).
Modifying the first trigger from before, this is how you would make it swap every 5 minutes:
Force 1Current Player has suffered exactly 3600 deaths of Cave-inForce 1 has suffered exactly 0 deaths of CantinaSet deaths of Cantina to 1 for Current PlayerSet deaths of Cave to 1 for Force 1Preserve Trigger As mentioned earlier, you will need to clear "your condition" (3600 deaths of Cave-in) before the end of the trigger cycle. The action you would use is:
Set deaths of Cave-in to 0 for Force 1 ^ You can add this action to the "Exchange Units" trigger or the "Finish Swap" triggers.
The last thing to note here is that the Timer trigger must be moved higher than the Start Swap trigger in the trigger list. This is because it's otherwise possible for the first player to not have the highest timer value (like if you do a swap, it runs all the triggers, clears the timer, and then gives Player 7 +1 to his timer). The reason this is such an issue is that it means Player 7 would reach 3600 while everyone else is at 3599, so he'd do the swap by himself (everyone else would end up swapping without him on the next trigger cycle).
If you have any other questions, just let us know.
Post has been edited 2 time(s), last time on Dec 16 2013, 2:08 pm by Azrael.