Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Best way to detect and handle a tie in scores
Best way to detect and handle a tie in scores
Feb 1 2014, 5:50 pm
By: Prophete  

Feb 1 2014, 5:50 pm Prophete Post #1



In the map score is displayed/tracked by minerals and gasses.

So let's assume the countdown timer is at 0:00 (After counting down from 20:00)

Team 1 has a score of 100
Team 2 has a score of 90

Obviously, team 1 is the winner.

Code
Trigger("Team 1"){
Conditions:
    Most Resources(ore);
    Countdown Timer(Exactly, 0);
    Elapsed Time(At least, 200);
    Command("Player 12", "Terran Flag Beacon", Exactly, 0);

Actions:
    Set Switch("Switch140", set);
    Preserve Trigger();
    Comment("Force1Winning");
}

//-----------------------------------------------------------------//


Code
Trigger("Team HOT"){
Conditions:
    Switch("Switch140", set);
    Switch("Switch141", not set);
    Countdown Timer(Exactly, 0);

Actions:
    Display Text Message(Always Display, "\x013\x005Team 1 wins!");
    Victory();
    Comment("Victory");
}

//-----------------------------------------------------------------//


And vice verse for a losing team.

Now, that seems to work fine, but I wan't an OT trigger as well, and it seems to break sometimes?

Code
Trigger("All players"){
Conditions:
    Countdown Timer(Exactly, 0);
    Elapsed Time(At least, 10);
    Switch("Switch140", set);
    Switch("Switch141", set);

Actions:
    Set Countdown Timer(Set To, 120);
    Set Switch("Switch41", set);
    Comment("SetOver-time");
}

//-----------------------------------------------------------------//


Code
Trigger("All players"){
Conditions:
    Switch("Switch41", set);

Actions:
    Set Switch("Switch41", clear);
    Comment("ClearOver-Time");
}

//-----------------------------------------------------------------//


Those two triggers are right on top of each other. In that order.



None.

Feb 1 2014, 6:45 pm jjf28 Post #2

Cartography Artisan

Does each team belong to a single force or do the minerals/gas belong to a single player?



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Feb 1 2014, 6:53 pm Prophete Post #3



Player's 1-3 belong to force 1 and Player's 4-6 belong to force 2



None.

Feb 1 2014, 10:36 pm jjf28 Post #4

Cartography Artisan

Trigger
Players
  • Force 1
  • Conditions
  • Deaths ( Current Player, Cantina, at least 1 )
  • Deaths ( Force 2, Cantina, exactly, 0 )
  • Actions
  • Victory


  • Trigger
    Players
  • Force 2
  • Conditions
  • Deaths ( Current Player, Cantina, at least 1 )
  • Deaths ( Force 1, Cantina, exactly, 0 )
  • Actions
  • Victory


  • Trigger
    Players
  • All Players
  • Conditions
  • Deaths ( All Players, Cantina, at least, 1 )
  • Deaths ( Current Player, Cantina, exactly 0 )
  • Actions
  • Defeat


  • Trigger
    Players
  • Force 1
  • Conditions
  • Deaths ( Current Player, Cantina, at least 1 )
  • Deaths ( Force 2, Cantina, at least, 1 )
  • Actions
  • Tie


  • Trigger
    Players
  • Force 2
  • Conditions
  • Deaths ( Current Player, Cantina, at least 1 )
  • Deaths ( Force 1, Cantina, at least, 1 )
  • Actions
  • Tie


  • Trigger
    Players
  • Force 1
  • Force 2
  • Conditions
  • Most Resources
  • Actions
  • Set Deaths ( Current Player, Cantina, add, 1 )


  • Keep in mind that triggers run like this:

    - set current player to p1
        - run first trigger (run once if owned by p1, once more (or for the first time) if owned by p1's force, and once more (or for the first/second time) if it's owned by all players)
        - run second trigger (...)
        ...
    - set current player to p2
        - run first trigger (...)
        - run second trigger (...)
        ...
    ... and on till p8

    Post has been edited 1 time(s), last time on Feb 2 2014, 6:23 pm by jjf28.



    TheNitesWhoSay - Clan Aura - github

    Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

    Feb 2 2014, 2:46 pm Prophete Post #5



    Okay, I understand how that could work but sadly all players are set to allies for the whole game. For that reason, the Foes trigger cannot work. Is it possible just to replace that with "Force 1" and "Force 2" ?

    And as for the tie, I assume I can just set preserve triggers on these, and on the tie one I set Cantina to 0 after I reset the timer for OT?



    None.

    Feb 2 2014, 6:26 pm jjf28 Post #6

    Cartography Artisan

    Edited to reflect alliances

    Quote
    And as for the tie, I assume I can just set preserve triggers on these, and on the tie one I set Cantina to 0 after I reset the timer for OT?

    Should be able to



    TheNitesWhoSay - Clan Aura - github

    Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [07:32 pm]
    Zoan -- I got $2000 bonus. I would like 2000 minerals, please
    [2026-4-16. : 4:15 am]
    DarkenedFantasies -- you eat lots of beans
    [2026-4-16. : 3:46 am]
    IskatuMesk -- how do i get gas
    [2026-4-15. : 11:43 pm]
    Moose -- you don't
    [2026-4-15. : 10:06 pm]
    Zoan -- how do i get minerals
    [2026-4-14. : 11:45 pm]
    ClansAreForGays -- Anyone wanna played Skewed StarCraft?
    [2026-4-14. : 12:07 am]
    Vrael -- NudeRaider
    NudeRaider shouted: Vrael ranting still is though
    you're a gentleman and a scholar, thank you
    [2026-4-13. : 10:07 pm]
    NudeRaider -- ya why phone people when you can just write letters
    [2026-4-13. : 9:37 pm]
    IskatuMesk -- I have never and will never own a phone
    [2026-4-13. : 9:15 pm]
    NudeRaider -- Vrael ranting still is though
    Please log in to shout.


    Members Online: anoeth47