Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Making players take turns...
Making players take turns...
This topic is locked. You can no longer write replies here.
Sep 26 2009, 5:17 am
By: eMi  

Sep 26 2009, 5:17 am eMi Post #1



I can't figure out a way to make the players in the map i'm making take turns.

I want them to go one by one, starting with player 1 or closest to it, then when he dies, next player starts and so on. After last player dies, it starts back at the first one who went. Anyone know a good way to do this?



None.

Sep 26 2009, 6:04 am lil-Inferno Post #2

Just here for the pie

Code
Trigger("All players"){
Conditions:
    Always();

Actions:
    Set Deaths("All players", "Cave", Set To, 1);
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At least, 1);

Actions:
    Set Deaths("Player 1", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At least, 1);

Actions:
    Set Deaths("Player 2", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At least, 1);

Actions:
    Set Deaths("Player 3", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At most, 0);
    Deaths("Player 4", "Cave", At least, 1);

Actions:
    Set Deaths("Player 4", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At most, 0);
    Deaths("Player 4", "Cave", At most, 0);
    Deaths("Player 5", "Cave", At least, 1);

Actions:
    Set Deaths("Player 5", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At most, 0);
    Deaths("Player 4", "Cave", At most, 0);
    Deaths("Player 5", "Cave", At most, 0);
    Deaths("Player 6", "Cave", At least, 1);

Actions:
    Set Deaths("Player 6", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At most, 0);
    Deaths("Player 4", "Cave", At most, 0);
    Deaths("Player 5", "Cave", At most, 0);
    Deaths("Player 6", "Cave", At most, 0);
    Deaths("Player 7", "Cave", At least, 1);

Actions:
    Set Deaths("Player 7", "Cave", Set To, 0);
    Preserve Trigger();
}

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

Trigger("All players"){
Conditions:
    Deaths("Player 1", "Cave", At most, 0);
    Deaths("Player 2", "Cave", At most, 0);
    Deaths("Player 3", "Cave", At most, 0);
    Deaths("Player 4", "Cave", At most, 0);
    Deaths("Player 5", "Cave", At most, 0);
    Deaths("Player 6", "Cave", At most, 0);
    Deaths("Player 7", "Cave", At most, 0);
    Deaths("Player 8", "Cave", At least, 1);

Actions:
    Set Deaths("Player 8", "Cave", Set To, 0);
    Set Deaths("All players", "Cave", Set To, 1);
    Preserve Trigger();
}

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



Of course, in the actions you would need to input the triggers that you would do in order for the players to take turns. I don't know what they are, so you'll need to put them in yourself. The way I made it supports eight players so just trim off the triggers that you don't need in order to suffice for the number of human players possible in the game.




Sep 26 2009, 6:51 am DavidJCobb Post #3



lil-inferno, wouldn't it be simpler if they just incremented a single death count after each turn, checking it separately for values 1-8? I think it'd be about as many triggers, but fewer death counts would be used, which would shorten the triggers. Like, if, say, Player 1 has suffered 5 deaths of Nuclear Missile, then it's Player 5's turn.



None.

Sep 26 2009, 6:53 am eMi Post #4



Player 1 doesn't always go first, if p1 isn't in game, then it starts with p2
does that set-up u showed me work still like that?

Echo is helping me atm



None.

Sep 26 2009, 6:55 am lil-Inferno Post #5

Just here for the pie

Quote from DavidJCobb
lil-inferno, wouldn't it be simpler if they just incremented a single death count after each turn, checking it separately for values 1-8? I think it'd be about as many triggers, but fewer death counts would be used, which would shorten the triggers. Like, if, say, Player 1 has suffered 5 deaths of Nuclear Missile, then it's Player 5's turn.
It doesn't matter how many triggers you use as long as it gets the job done, and your method wouldn't work properly. Also, I only used a single death count as a statistic keeper so that you can detect people who've left and people who aren't there, so I really don't get the benefits, if any, of what you're saying.

EDIT: If player 1 wasn't there, your triggers would be fucked. It's just more work for you to do in order to compensate.




Sep 26 2009, 6:58 am lil-Inferno Post #6

Just here for the pie

Pardon me for the double post but...
Quote from eMi
Player 1 doesn't always go first, if p1 isn't in game, then it starts with p2
does that set-up u showed me work still like that?

Echo is helping me atm
Yes, my method accounts for that. Since player 1 isn't in the game, player 1 won't receive a death of "Cave", and the triggers will move down to player 2 and so forth until it finds a player that has the death.




Sep 26 2009, 7:11 am DavidJCobb Post #7



One unit, but eight death counters (each player gets a separate death count for the unit). Didn't notice the "or closest to [Player 1]" in the original post, though, so yeah, I guess my method would require more work to compensate for that...



None.

Sep 26 2009, 8:21 am Echo Post #8



Solved.



None.

Sep 26 2009, 8:24 am eMi Post #9



Quote from Echo
Solved.
Thanks a lot man

I definitely recommend Echo for map making help, he's nice and explained everything he did very well.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:46 pm]
Ultraviolet -- @:@
@:@ shouted: this community still going strong?
Still going.. strong is debatable though.
[04:13 pm]
WeirdoX4857 -- I can't believe this is really been around since 2003 but it does look classic and old asf still better than talking to kids on discord ranting about skibidi toilet and sexuality or whatever mental illness is going on in their heads
[04:11 pm]
WeirdoX4857 -- Nigga how you ask is it still going strong when you get a text every 3 miles per hour or something
[04:10 pm]
WeirdoX4857 -- Where is everybody
[01:21 pm]
@:@ -- this community still going strong?
[2026-9-27. : 4:30 pm]
Oh_Man -- yeah, probs
[2026-9-27. : 3:11 pm]
NudeRaider -- I bet it just needs another training session against pros instead of only against itself and nobody will be able to stop it anymore.
[2026-9-27. : 3:09 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
so it can be beaten by a prepared pro, even in macro games, if only barely. the muta micro in particular seems really hard to handle for protoss ground though. In the open goons can't catch them, in the base they trip over buildings, it just instantly flies out of storms and they fly circles around archons. Mass cannons do work, but can't cover the whole map with it. Probably need mass corsair to counter and hope you can outmaneuver all the scourge.
[2026-9-27. : 2:14 am]
Oh_Man -- pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
[2026-9-27. : 1:14 am]
Symmetry -- https://staredit.net/topic/18932/ check it
Please log in to shout.


Members Online: Wing Zero