Votekick! [Solved]

Status
Not open for further replies.
Level 11
Joined
Jun 20, 2017
Messages
380
Hi, I'm trying to make a voting system (one at a time) where you can only kick allies, there are a few problems that I can't solve!
Yes votes" has to be higher than "No votes" in order to kick someone!
Like you can't kick when there are only 2 players in your team.
And it does not work after 1 time use!
  • Setup Active Users
    • Events
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to PlayerGroup_AllPlayers
      • Player Group - Add Player 2 (Blue) to PlayerGroup_AllPlayers
      • Player Group - Add Player 3 (Teal) to PlayerGroup_AllPlayers
      • Player Group - Add Player 4 (Purple) to PlayerGroup_AllPlayers
      • Player Group - Add Player 5 (Yellow) to PlayerGroup_AllPlayers
      • Player Group - Add Player 6 (Orange) to PlayerGroup_AllPlayers
      • Player Group - Add Player 7 (Green) to PlayerGroup_AllPlayers
      • Player Group - Add Player 8 (Pink) to PlayerGroup_AllPlayers
      • Player Group - Add Player 9 (Gray) to PlayerGroup_AllPlayers
      • Player Group - Add Player 10 (Light Blue) to PlayerGroup_AllPlayers
      • Player Group - Add Player 11 (Dark Green) to PlayerGroup_AllPlayers
      • Player Group - Add Player 12 (Brown) to PlayerGroup_AllPlayers
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_AllPlayers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PlayerGroup_ActiveUsers
            • Else - Actions
  • Setup Active Teams
    • Events
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to PlayerGroup_WestTeam
      • Player Group - Add Player 2 (Blue) to PlayerGroup_WestTeam
      • Player Group - Add Player 3 (Teal) to PlayerGroup_WestTeam
      • Player Group - Add Player 4 (Purple) to PlayerGroup_WestTeam
      • Player Group - Add Player 5 (Yellow) to PlayerGroup_WestTeam
      • Player Group - Add Player 6 (Orange) to PlayerGroup_WestTeam
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_WestTeam and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PlayerGroup_WestTeamActive
            • Else - Actions
      • -------- --------
      • Player Group - Add Player 7 (Green) to PlayerGroup_EastTeam
      • Player Group - Add Player 8 (Pink) to PlayerGroup_EastTeam
      • Player Group - Add Player 9 (Gray) to PlayerGroup_EastTeam
      • Player Group - Add Player 10 (Light Blue) to PlayerGroup_EastTeam
      • Player Group - Add Player 11 (Dark Green) to PlayerGroup_EastTeam
      • Player Group - Add Player 12 (Brown) to PlayerGroup_EastTeam
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_EastTeam and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Picked player) to PlayerGroup_EastTeamActive
            • Else - Actions
  • Votekick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -kick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -kick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -kick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -kick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -kick as An exact match
      • Player - Player 7 (Green) types a chat message containing -kick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -kick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -kick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -kick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -kick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -kick as An exact match
    • Conditions
      • Boolean_VotekickIsOn Equal to False
    • Actions
      • Set VariableSet Player_KickingOut = (Triggering player)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayerGroup_ActiveUsers) Less than or equal to 2
          • (Number of players in PlayerGroup_WestTeamActive) Less than or equal to 2
          • (Number of players in PlayerGroup_EastTeamActive) Less than or equal to 2
        • Then - Actions
          • Game - Display to (All players matching ((Matching player) Equal to Player_KickingOut).) for 10.00 seconds the text: |cffff0000You need ...
        • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_VotekickIsOn Equal to True
        • Then - Actions
          • Game - Display to (All players matching ((Matching player) Equal to Player_KickingOut).) for 10.00 seconds the text: |cffff0000Someone h...
        • Else - Actions
          • Set VariableSet Boolean_VotekickIsOn = True
      • -------- --------
      • Dialog - Clear Dialog_Votekick
      • Dialog - Change the title of Dialog_Votekick to Who would you like ...
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_ActiveUsers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Player_KickingOut
              • ((Picked player) is an ally of Player_KickingOut.) Equal to True
            • Then - Actions
              • Dialog - Create a dialog button for Dialog_Votekick labelled (Strings_PlayersColor[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
              • Set VariableSet DialogButtons_Votekick[(Player number of (Picked player))] = (Last created dialog Button)
            • Else - Actions
      • -------- --------
      • Dialog - Create a dialog button for Dialog_Votekick labelled Cancel
      • Set VariableSet DialogButton_VotekickCancel = (Last created dialog Button)
      • Dialog - Show Dialog_Votekick for Player_KickingOut
      • Trigger - Turn on Votekick A Player <gen>
  • Votekick A Player
    • Events
      • Dialog - A dialog button is clicked for Dialog_Votekick
    • Conditions
    • Actions
      • Dialog - Hide Dialog_Votekick for Player_KickingOut
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton_VotekickCancel
        • Then - Actions
          • Set VariableSet Boolean_VotekickIsOn = False
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_ActiveUsers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtons_Votekick[(Player number of (Picked player))]
            • Then - Actions
              • Set VariableSet Player_KickedOut = (Picked player)
            • Else - Actions
      • -------- --------
      • Dialog - Clear Dialog_VotekickVoting
      • Dialog - Change the title of Dialog_VotekickVoting to ((Name of Player_KickingOut) + (wants to kick + (Name of Player_KickedOut)))
      • Dialog - Create a dialog button for Dialog_VotekickVoting labelled Yes
      • Set VariableSet DialogButton_VotekickYes = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_VotekickVoting labelled No
      • Set VariableSet DialogButton_VotekickNo = (Last created dialog Button)
      • -------- --------
      • Countdown Timer - Start Timer_Votekick as a One-shot timer that will expire in 30.00 seconds
      • Set VariableSet Timer_Votekick = (Last started timer)
      • Countdown Timer - Create a timer window for Timer_Votekick with title Vote expires in
      • Set VariableSet TimerWindow_Votekick = (Last created timer window)
      • Countdown Timer - Show TimerWindow_Votekick
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_ActiveUsers and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Player_KickedOut
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Not equal to Player_KickingOut
                • Then - Actions
                  • Dialog - Show Dialog_VotekickVoting for (Picked player)
                • Else - Actions
                  • Set VariableSet Booleans_PlayerVoted[(Player number of (Picked player))] = True
            • Else - Actions
              • Set VariableSet Booleans_PlayerVoted[(Player number of (Picked player))] = True
      • -------- --------
      • Set VariableSet Integer_VotekickYes = 1
      • Set VariableSet Integer_VotekickNo = 1
      • Trigger - Turn on Votekick Voting <gen>
  • Votekick Voting
    • Events
      • Dialog - A dialog button is clicked for Dialog_VotekickVoting
    • Conditions
      • Booleans_PlayerVoted[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set VariableSet Booleans_PlayerVoted[(Player number of (Triggering player))] = True
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton_VotekickYes
        • Then - Actions
          • Set VariableSet Integer_VotekickYes = (Integer_VotekickYes + 1)
        • Else - Actions
          • Set VariableSet Integer_VotekickNo = (Integer_VotekickNo + 1)
      • -------- --------
      • Dialog - Hide Dialog_VotekickVoting for (Triggering player)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer_VotekickYes + Integer_VotekickNo) Greater than or equal to (Number of players in PlayerGroup_ActiveUsers)
        • Then - Actions
          • Trigger - Run Votekick Expired <gen> (checking conditions)
        • Else - Actions
  • Votekick Cancel
    • Events
      • Dialog - A dialog button is clicked for Dialog_VotekickCancel
    • Conditions
      • (Clicked dialog button) Equal to DialogButton_VotekickCancel
    • Actions
      • Countdown Timer - Hide TimerWindow_Votekick
      • Countdown Timer - Destroy TimerWindow_Votekick
  • Votekick Expired
    • Events
      • Time - Timer_Votekick expires
    • Conditions
      • Boolean_VotekickIsOn Equal to True
    • Actions
      • Countdown Timer - Hide TimerWindow_Votekick
      • Countdown Timer - Destroy TimerWindow_Votekick
      • -------- --------
      • Player Group - Pick every player in PlayerGroup_ActiveUsers and do (Actions)
        • Loop - Actions
          • Dialog - Hide Dialog_VotekickVoting for (Picked player)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Real((Number of players in PlayerGroup_ActiveUsers))) / 100.00) x 60.00) Less than or equal to (Real(Integer_VotekickYes))
        • Then - Actions
          • Game - Defeat Player_KickedOut with the message: You have been kicke...
          • Game - Display to (All players) for 10.00 seconds the text: ((Name of Player_KickedOut) + has been kicked out.)
          • Player Group - Remove Player_KickedOut from PlayerGroup_ActiveUsers.
        • Else - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cffff0000Votekick ...
 

Attachments

  • kick44.w3m
    23.8 KB · Views: 4
Last edited:
Level 13
Joined
Jan 10, 2023
Messages
223
I'm working on this but have a couple of questions:
  1. Do you care about the inactive players? I mean at the end of it all, are the forces for the inactive full-sized teams useful or are they just your way of getting the active players in their team forces? I was going to remove them if you don't need them for something else.
  2. Do you want it to work...
    1. Like this:
      • Players can only initiate a vote:
        1. for players on their own team.
        2. if the game has 3+ players.
        3. players who have at least one teammate. (implied by list item #1)
      • All players get to vote on whether the player is kicked, even opponents.
    2. Or Like this:
      • Players can only initiate a vote:
        1. for players on their own team.
        2. if their team has 3+ players.
      • Only teammates get to vote on whether the player is kicked.
I was getting mixed signals about question #2 because of the trigger that checks if each team has 2+ players AND if the game has 2+ players (which must be true if either team has 2+). It seems like because all players get to vote, regardless of which team they are on, it should only matter if the game has 3+ players, and in that case I would add another check to make sure the kicking player has a teammate and the game has 3+ players for the vote.

It seems to me that question #2 should be answered with option #1 if all players vote or option #2 if only one team votes.

Either way, let me know or I'm just going to assume ditch the extra forces for question #1 and option #1 for question #2.
They are both easy to change later.
 
Level 11
Joined
Jun 20, 2017
Messages
380
If you've played League of Legends before, there's a surrender system in it that you can start by typing -ff !ff /ff I don't remember exactly, I haven't played it in a while.
And there's a 60 second cooldown on whether or not your allies have to vote! if they don't vote it counts as a no.
But I remember that the system was not working properly because when 4 people voted yes for it and only one person voted against it, the game continued! and 1 person was holding 4 people hostage!

1. I'm glad you asked, because this way we can create an auto-kick system, for example if a player is AFK for x amount of time, the system kicks them out of the game!

2. I want the second option please!
 
Level 13
Joined
Jan 10, 2023
Messages
223
If you've played League of Legends before, there's a surrender system in it that you can start by typing -ff !ff /ff I don't remember exactly, I haven't played it in a while.
And there's a 60 second cooldown on whether or not your allies have to vote! if they don't vote it counts as a no.
But I remember that the system was not working properly because when 4 people voted yes for it and only one person voted against it, the game continued! and 1 person was holding 4 people hostage!
I added the option to abstain from voting and I was going to make that equivalent to voting no, because well... free expression...
Anyway, I saw you had your timer set to 30 seconds. I'm taking notes as I rework it to give a better breakdown later, but one of the issues I saw was that in this system, a player and break the kicking system by typing "-kick" and then never choosing a player to kick. I just made the timer start at the first trigger and reset when the actual vote takes place.

1. I'm glad you asked, because this way we can create an auto-kick system, for example if a player is AFK for x amount of time, the system kicks them out of the game!
I think we don't need a force to do that, if a player is not playing, that is one thing (that is what your trigger checked).
If a player is playing but not doing anything - if they are AFK - then we wouldn't really care to put them in a group, but rather we should remove them from the active group if we boot them.

2. I want the second option please!
Okay, you are aware that your system as you have it allows all players to vote, right?
Just to confirm - only teammates may vote on the fate of their own teammates?
In this case, why not make it so that both teams can have a voting session at the same time?
It might end up being another exploit if not - not that it's always reasonable to handle every exploit, but this would also be a feature.
 
Last edited:
Level 11
Joined
Jun 20, 2017
Messages
380
I think we don't need a force to do that...
I mean it works for some maps!
But mine, let's say a player plays the game for 10 minutes or 10 rounds, then something happens and he/she becomes inactive or afk.
And we have to deal with his/her creeps (since he/she is leaking) to win the game!
In this case, why not make it so that both teams can have a voting session at the same time?
I don't think it is logical that enemy players can vote for it because it is a competitive game!
But yeah, this can only be useful when there are only 2 players in a team, so he/she needs a vote to kick his/her trolling teammate!

Is it possible to make it work both ways?! like when there are only 2 players in a team and you need the vote of the enemy team to kick your trolling teammate! Otherwise, if there were more players, you can only kick your ally!
 
Level 13
Joined
Jan 10, 2023
Messages
223
I mean it works for some maps!
But mine, let's say a player plays the game for 10 minutes or 10 rounds, then something happens and he/she becomes inactive or afk.
And we have to deal with his/her creeps (since he/she is leaking) to win the game!
It could be useful, it depends a lot on preference I suppose. To use myself as an example, I personally would only bother to use forces if I was grouping players based on something unique about their 'state'. In this case we could call the team they are on a state, we don't want to have to check that again so if we put them in a group it is convenient. Another option that is available to us in this case is to simply remember what the teams are - because in this case they are sequential - we can just say every player is on team [(player_number) / 7 + 1] and then we never have to check what team the player is on.

So in your initiation trigger for example, instead of adding each player to a group individually, we can do this:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) controller) Equal to User
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Player Group - Add (Player((Integer A))) to PlayerGroup_TeamActive[0]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Greater than 6
            • Then - Actions
              • Player Group - Add (Player((Integer A))) to PlayerGroup_TeamActive[1]
            • Else - Actions
              • Player Group - Add (Player((Integer A))) to PlayerGroup_TeamActive[2]
        • Else - Actions
Where PlayerGroup_TeamActive[0] is all active players.
So if a player is inactive, we remove them from the group, and so now if they are not in the group they must be inactive.
It really doesn't matter at the end of the day as long as it is convenient to you, you can achieve the desired result, and it isn't causing any issues to performance. I'll add it back. My only other word of warning is that if you have more groups that's more room for error and more tasks to complete when it comes to changing a player from active to inactive, but again these are essentially a matter of preference based on what is convenient for adding new features and such and it sounds like you have some plans.

Let me know if you don't like the look of having teams referred to as a member of a variable array - it's simply easier to take advantage of numbers using arrays, but we're not doing anything too crazy here so it doesn't matter much to me. The remainder of what I am working on relies on the array, so I hope you don't mind it, but again, it hardly matters, just makes everything neater IMO.

I don't think it is logical that enemy players can vote for it because it is a competitive game!
But yeah, this can only be useful when there are only 2 players in a team, so he/she needs a vote to kick his/her trolling teammate!
I agree, I just wasn't sure if you did that on purpose because I thought you might be worried about someone chat-spamming or something that could affect all players.

What I really meant here is that if the teams don't vote together, why can't Team 1 vote to kick Player 3 while at the same time Team 2 can be having a vote to kick Player 8. Seems like we should make that a possibility.

Is it possible to make it work like when there are only 2 players in a team and you need the vote of the enemy team to kick your trolling teammate! Otherwise, if there were more players, you can only kick your ally!
Yes, it's just a matter of putting the work in. Now is the time to mention any other niche features anyway. I'll see what I can come up with, should be no problem.
In this event, I would make it so that there could not be a vote happening for both teams at the same time, as per the previous quote response, since that would not be functional, if I have convinced you to enable a single vote session per team.

A new question/feature for the case where one team has only 2 players, allowing the opponents to vote:
Should the player still need a majority vote in this case? Or maybe just 1 enemy vote?
Compare this to the case where I am on a team of 3:
  • I would only need the vote of my 3rd teammate to boot my teammate player.
  • Even if the enemy team has all 6 players - they don't get a vote - I only need the support of 1 teammate.
Seems like it's only fair, and maybe wise, to make it so I only need 1 enemy vote if my team doesn't have enough players.
 
Level 11
Joined
Jun 20, 2017
Messages
380
I have an AFK system in my map, where if a player is AFK (or does nothing) my multiboard shows their status as an AFK, so this way I can get rid of them.
So the auto-kick system is actually useless.
Let me know...
Yes, you can definitely use it that way.
Seems like it's only fair, and maybe wise, to make it so I only need 1 enemy vote if my team doesn't have enough players.
Yeah, one is enough.
 
Level 13
Joined
Jan 10, 2023
Messages
223
I haven't tested it (I would need a small army) and frankly, I'm not super happy with it because well... I kind of complicated the original idea and while I think it should work well without flaw, I am a little bit afraid it will be a huge pain to read and because of that it might be hard to work with.
Either way, I've been putting too much time into this making minute changes and I've got to just call it.

Like I said, this should work, but might not be pretty... and I haven't tested it, but it reads logically to me.

Setup Active Users:
  • Setup Active Users
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Create a timer window for Timer_VoteKick[0] with title Vote expires in
      • Set VariableSet TimerWindow_VoteKick[0] = (Last created timer window)
      • Countdown Timer - Create a timer window for Timer_VoteKick[1] with title Vote expires in
      • Set VariableSet TimerWindow_VoteKick[1] = (Last created timer window)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Player((Integer A))) to PlayerGroup_TeamActive[(Integer_VoteTeam / 7)]
            • Else - Actions

Votekick:
  • Votekick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -kick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -kick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -kick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -kick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -kick as An exact match
      • Player - Player 7 (Green) types a chat message containing -kick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -kick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -kick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -kick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -kick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -kick as An exact match
    • Conditions
    • Actions
      • -------- --------
      • -------- For Players 1 - 6 -----------> Integer_VoteTeam = 0 --------
      • -------- For Players 7 - 12 ----------> Integer_VoteTeam = 1 --------
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to False
          • Boolean_VoteKickIsOn[Integer_VoteTeam] Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) Less than or equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boolean_VoteKickIsOn[(1 - Integer_VoteTeam)] Equal to False
                • Then - Actions
                  • -------- --------
                  • -------- This begins a vote for a team with only two players (one enemy must agree) --------
                  • -------- With Boolean_EnemyVote = True, initiating a vote is disabled for both teams. --------
                  • Set VariableSet Boolean_EnemyVote = True
                  • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your team...
                  • -------- --------
                • Else - Actions
                  • -------- --------
                  • -------- If your team has too few players to have a vote, but the other team to voting (please wait) --------
                  • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your team...
                  • Skip remaining actions
                  • -------- --------
            • Else - Actions
              • -------- --------
              • -------- This begins a vote for a team with more than 2 players (majority vote) --------
              • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your your...
              • -------- --------
        • Else - Actions
          • -------- --------
          • -------- If a teammate has already initiated a vote, or a vote is initialized by an enemy with too few teammates to have a vote (please wait) --------
          • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffff0000Someone h...
          • Skip remaining actions
          • -------- --------
      • -------- --------
      • -------- With Boolean_VoteKickIsOn[Integer_VoteTeam] = True, initiating a vote is disabled for the Kicker's team. --------
      • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = True
      • -------- --------
      • Set VariableSet Player_Kicker[Integer_VoteTeam] = (Triggering player)
      • Dialog - Clear Dialog_VoteKick[Integer_VoteTeam]
      • Dialog - Change the title of Dialog_VoteKick[Integer_VoteTeam] to Who would you like ...
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Player_Kicker[Integer_VoteTeam]
            • Then - Actions
              • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled (Name of (Picked player))
              • Set VariableSet DialogButtons_VoteKick[(Player number of (Picked player))] = (Last created dialog Button)
            • Else - Actions
      • -------- --------
      • -------- Because the Kicker will never be listed among the players to kick, we can use the Kicker's player number for the 'Cancel' button. (below) --------
      • -------- --------
      • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled Cancel
      • Set VariableSet DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])] = (Last created dialog Button)
      • Dialog - Show Dialog_VoteKick[Integer_VoteTeam] for Player_Kicker[Integer_VoteTeam]
      • Countdown Timer - Start Timer_VoteKick[Integer_VoteTeam] as a One-shot timer that will expire in 30.00 seconds

Votekick A Player:
  • Votekick A Player
    • Events
      • Dialog - A dialog button is clicked for Dialog_VoteKick[1]
      • Dialog - A dialog button is clicked for Dialog_VoteKick[2]
    • Conditions
      • (Triggering player) Equal to Player_Kicker[(((Player number of (Triggering player)) - 1) / 6)]
    • Actions
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for Player_Kicker[Integer_VoteTeam]
      • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of (Triggering player))]
        • Then - Actions
          • -------- --------
          • -------- In the trigger "Votekick", we made this DialogButtons_VoteKick[(kicker's player number)] the cancel button --------
          • -------- because the Kicker will never be on this Dialog when choosing a Player. --------
          • -------- --------
          • Set VariableSet Boolean_EnemyVote = False
          • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = False
          • Skip remaining actions
        • Else - Actions
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of (Picked player))]
            • Then - Actions
              • Set VariableSet Player_Kicked[Integer_VoteTeam] = (Picked player)
            • Else - Actions
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 1
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 1
      • -------- --------
      • -------- Integer_A is the kicking team above this line. --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to True
        • Then - Actions
          • -------- --------
          • -------- If we are asking the other team to vote, we will set all of the following to be the same for both teams. --------
          • -------- --------
          • Set VariableSet Integer_VoteTeam = (1 - Integer_VoteTeam)
          • Set VariableSet Player_Kicked[Integer_VoteTeam] = Player_Kicked[(1 - Integer_VoteTeam)]
          • Set VariableSet Player_Kicker[Integer_VoteTeam] = Player_Kicker[(1 - Integer_VoteTeam)]
        • Else - Actions
      • -------- --------
      • -------- Integer_A is the voting team below this line --------
      • -------- If the voting team and the kicking team are not the same, they share the same kicker/kicked player below this line. --------
      • -------- --------
      • Dialog - Clear Dialog_VoteKick[Integer_VoteTeam]
      • Dialog - Change the title of Dialog_VoteKick[Integer_VoteTeam] to (Vote to kick: + (Name of Player_Kicked[Integer_VoteTeam]))
      • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled Yes
      • Set VariableSet DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled No
      • -------- --------
      • -------- We don't have to remember the 'No' button; there's no need to put a handle on it, it's the "not Yes button" now... --------
      • -------- --------
      • Countdown Timer - Start Timer_VoteKick[Integer_VoteTeam] as a One-shot timer that will expire in 30.00 seconds
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Player_Kicked[Integer_VoteTeam]
              • (Picked player) Not equal to Player_Kicker[Integer_VoteTeam]
            • Then - Actions
              • Dialog - Show Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
              • Countdown Timer - Show TimerWindow_VoteKick[Integer_VoteTeam] for (Picked player)
            • Else - Actions

Votekick Voting:
  • Votekick Voting
    • Events
      • Dialog - A dialog button is clicked for Dialog_VoteKick[0]
      • Dialog - A dialog button is clicked for Dialog_VoteKick[1]
    • Conditions
      • (Triggering player) Not equal to Player_Kicker[(((Player number of (Triggering player)) - 1) / 6)]
    • Actions
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Triggering player)
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam] for (Triggering player)
      • -------- Integer_A is the voting team above this line --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to True
        • Then - Actions
          • Set VariableSet Integer_VoteTeam = (1 - Integer_VoteTeam)
        • Else - Actions
      • -------- Integer_A is the kicking team below this line --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])]
        • Then - Actions
          • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = (Integer_VoteKickYes[Integer_VoteTeam] + 1)
        • Else - Actions
          • -------- --------
          • -------- Behold the power of the "not Yes button". --------
          • -------- --------
          • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = (Integer_VoteKickNo[Integer_VoteTeam] + 1)
      • -------- Votes are stored to the kicking team, not the voting team --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Greater than ((Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) / 2)
          • Integer_VoteKickNo[Integer_VoteTeam] Greater than ((Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) / 2)
        • Then - Actions
          • Trigger - Run Votekick Verdict <gen> (checking conditions)
        • Else - Actions

Votekick Verdict:
  • Votekick Verdict
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to True
        • Then - Actions
          • Countdown Timer - Pause Timer_VoteKick[(1 - Integer_VoteTeam)]
          • Countdown Timer - Hide TimerWindow_VoteKick[(1 - Integer_VoteTeam)]
          • Player Group - Pick every player in PlayerGroup_TeamActive[(1 - Integer_VoteTeam)] and do (Actions)
            • Loop - Actions
              • Dialog - Hide Dialog_VoteKick[(1 - Integer_VoteTeam)] for (Picked player)
        • Else - Actions
          • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
          • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
          • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
            • Loop - Actions
              • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Greater than Integer_VoteKickNo[Integer_VoteTeam]
        • Then - Actions
          • Game - Defeat Player_Kicked[Integer_VoteTeam] with the message: You have been kicke...
          • Game - Display to (All players) for 10.00 seconds the text: ((Name of Player_Kicked[Integer_VoteTeam]) + has been kicked out.)
          • Player Group - Remove Player_Kicked[Integer_VoteTeam] from PlayerGroup_TeamActive[Integer_VoteTeam].
        • Else - Actions
          • Game - Display to (All players) for 10.00 seconds the text: |cffff0000Votekick ...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
      • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = False
      • Set VariableSet Boolean_EnemyVote = False

Votekick Expired Team1:
  • Votekick Expired Team1
    • Events
      • Time - Timer_VoteKick[0] expires
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = 0
      • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • Set VariableSet Integer_VoteTeam = (((Player number of Player_Kicker[0]) - 1) / 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Equal to 0
        • Then - Actions
          • -------- --------
          • -------- This the timer expiring for taking too long to choose which player to kick. --------
          • -------- (shows only to the Kicker) --------
          • -------- --------
          • Game - Display to (All players matching ((Matching player) Equal to Player_Kicker[Integer_VoteTeam]).) for 10.00 seconds the text: |cffff0000The vote ...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • -------- --------
              • -------- This the timer expiring for taking too long to get an enemy player to second your motion to kick. --------
              • -------- (shows to all players) --------
              • -------- --------
              • Game - Display to (All players) for 10.00 seconds the text: |cffff0000The vote ...
            • Else - Actions
              • -------- --------
              • -------- This the timer expiring for taking too long to get a majority vote from your team. --------
              • -------- (shows to all teammates) --------
              • -------- --------
              • Game - Display to PlayerGroup_TeamActive[Integer_VoteTeam] for 10.00 seconds the text: |cffff0000The vote ...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0

Votekick Expired Team2:
  • Votekick Expired Team2
    • Events
      • Time - Timer_VoteKick[0] expires
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = 1
      • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • Set VariableSet Integer_VoteTeam = (((Player number of Player_Kicker[1]) - 1) / 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Equal to 0
        • Then - Actions
          • -------- --------
          • -------- This the timer expiring for taking too long to choose which player to kick. --------
          • -------- (shows only to the Kicker) --------
          • -------- --------
          • Game - Display to (All players matching ((Matching player) Equal to Player_Kicker[Integer_VoteTeam]).) for 10.00 seconds the text: |cffff0000The vote ...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • -------- --------
              • -------- This the timer expiring for taking too long to get an enemy player to second your motion to kick. --------
              • -------- (shows to all players) --------
              • -------- --------
              • Game - Display to (All players) for 10.00 seconds the text: |cffff0000The vote ...
            • Else - Actions
              • -------- --------
              • -------- This the timer expiring for taking too long to get a majority vote from your team. --------
              • -------- (shows to all teammates) --------
              • -------- --------
              • Game - Display to PlayerGroup_TeamActive[Integer_VoteTeam] for 10.00 seconds the text: |cffff0000The vote ...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
 

Attachments

  • kick44.w3m
    29 KB · Views: 4
Level 11
Joined
Jun 20, 2017
Messages
380
Thank you so much for the effort and time you put into making this, I really appreciate it.
I will test it later, I have to go out now!


Edit,
Well, I tested it and there were a few problems.
1. You forgot to hide those 2 timer windows!
2. When I clicked the cancel button, nothing was canceled, I still had to wait 30 seconds!
3. After that, you couldn't kick anymore! even if you tried to type -kick! it said VK was still running!
4. You removed the condition that if the kicked player was an ally of the kicker, I just want to kick my allies, but you can vote for the enemy and enemy for you!


Can you add the vote number as well? I want to know who voted yes and no! (some may troll)
For example, the game starts 6vs6, so it must have 6 votes, the player who executes the kick command is also considered yes!
5 yes 1 no = kick
4 yes 2 no = kick
3 yes 3 no = no kick
2 yes 4 no = no kick
Now suppose 2 or more people leave or cannot enter the game, let's say 4vs4, now we have a total of 4 votes +1 if there were less players!
 

Attachments

  • Vote Kick.w3m
    32.2 KB · Views: 4
Last edited:
Level 13
Joined
Jan 10, 2023
Messages
223
In response to the last message and as an explanation for the latest changes:

Well, I tested it and there were a few problems.
1. You forgot to hide those 2 timer windows!
2. When I clicked the cancel button, nothing was canceled, I still had to wait 30 seconds!
3. After that, you couldn't kick anymore! even if you tried to type -kick! it said VK was still running!
4. You removed the condition that if the kicked player was an ally of the kicker, I just want to kick my allies, but you can vote for the enemy and enemy for you!
  1. Simple enough. It seems like it's worth saying that if I hadn't made so many mistakes that this system was unusable I would tell you to make this fix yourself. Sorry about that, I haven't taken a deep dive into timer windows and didn't realize they 'show' when you create them.
  2. The trigger "Votekick A Player" had an error in the events
    • Events
      • Dialog - A dialog button is clicked for Dialog_VoteKick[1]
      • Dialog - A dialog button is clicked for Dialog_VoteKick[2]
    The indexes should have been '0' and '1'. I was tired... the biggest reason for all of these mistakes. Should have waited until morning and taken another look. A similar issue also existed in the 'Votekick Expired' triggers.
  3. The broken element above contributed to this no doubt. The system should have been totally unusable to players 1-6 with that mistake.
  4. I honestly don't know what to do about this one. "I don't think it is logical that enemy players can vote for it because it is a competitive game!" is an exact quote of yours. I made some key points about enemies voting, including:
    • This is the big one: Enemies can vote if your team has only 2 players, but it only takes one enemy vote to kick a player. Most of our conversation was about this exact point; I made it a point to convince you to do this based on the following reasons:
      • Players may find a need to kick there only other teammate.
      • Enemies might want to take advantage of the opportunity to have a self-betraying enemy.
        • This could be taken advantage of, if a player from each team work together, but at best they can boil the game down to a 1v1, and that's something players already have the ability to do and if they are really that obsessed with spoiling the game for others, hosts would do better to keep them out of the lobby after learning their name. You can only protect against to much...
    • The above directly contradicts what you are now asking for, which again is not what we decided on. If enemies can vote in every vote, how could we do any of the things we talked about regarding enemy voting?
    • The final decision I made is to stick to the plan, get this thing functioning properly in the way we decided, and call it a day, you can decide then if you want to use it.

Can you add the vote number as well? I want to know who voted yes and no! (some may troll)
For example, the game starts 6vs6, so it must have 6 votes, the player who executes the kick command is also considered yes!
5 yes 1 no = kick
4 yes 2 no = kick
3 yes 3 no = no kick
2 yes 4 no = no kick
No problem, done. I went with a format like:

Results of vote to kick [Player's name]:
X Yes; Y No
Vote (passed/failed)!

I made the top line yellow
The second line is
  • Green for the number of Yes votes
  • Red for the number of No votes
  • Yellow for the "Yes" and "No" text
  • The semicolon is White
The third line is Green for a successful vote and red for a failing vote.

If you want you can change these in the trigger 'Votekick Verdict'

Now suppose 2 or more people leave or cannot enter the game, let's say 4vs4, now we have a total of 4 votes +1 if there were less players!
I assumed you must have some other systems at work that you would be tying this into, since the map was void of anything I guessed that you made this map to keep the remainder of your work private. It's a good idea anyway, it was as easy as removing the player from the player group and it would solve everything with a max delay of 30s VK downtime, but I made a trigger to close it up if the kicker or the kicked player leave.



Here's the latest, and final if it works. Let's put a hold on new ideas, once this works I'd like to be done, I just want to make it work because I didn't mean to give you a version that doesn't function. I say "if it works" because it takes several people to actually test it, at least a test should be done with 4v4, 3v3, 2v2, and 2v1 for each team to test all functionality. In a full game you could basically test it all in one swoop. It seems like you are in a better position to test it than I am and I have no reasonable means to test it...

Trigger - Setup Active Users
  • Setup Active Users
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Countdown Timer - Create a timer window for Timer_VoteKick[0] with title Vote expires in
      • Countdown Timer - Hide (Last created timer window)
      • Set VariableSet TimerWindow_VoteKick[0] = (Last created timer window)
      • Countdown Timer - Create a timer window for Timer_VoteKick[1] with title Vote expires in
      • Countdown Timer - Hide (Last created timer window)
      • Set VariableSet TimerWindow_VoteKick[1] = (Last created timer window)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add (Player((Integer A))) to PlayerGroup_TeamActive[(Integer_VoteTeam / 7)]
            • Else - Actions
Trigger - Votekick
  • Votekick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -kick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -kick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -kick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -kick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -kick as An exact match
      • Player - Player 7 (Green) types a chat message containing -kick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -kick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -kick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -kick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -kick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -kick as An exact match
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to False
          • Boolean_VoteKickIsOn[Integer_VoteTeam] Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) Less than or equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boolean_VoteKickIsOn[(1 - Integer_VoteTeam)] Equal to False
                • Then - Actions
                  • Set VariableSet Boolean_EnemyVote = True
                  • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your team...
                • Else - Actions
                  • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your team...
                  • Skip remaining actions
            • Else - Actions
              • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffffff00Your your...
        • Else - Actions
          • Game - Display to (All players matching ((Matching player) Equal to (Triggering player)).) for 10.00 seconds the text: |cffff0000Someone h...
          • Skip remaining actions
      • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = True
      • Set VariableSet Player_Kicker[Integer_VoteTeam] = (Triggering player)
      • Dialog - Clear Dialog_VoteKick[Integer_VoteTeam]
      • Dialog - Change the title of Dialog_VoteKick[Integer_VoteTeam] to Who would you like ...
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Player_Kicker[Integer_VoteTeam]
            • Then - Actions
              • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled (Name of (Picked player))
              • Set VariableSet DialogButtons_VoteKick[(Player number of (Picked player))] = (Last created dialog Button)
            • Else - Actions
      • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled Cancel
      • Set VariableSet DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])] = (Last created dialog Button)
      • Dialog - Show Dialog_VoteKick[Integer_VoteTeam] for Player_Kicker[Integer_VoteTeam]
      • Countdown Timer - Start Timer_VoteKick[Integer_VoteTeam] as a One-shot timer that will expire in 15.00 seconds
Trigger - Votekick Dialog Button (combined 'Votekick A Player' and 'Votekick Voting')
  • Votekick Dialog Button
    • Events
      • Dialog - A dialog button is clicked for Dialog_VoteKick[0]
      • Dialog - A dialog button is clicked for Dialog_VoteKick[1]
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Triggering player)
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam] for (Triggering player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to Player_Kicker[(((Player number of (Triggering player)) - 1) / 6)]
        • Then - Actions
          • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of (Triggering player))]
            • Then - Actions
              • Set VariableSet Boolean_EnemyVote = False
              • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = False
              • Skip remaining actions
            • Else - Actions
          • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of (Picked player))]
                • Then - Actions
                  • Set VariableSet Player_Kicked[Integer_VoteTeam] = (Picked player)
                • Else - Actions
          • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 1
          • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • Set VariableSet Integer_VoteTeam = (1 - Integer_VoteTeam)
              • Set VariableSet Player_Kicked[Integer_VoteTeam] = Player_Kicked[(1 - Integer_VoteTeam)]
              • Set VariableSet Player_Kicker[Integer_VoteTeam] = Player_Kicker[(1 - Integer_VoteTeam)]
            • Else - Actions
          • Dialog - Clear Dialog_VoteKick[Integer_VoteTeam]
          • Dialog - Change the title of Dialog_VoteKick[Integer_VoteTeam] to (Vote to kick: + (Name of Player_Kicked[Integer_VoteTeam]))
          • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled Yes
          • Set VariableSet DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])] = (Last created dialog Button)
          • Dialog - Create a dialog button for Dialog_VoteKick[Integer_VoteTeam] labelled No
          • Countdown Timer - Start Timer_VoteKick[Integer_VoteTeam] as a One-shot timer that will expire in 15.00 seconds
          • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Not equal to Player_Kicked[Integer_VoteTeam]
                  • (Picked player) Not equal to Player_Kicker[Integer_VoteTeam]
                • Then - Actions
                  • Dialog - Show Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
                  • Countdown Timer - Show TimerWindow_VoteKick[Integer_VoteTeam] for (Picked player)
                • Else - Actions
        • Else - Actions
          • If (Boolean_EnemyVote Equal to True) then do (Set VariableSet Integer_VoteTeam = (1 - Integer_VoteTeam)) else do (Do nothing)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtons_VoteKick[(Player number of Player_Kicker[Integer_VoteTeam])]
            • Then - Actions
              • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = (Integer_VoteKickYes[Integer_VoteTeam] + 1)
            • Else - Actions
              • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = (Integer_VoteKickNo[Integer_VoteTeam] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_VoteKickYes[Integer_VoteTeam] Less than or equal to ((Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) / 2)
              • Or - Any (Conditions) are true
                • Conditions
                  • Integer_VoteKickNo[Integer_VoteTeam] Less than or equal to ((Number of players in PlayerGroup_TeamActive[Integer_VoteTeam]) / 2)
                  • Boolean_EnemyVote Equal to True
            • Then - Actions
            • Else - Actions
              • Trigger - Run Votekick Verdict <gen> (checking conditions)
Trigger - Votekick Verdict
  • Votekick Verdict
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean_EnemyVote Equal to True
        • Then - Actions
          • Countdown Timer - Pause Timer_VoteKick[(1 - Integer_VoteTeam)]
          • Countdown Timer - Hide TimerWindow_VoteKick[(1 - Integer_VoteTeam)]
          • Player Group - Pick every player in PlayerGroup_TeamActive[(1 - Integer_VoteTeam)] and do (Actions)
            • Loop - Actions
              • Dialog - Hide Dialog_VoteKick[(1 - Integer_VoteTeam)] for (Picked player)
        • Else - Actions
          • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
          • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
          • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
            • Loop - Actions
              • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Greater than Integer_VoteKickNo[Integer_VoteTeam]
        • Then - Actions
          • Game - Defeat Player_Kicked[Integer_VoteTeam] with the message: You have been kicke...
          • Game - Display to (All players) for 10.00 seconds the text: (|cffffff00Results of vote to kick + ((Name of Player_Kicked[Integer_VoteTeam]) + :|r))
          • Game - Display to (All players) for 10.00 seconds the text: ((|cff00ff00 + (String(Integer_VoteKickYes[Integer_VoteTeam]))) + ( |cffffff00Yes|r; |cffff0000 + ((String(Integer_VoteKickNo[Integer_VoteTeam])) + |cffffff00No|r)))
          • Game - Display to (All players) for 10.00 seconds the text: |cff00ff00Vote pass...
          • Player Group - Remove Player_Kicked[Integer_VoteTeam] from PlayerGroup_TeamActive[Integer_VoteTeam].
        • Else - Actions
          • Game - Display to (All players) for 10.00 seconds the text: (|cffffff00Results of vote to kick + ((Name of Player_Kicked[Integer_VoteTeam]) + :|r))
          • Game - Display to (All players) for 10.00 seconds the text: ((|cff00ff00 + (String(Integer_VoteKickYes[Integer_VoteTeam]))) + ( |cffffff00Yes|r; |cffff0000 + ((String(Integer_VoteKickNo[Integer_VoteTeam])) + |cffffff00No|r)))
          • Game - Display to (All players) for 10.00 seconds the text: |cffff0000Vote fail...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
      • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = False
      • Set VariableSet Boolean_EnemyVote = False
Trigger - Votekick Leaver (new)
  • Votekick Leaver
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
      • Player - Player 11 (Dark Green) leaves the game
      • Player - Player 12 (Brown) leaves the game
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = (((Player number of (Triggering player)) - 1) / 6)
      • Player Group - Remove (Triggering player) from PlayerGroup_TeamActive[Integer_VoteTeam].
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player_Kicker[Integer_VoteTeam] Not equal to (Triggering player)
          • Player_Kicked[Integer_VoteTeam] Not equal to (Triggering player)
        • Then - Actions
        • Else - Actions
          • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
          • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
          • Set VariableSet Boolean_VoteKickIsOn[Integer_VoteTeam] = False
          • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
          • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
          • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
            • Loop - Actions
              • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • Set VariableSet Boolean_EnemyVote = False
              • Set VariableSet Integer_VoteTeam = (1 - Integer_VoteTeam)
              • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
              • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
              • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
                • Loop - Actions
                  • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
            • Else - Actions
Trigger - Votekick Expired Team1
  • Votekick Expired Team1
    • Events
      • Time - Timer_VoteKick[0] expires
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = 0
      • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • Set VariableSet Integer_VoteTeam = (((Player number of Player_Kicker[0]) - 1) / 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Equal to 0
        • Then - Actions
          • Game - Display to (All players matching ((Matching player) Equal to Player_Kicker[Integer_VoteTeam]).) for 10.00 seconds the text: |cffff0000The votin...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • Game - Display to (All players) for 10.00 seconds the text: |cffff0000The vote ...
            • Else - Actions
              • Game - Display to PlayerGroup_TeamActive[Integer_VoteTeam] for 10.00 seconds the text: |cffff0000The vote ...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
Trigger - Votekick Expired Team2 (relatively the same as 'Votekick Expired Team1')
  • Votekick Expired Team2
    • Events
      • Time - Timer_VoteKick[1] expires
    • Conditions
    • Actions
      • Set VariableSet Integer_VoteTeam = 1
      • Countdown Timer - Pause Timer_VoteKick[Integer_VoteTeam]
      • Countdown Timer - Hide TimerWindow_VoteKick[Integer_VoteTeam]
      • Player Group - Pick every player in PlayerGroup_TeamActive[Integer_VoteTeam] and do (Actions)
        • Loop - Actions
          • Dialog - Hide Dialog_VoteKick[Integer_VoteTeam] for (Picked player)
      • Set VariableSet Integer_VoteTeam = (((Player number of Player_Kicker[1]) - 1) / 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_VoteKickYes[Integer_VoteTeam] Equal to 0
        • Then - Actions
          • Game - Display to (All players matching ((Matching player) Equal to Player_Kicker[Integer_VoteTeam]).) for 10.00 seconds the text: |cffff0000The vote ...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_EnemyVote Equal to True
            • Then - Actions
              • Game - Display to (All players) for 10.00 seconds the text: |cffff0000The vote ...
            • Else - Actions
              • Game - Display to PlayerGroup_TeamActive[Integer_VoteTeam] for 10.00 seconds the text: |cffff0000The vote ...
      • Set VariableSet Integer_VoteKickYes[Integer_VoteTeam] = 0
      • Set VariableSet Integer_VoteKickNo[Integer_VoteTeam] = 0
 

Attachments

  • kick33.w3m
    27.2 KB · Views: 11
Level 11
Joined
Jun 20, 2017
Messages
380
I'm curious what the issues were incase there is something I could have done better, but if it works it works!
I added this line so that I could kick my allies only, when the dialog buttons appeared!
  • ((Picked player) is an ally of Players_Kicker[Integer_VoteTeam].) Equal to True
You forgot to show the timer when the dialog buttons appear!
Also you forgot to add this line at the end of each expired vote!
  • Set VariableSet Booleans_VoteKickIsOn[Integer_VoteTeam] = False
And I think it's better to check the voting result every 1 second, until the 15 seconds are up!
 
Last edited:
Level 13
Joined
Jan 10, 2023
Messages
223
I intentionally did not show the timer when the first person is choosing who to kick because it seems unnecessary. They have 15 seconds whether they know it or not. You can show the window if you'd like.

You don't need to add that line because the list is only populated with teammates, enemies cannot be on the list so you can't pick an enemy.

The only time an 'enemy' is on the list is for the 'yes/no' vote. These buttons use the player number of the kicker for 'yes' and the player to be kicked's player/button number represents 'no'. If the enemy team is voting because the ally team only has 2 players and cannot vote, then the enemy team will vote 'yes' or 'no' and those buttons will be numbered by the kicker's number and the to be kicked player's number.

When player 1 starts a vote, the only options on the list will be players 2-5 and cancel, the cancel button will be at the bottom of the list, but it will be button number 1 because the kicker is Player 1 and the kicker will also never be an option on the list, so the button number is available to use for that.

You don't need to check if the vote is done ever because it checks every time a vote is cast.
If nobody casted a vote, the numbers did not change. You DO NOT need to check the vote tallies periodically, it helps nothing.
 
Last edited:
Status
Not open for further replies.
Top