Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Easy way to detect a droppe or quitted player
Easy way to detect a droppe or quitted player
Jan 15 2009, 9:40 pm
By: alexpnd  

Jan 15 2009, 9:40 pm alexpnd Post #1



I global actions going on for every player beacon and I dont want it to activate if a player has left or has dropped. Anyway to detect this so I can set a switch?



None.

Jan 15 2009, 9:44 pm Biophysicist Post #2



Detecting leaving is easy: Have a trigger that runs for All Players that sets a switch/DC if Player One commands exactly 0 [any unit], and then copies for all the other players.



None.

Jan 15 2009, 9:57 pm alexpnd Post #3



Sweet. I have that but no way to test it since I only have one computer. Thanks! Your a good guy!

Woops. Say i have a trigger, it adds 1 to an "ActivePlayer" death count. Will having another trigger with this (above) command run that if the players arent there right off the bat? or only if they leave?



None.

Jan 15 2009, 10:06 pm Biophysicist Post #4



I'm not sure I understand... If you are asking "Will your trigger detect if a player never joined?", then yes. If a player never joins in the first place, their units never appear on the map, so the trigger would say that they left.



None.

Jan 15 2009, 10:22 pm alexpnd Post #5



Ok. Well heres what it is so you can see. PlayersActive is not about who is present, its about who is in the game. If you lose you can observe so your not in the game. However if a non observing player drops i want PlayersActive to diminish to suit the rest of the players tournament style game.

Condition:
dcGameStart = 1
Current Player commands at least 1 anything
Action:
dcPlayersActive + 1

(the above condition wont run for any null players right?)



Condition:
dcGameStart = 1
Current Player commands exactly 0 anything
PlayerObserving = 0 (if the player isnt observing, meaning he would still be in the round if he commands 0)
Action:
PlayersActive - 1

(will this run for null players?)


What I mean to say is what triggers will run for Current Player? I thought the players triggers were disabled if the player is not present.



None.

Jan 16 2009, 6:29 am Rantent Post #6



You could have it run by a computer player.



None.

Jan 16 2009, 8:09 am Wormer Post #7



Quote from alexpnd
What I mean to say is what triggers will run for Current Player? I thought the players triggers were disabled if the player is not present.
Right. Dont forget that setting triggers for All Players is equivalent to copying the trigger for each player. Triggers for players which dont present in the game (empty slot at start, dropped players, or players who left the game) are not executed. I suppose you call such players a null players.

Quote from alexpnd
Condition:
dcGameStart = 1
Current Player commands at least 1 anything
Action:
dcPlayersActive + 1

(the above condition wont run for any null players right?)
This is the reason this trigger wont run for null players, as you name them.

Quote from alexpnd
Condition:
dcGameStart = 1
Current Player commands exactly 0 anything
PlayerObserving = 0 (if the player isnt observing, meaning he would still be in the round if he commands 0)
Action:
PlayersActive - 1

(will this run for null players?)
This is also the reason this trigger wont work properly. You must detect null players using triggers of players who are in the game.

You need some copying to make this work. The last trigger could be rewritten to:
Quote
TRIGGER
OWNERS: AllPlayers
CONDITIONS:
Player n commands exactly 0 any unit.
Player n has suffered: exacly 0 deaths of dcPlayerObserving
Player n has suffered: exacly 0 deaths of dcPlayerNull
ACTIONS:
Set deaths for Player n: set to 1 of dcPlayerNull
// whatever you wish, I dont understand how you're tracking active players.
We need the dcPlayerNull because otherwise this trigger would have been executed for each active player. To counter this the first player executing the trigger checks player n as already treated.

Finally you should copy this trigger for each player's number n from 1 to 8, which I usually write like:
Quote
FOR n=1 TO 8 DO
TRIGGER
OWNERS: AllPlayers
CONDITIONS:
Player n commands exactly 0 any unit.
Player n has suffered: exacly 0 deaths of dcPlayerObserving
Player n has suffered: exacly 0 deaths of dcPlayerNull
ACTIONS:
Set deaths for Player n: set to 1 of dcPlayerNull
// whatever you wish, I dont understand how you're tracking active players.
END

Once more, please note that actions will be executed for each null player at the moment when he becomes null. Triggers for empty player slots will be executed right at start.

Post has been edited 2 time(s), last time on Jan 16 2009, 8:16 am by Wormer.



Some.

Jan 16 2009, 8:44 am alexpnd Post #8



Ok I did it with the computer player. Im going to test with 4 players this weekend at my buddies.
Thanks wormer. I was keeping track of them with dcPlayerStatus, 0 null, 1 active, 2 other things. So this should work. The key point was not to subtract from total players active without him actually being gone and not never there lol. So I can discern how many rounds to play of elimination. I'm probably going long ways about it but its my first map in several years so I'm rusty. It's turning out pretty good though. Thanks again.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:05 pm]
Ultraviolet -- :wob:
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
Please log in to shout.


Members Online: Ultraviolet