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.
    [03:20 am]
    Symmetry -- Dang I'm up to 155 minerals gambling really pays off guys
    [2026-10-11. : 6:02 am]
    Donald -- Samase
    [2026-10-09. : 2:53 am]
    Mr.BurnLiquid -- Symmetry
    Symmetry shouted: I'll check it out this weekend!
    Thanks
    [2026-10-09. : 2:47 am]
    Symmetry -- I'll check it out this weekend!
    [2026-10-09. : 2:40 am]
    Mr.BurnLiquid -- Symmetry
    Symmetry shouted: Another map maker? Damn we really ARE back
    I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
    [2026-10-09. : 2:27 am]
    Symmetry -- Another map maker? Damn we really ARE back
    [2026-10-09. : 1:51 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Now that I wanted to change my avatar, the error image is showing up, haha.
    [2026-10-09. : 1:34 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Mr.BurnLiquid
    Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
    I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
    [2026-10-09. : 1:33 am]
    Mr.BurnLiquid -- Ultraviolet
    Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
    Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
    Please log in to shout.


    Members Online: lifebot