Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Best way to show player left game
[SOLVED] Best way to show player left game
This topic is locked. You can no longer write replies here.
May 17 2012, 5:08 am
By: Oo.DaMeiN.oO  

May 17 2012, 5:08 am Oo.DaMeiN.oO Post #1



So here's the scenario:

Each player controls just one type of unit the whole game, when it dies it is respawned in ~10 seconds.

I have observer slots that I would like to utilize if a player drops/leave the game they would be "swapped" but I can't think of a good way to detect if a player has left the game. Thanks in advance!



None.

May 17 2012, 5:14 am Roy Post #2

An artist's depiction of an Extended Unit Death

Have a trigger owned by each player to set a death, and have a computer player reset the deaths each trigger cycle. Players with no deaths are not or no longer in the game.

Example:

Trigger
Players
  • Player 1
  • Player 2
  • Player 3
  • Player 4
  • Player 5
  • Player 6
  • Conditions
  • Always
  • Actions
  • Set Deaths of Cave for Current Player: Set to 1
  • Preserve Trigger

  • Trigger
    Players
  • Player 8
  • Conditions
  • Player 1 suffered exactly 0 deaths of Cave
  • Actions
  • // Player 1 is not in the game
  • Trigger
    Players
  • Player 8
  • Conditions
  • Player 2 suffered exactly 0 deaths of Cave
  • Actions
  • // Player 2 is not in the game
  • Trigger
    Players
  • Player 8
  • Conditions
  • Player 3 suffered exactly 0 deaths of Cave
  • Actions
  • // Player 3 is not in the game
  • etc.

    Trigger
    Players
  • Player 8
  • Conditions
  • Always
  • Actions
  • Set Deaths of Cave for All Players: Set to 0


  • The reason this works is because triggers owned by players that aren't in the game do not run. So if Player 3 isn't in the game, the trigger to set deaths of Cave for Player 3 won't run, and it will be 0.

    Like I mentioned, this will also detect players that were never in the game to begin with. If this is a problem, you can always make a similar system at the very start of the game to check if the player is there.




    May 17 2012, 9:19 am NudeRaider Post #3

    We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

    Quote from Roy
    Like I mentioned, this will also detect players that were never in the game to begin with. If this is a problem, you can always make a similar system at the very start of the game to check if the player is there.
    Or you modify your system to "reset" to 2 (instead of 0) and check for this 2 in the "Player isn't here" triggers.

    That way players that never were there will have 0 deaths, and those who were at least present during the first trigger run will cycle through 1 and 2.

    This works because setting for "All Players" affects only players that are still in the game.




    May 17 2012, 12:53 pm Oo.DaMeiN.oO Post #4



    I guess I don't understand how the trigger for the Player has left game wouldn't fire when the score is set to 0, because how would I ensure the triggers loop back to the set to 1 before the check has fired.

    Because with what you said I have:

    Trigger
    Players
  • Player 1
  • Player 2
  • Player 3
  • Player 4
  • Player 5
  • Player 6
  • Conditions
  • Always
  • Actions
  • Set Deaths("Current Player", "Protoss Observer", Set To, 1);
  • Preserve Trigger();


  • Trigger
    Players
  • Player 8
  • Conditions
  • Always
  • Actions
  • Set Deaths("All players", "Protoss Observer", Set To, 2);
  • Preserve Trigger();


  • Trigger
    Players
  • Player 8
  • Conditions
  • Deaths("Player 1", "Protoss Observer", Exactly, 2);
  • Actions
  • Set Deaths("Player 8", "Protoss Probe", Set To, 1);
  • (For 1-6 I have this trigger)

    But the triggers fire at start of game, even if P1-6 are in game.



    None.

    May 17 2012, 1:02 pm Roy Post #5

    An artist's depiction of an Extended Unit Death

    It's easier conceptually to just have a separate DC to indicate if a player was there at the beginning of the game.

    Nude's idea, if I'm reading it correctly, is to have players set deaths to 2 instead of 1, and the reset trigger subtracts 1 death instead of setting deaths to 0. That way, if Player 8 sees a player with exactly 1 death of the unit, it means the player has just left the game.

    Example:

    Trigger
    Players
  • Player 1
  • Player 2
  • Player 3
  • Player 4
  • Player 5
  • Player 6
  • Conditions
  • Always
  • Actions
  • Set Deaths of Cave for Current Player: Set to 2
  • Preserve Trigger

  • Trigger
    Players
  • Player 8
  • Conditions
  • Player 1 suffered exactly 0 deaths of Cave
  • Actions
  • // Player 1 is not in the game
  • Trigger
    Players
  • Player 8
  • Conditions
  • Player 1 suffered exactly 1 deaths of Cave
  • Actions
  • // Player 1 just left the game

  • Trigger
    Players
  • Player 8
  • Conditions
  • Always
  • Actions
  • Set Deaths of Cave for All Players: Subtract 1


  • I also forgot to mention that it's important that the reset trigger in both systems must come after the leave checks; it won't work correctly if you put it above the check triggers. Of course, if you've spent time with trigger firing order, you'd already know this.




    May 17 2012, 1:43 pm Oo.DaMeiN.oO Post #6



    Yeah.. I realized that and changed it, forgot to post right away. I wasn't thinking about the trigger execution order, haha.

    Sorry ^^;

    Works great, thanks guys :)



    None.

    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: Dem0n