RC Init

Events


Time - Elapsed game time is 0.00 seconds

Conditions

Actions


-------- --------------------------------------------------------------------- --------


-------- Maybe you need to set this trigger again. --------


-------- --------------------------------------------------------------------- --------


Set RC_Run = RC Start <gen>


-------- --------------------------------------------------------------------- --------


-------- Nothing to config here. --------


-------- Read the Readme --------


-------- --------------------------------------------------------------------- --------


Dialog - Change the title of RC_Dialog to Are you ready?


Dialog - Create a dialog button for RC_Dialog labelled Yes


Set RC_ButtonYes = (Last created dialog Button)


Dialog - Create a dialog button for RC_Dialog labelled No


Set RC_ButtonNo = (Last created dialog Button)


For each (Integer RC_Integer) from 1 to 12, do (Actions)



Loop - Actions




Set RC_Player = (Player(RC_Integer))




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(RC_Player controller) Equal to User






(RC_Player slot status) Equal to Is playing





Then - Actions






Trigger - Add to RC Leave <gen> the event (Player - RC_Player leaves the game)





Else - Actions
RC Start

Events

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RC_MaxDuration Greater than 0.00



Then - Actions




Countdown Timer - Start RC_Clock as a One-shot timer that will expire in RC_MaxDuration seconds



Else - Actions




Countdown Timer - Pause RC_Clock


Trigger - Turn on RC Leave <gen>


Set RC_Yes_Count = 0


Set RC_Total_Count = 0


Set RC_No_Count = 0


Set RC_MaxDuration = 0.00


For each (Integer RC_Integer) from 1 to 12, do (Actions)



Loop - Actions




-------- --------------------------------------------------------------------- --------




-------- See Click trigger to see what the Vote variable stands for --------




-------- --------------------------------------------------------------------- --------




Set RV_Vote[(Player number of RC_Player)] = 0




-------- --------------------------------------------------------------------- --------




Set RC_Player = (Player(RC_Integer))




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(RC_Player controller) Equal to User






(RC_Player slot status) Equal to Is playing





Then - Actions






Dialog - Show RC_Dialog for RC_Player






Set RC_Total_Count = (RC_Total_Count + 1)





Else - Actions
RC Click

Events


Dialog - A dialog button is clicked for RC_Dialog

Conditions

Actions


-------- --------------------------------------------------------------------- --------


-------- System-only relevant: --------


-------- vote = 0 -> not voted --------


-------- vote = 1 -> voted "yes" --------


-------- vote = 2 -> voted "no" --------


-------- --------------------------------------------------------------------- --------


Set RC_Player = (Triggering player)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Clicked dialog button) Equal to RC_ButtonYes



Then - Actions




Set RV_Vote[(Player number of RC_Player)] = 1




Set RC_Yes_Count = (RC_Yes_Count + 1)



Else - Actions




Set RV_Vote[(Player number of RC_Player)] = 2




Set RC_No_Count = (RC_No_Count + 1)


Set RC_Event = 1.00


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RC_Total_Count Equal to (RC_No_Count + RC_Yes_Count)



Then - Actions




Set RC_Event = 2.00




Countdown Timer - Pause RC_Clock




Trigger - Turn off RC Leave <gen>



Else - Actions


Set RC_Event = 0.00
RC Leave

Events

Conditions

Actions


Set RC_Player = (Triggering player)


-------- --------------------------------------------------------------------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RV_Vote[(Player number of RC_Player)] Equal to 0



Then - Actions




Set RC_Total_Count = (RC_Total_Count - 1)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






RC_Total_Count Equal to (RC_No_Count + RC_Yes_Count)





Then - Actions






Set RC_Event = 3.00






Set RC_Event = 0.00






Countdown Timer - Pause RC_Clock






Trigger - Turn off RC Leave <gen>





Else - Actions



Else - Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RV_Vote[(Player number of RC_Player)] Equal to 1



Then - Actions




Set RC_Yes_Count = (RC_Yes_Count - 1)



Else - Actions




Set RC_No_Count = (RC_No_Count - 1)
Rc End

Events


Time - RC_Clock expires

Conditions

Actions


For each (Integer RC_Integer) from 1 to 12, do (Actions)



Loop - Actions




Dialog - Hide RC_Dialog for (Player(RC_Integer))


Set RC_Event = 4.00


Set RC_Event = 0.00
Import:
1. File -> Preferences -> Automaticlay create unknown variables
2, Import the "Ready Check" folder into your map.
Usage:
1. You can set "RC_MaxDuration" if you want to have a time restriction.
Then, to start a new "ReadyCheck":
Trigger - Run RC_Run (ignoring conditions)
2. Events:
Game - RC_Event becomes Equal to 1.00
means a user has voted Yes/No
Game - RC_Event becomes Equal to 2.00
means all valid players have voted
Game - RC_Event becomes Equal to 3.00
means a pending player has left the game and there is no one to vote anymore
Game - RC_Event becomes Equal to 4.00
means the maximum duration expired
Inside the event triggers you can refer to following variables:
integer RC_No_Count ( how many users votes "No")
integer RC_Yes_Count ( how many users votes "Yes")
integer RC_Total_Count ( how many users are total involved in the vote)
- with above integers you easily could calculate something like "remaining votes".
- in case a player leaves it will be substracted correctly from yes/no/total votes automatically
integer RC_Vote[ ] array ( you can use this array to check a certain player's vote state )
- use the PlayerNumber of a player as array index
- value 0 -> not voted
- value 1 -> votes "yes"
- value 2 -> voted "no"
For example if: "RC_Vote[1] == 1" -> this means that Player 1 has voted "yes" already.
================
Credits to HammerFist132, from who's submission I have the idea.
The origin implementation: hiveworkshop.com/threads/ready-check-wow-like-by-hammerfist.235693/