So I wanted to make an over time function in a map and it seems like everything is laid out how it should be but its just not working properly.
Team Hot/Team Cold win triggers work just fine. If you set each teams ore/gas manually and then wait until the 10 second timer reaches 0 it displays who has won correctly.
But if you assign both teams the same ore/gas and then wait until the timer reaches 0 it says Team Hot wins 100% of the time. I attached the map which is just a blank canvas with just these triggers and the score setting triggers. I feel like its something to do with order of operations or something but I just can't seem to figure it out.
Thanks!
Force 1
Most Resources(ore);
Countdown Timer(Exactly, 0);
Elapsed Time(At least, 10);
Set Switch("Force1Win", set);
Preserve Trigger();
Comment("Force1Winning");
Force 2
Most Resources(ore);
Countdown Timer(Exactly, 0);
Elapsed Time(At least, 10);
Set Switch("Force2Win", set);
Preserve Trigger();
Comment("Force2Winning");
Player 1
Switch("Force1Win", set);
Switch("Force2Win", set);
Switch("EndGame", not set);
Elapsed Time(At least, 10);
Countdown Timer(Exactly, 0);
Display Text Message(Always Display, "Tie!");
Set Switch("Force1Win", clear);
Set Switch("Force2Win", clear);
Set Countdown Timer(Set To, 10);
Preserve Trigger();
Comment("Tie Game / OT");
Player 1
Switch("Force1Win", set);
Switch("Force2Win", not set);
Switch("EndGame", not set);
Elapsed Time(At least, 10);
Countdown Timer(Exactly, 0);
Display Text Message(Always Display, "Team Hot Wins");
Set Switch("EndGame", set);
Preserve Trigger();
Comment("Team Hot Wins");
Player 1
Switch("Force2Win", set);
Switch("Force1Win", not set);
Switch("EndGame", not set);
Elapsed Time(At least, 10);
Countdown Timer(Exactly, 0);
Display Text Message(Always Display, "Team Cold Wins");
Set Switch("EndGame", set);
Preserve Trigger();
Comment("Team Cold Wins");
Attachments:
None.
An artist's depiction of an Extended Unit Death
It's trigger execution order. Player 1 runs the Force1Winning trigger, and then runs the Team Hot Wins trigger. This all happens before any of Force 2's triggers run.
This is because trigger groups expand out to belong to each individual player, and trigger execution always runs all of Player 1's triggers before Player 2's triggers, and so on for the eight players.
Change the victory/tie triggers to be owned by a single player to fix the issue. Of course, you'll need to sort out how you want to display the text messages separately to each player. I'd set a death for all players and then display a message based on the death number (E.g., 1 death means show Team Hot Wins, 2 deaths means Team Cold Wins, and 3 deaths means a tie).
Ah, alright. That's what I figured it was, since I had them initially in "All Players" I thought that would of covered that base but I guess not. I just added them to Player 8 (Which is AI/holds Hypers ect.) so that works just fine.
And yeah, I will be using a DC to display the message ect.
Thanks sir!
None.