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.
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
[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.
[2024-5-18. : 3: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
Please log in to shout.


Members Online: Roy, NudeRaider