[Trigger] Setup Voting System Bug

Level 7
Joined
Sep 19, 2012
Messages
204
Hey Guys!

I am using a simple Voting System for some of my current Projects and i stumbled across a Problem.
When multiple players vote at the same time, some of them dont see all options or get kicked out of the dialog entirely. They cant Vote for every option and thus the Game doesnt start.

Is there a way to change my System that it works for multiple Players simultaneously without creating button and Dialog variables for every player?
  • Dialog creation
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Dialog - Clear Dialog1
      • Dialog - Change the title of Dialog1 to Research Speed
      • Dialog - Create a dialog button for Dialog1 labelled Slow (8-10 Players)
      • Set Dialog1_Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Normal (6 Players)
      • Set Dialog1_Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Fast (2-4 Players)
      • Set Dialog1_Button[3] = (Last created dialog Button)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog1 for (Player((Integer A)))
      • Dialog - Clear Dialog2
      • Dialog - Change the title of Dialog2 to Amount of Resources
      • Dialog - Create a dialog button for Dialog2 labelled Low
      • Set Dialog2_Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled Medium
      • Set Dialog2_Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled High
      • Set Dialog2_Button[3] = (Last created dialog Button)
      • Dialog - Clear Dialog3
      • Dialog - Change the title of Dialog3 to Terrain Type
      • Dialog - Create a dialog button for Dialog3 labelled Forest
      • Set Dialog3_Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled Desert
      • Set Dialog3_Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled Ice
      • Set Dialog3_Button[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog3 labelled Tropical (Coming So...
      • Set Dialog3_Button[4] = (Last created dialog Button)
      • Dialog - Clear Dialog4
      • Dialog - Change the title of Dialog4 to Ready?
      • Dialog - Create a dialog button for Dialog4 labelled Yes!
      • Set Dialog4_Button[1] = (Last created dialog Button)
      • Trigger - Turn off (This trigger)
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
  • Dialog 2
    • Events
    • Conditions
    • Actions
      • Dialog - Show Dialog2 for (Player(temp_integer))
      • Trigger - Turn off (This trigger)
  • Dialog 3
    • Events
    • Conditions
    • Actions
      • Dialog - Show Dialog3 for (Player(temp_integer))
      • Trigger - Turn off (This trigger)
  • Dialog 4
    • Events
    • Conditions
    • Actions
      • Dialog - Show Dialog4 for (Player(temp_integer))
      • Trigger - Turn off (This trigger)
  • Dialog Vote
    • Events
      • Dialog - A dialog button is clicked for Dialog1
      • Dialog - A dialog button is clicked for Dialog2
      • Dialog - A dialog button is clicked for Dialog3
      • Dialog - A dialog button is clicked for Dialog4
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog1_Button[1]
        • Then - Actions
          • Set ResearchSpeed_Vote[1] = (ResearchSpeed_Vote[1] + 1)
          • Set temp_integer = (Player number of (Triggering player))
          • Trigger - Run Dialog 2 <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Dialog1_Button[2]
            • Then - Actions
              • Set ResearchSpeed_Vote[2] = (ResearchSpeed_Vote[2] + 1)
              • Set temp_integer = (Player number of (Triggering player))
              • Trigger - Run Dialog 2 <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Dialog1_Button[3]
                • Then - Actions
                  • Set ResearchSpeed_Vote[3] = (ResearchSpeed_Vote[3] + 1)
                  • Set temp_integer = (Player number of (Triggering player))
                  • Trigger - Run Dialog 2 <gen> (checking conditions)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog2_Button[1]
        • Then - Actions
          • Set ResourceAmount_Vote[1] = (ResourceAmount_Vote[1] + 1)
          • Set temp_integer = (Player number of (Triggering player))
          • Trigger - Run Dialog 3 <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Dialog2_Button[2]
            • Then - Actions
              • Set ResourceAmount_Vote[2] = (ResourceAmount_Vote[2] + 1)
              • Set temp_integer = (Player number of (Triggering player))
              • Trigger - Run Dialog 3 <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Dialog2_Button[3]
                • Then - Actions
                  • Set ResourceAmount_Vote[3] = (ResourceAmount_Vote[3] + 1)
                  • Set temp_integer = (Player number of (Triggering player))
                  • Trigger - Run Dialog 3 <gen> (checking conditions)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog3_Button[1]
        • Then - Actions
          • Set Terrain_Vote[1] = (Terrain_Vote[1] + 1)
          • Set temp_integer = (Player number of (Triggering player))
          • Trigger - Run Dialog 4 <gen> (checking conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Dialog3_Button[2]
            • Then - Actions
              • Set Terrain_Vote[2] = (Terrain_Vote[2] + 1)
              • Set temp_integer = (Player number of (Triggering player))
              • Trigger - Run Dialog 4 <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Dialog3_Button[3]
                • Then - Actions
                  • Set Terrain_Vote[3] = (Terrain_Vote[3] + 1)
                  • Set temp_integer = (Player number of (Triggering player))
                  • Trigger - Run Dialog 4 <gen> (checking conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to Dialog3_Button[4]
                    • Then - Actions
                      • Set Terrain_Vote[4] = (Terrain_Vote[4] + 1)
                      • Set temp_integer = (Player number of (Triggering player))
                      • Trigger - Run Dialog 4 <gen> (checking conditions)
                    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog4_Button[1]
        • Then - Actions
          • Set Ready_Vote[1] = (Ready_Vote[1] + 1)
        • Else - Actions
  • Dialog Settings
    • Events
      • Dialog - A dialog button is clicked for Dialog4
    • Conditions
      • Ready_Vote[1] Equal to ((Number of players in (All players matching (((Matching player) slot status) Equal to Is playing))) - 2)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ResearchSpeed_Vote[1] Greater than ResearchSpeed_Vote[2]
              • ResearchSpeed_Vote[1] Greater than ResearchSpeed_Vote[3]
        • Then - Actions
          • Set Setup_ResearchSpeed = 1
          • Game - Display to (All players) the text: Slow Research Speed...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ResearchSpeed_Vote[2] Greater than ResearchSpeed_Vote[1]
                  • ResearchSpeed_Vote[2] Greater than ResearchSpeed_Vote[3]
            • Then - Actions
              • Set Setup_ResearchSpeed = 2
              • Game - Display to (All players) the text: Normal Research Spe...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • ResearchSpeed_Vote[3] Greater than ResearchSpeed_Vote[1]
                      • ResearchSpeed_Vote[3] Greater than ResearchSpeed_Vote[2]
                • Then - Actions
                  • Set Setup_ResearchSpeed = 3
                  • Game - Display to (All players) the text: Fast Research Speed...
                • Else - Actions
                  • Set Setup_ResearchSpeed = 2
                  • Game - Display to (All players) the text: Normal Research Spe...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ResourceAmount_Vote[1] Greater than ResourceAmount_Vote[2]
              • ResourceAmount_Vote[1] Greater than ResourceAmount_Vote[3]
        • Then - Actions
          • Set Setup_Res_Result = 1
          • Game - Display to (All players) the text: Low Resources Set!
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ResourceAmount_Vote[2] Greater than ResourceAmount_Vote[1]
                  • ResourceAmount_Vote[2] Greater than ResourceAmount_Vote[3]
            • Then - Actions
              • Set Setup_Res_Result = 2
              • Game - Display to (All players) the text: Medium Resources Se...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • ResourceAmount_Vote[3] Greater than ResourceAmount_Vote[1]
                      • ResourceAmount_Vote[3] Greater than ResourceAmount_Vote[2]
                • Then - Actions
                  • Set Setup_Res_Result = 3
                  • Game - Display to (All players) the text: High Resources Set!
                • Else - Actions
                  • Set Setup_Res_Result = 2
                  • Game - Display to (All players) the text: Medium Resources Se...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Terrain_Vote[1] Greater than Terrain_Vote[2]
              • Terrain_Vote[1] Greater than Terrain_Vote[3]
              • Terrain_Vote[1] Greater than Terrain_Vote[4]
        • Then - Actions
          • Set Setup_Biome_Result = 1
          • Game - Display to (All players) the text: Forest Biome Set!
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Terrain_Vote[2] Greater than Terrain_Vote[1]
                  • Terrain_Vote[2] Greater than Terrain_Vote[3]
                  • Terrain_Vote[2] Greater than Terrain_Vote[4]
            • Then - Actions
              • Set Setup_Biome_Result = 2
              • Game - Display to (All players) the text: Desert Biome Set!
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Terrain_Vote[3] Greater than Terrain_Vote[1]
                      • Terrain_Vote[3] Greater than Terrain_Vote[2]
                      • Terrain_Vote[3] Greater than Terrain_Vote[4]
                • Then - Actions
                  • Set Setup_Biome_Result = 3
                  • Game - Display to (All players) the text: Ice Biome Set!
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • Terrain_Vote[4] Greater than Terrain_Vote[1]
                          • Terrain_Vote[4] Greater than Terrain_Vote[2]
                          • Terrain_Vote[4] Greater than Terrain_Vote[3]
                    • Then - Actions
                      • Set Setup_Biome_Result = 1
                      • Game - Display to (All players) the text: Tropical Biome Set!...
                    • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Cinematic - Disable user control for (All players)
          • Camera - Pan camera for (Picked player) to (Target of Generation View <gen>) over 1.00 seconds
          • Camera - Set (Picked player)'s camera Height Offset to 1000.00 over 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Setup_Res_Result Equal to 1
        • Then - Actions
          • Trigger - Run Melee Initialization <gen> (checking conditions)
          • Trigger - Run Godly Effects <gen> (checking conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Setup_Biome_Result Equal to 1
            • Then - Actions
              • Trigger - Turn on Doodads Creation Forest <gen>
              • Trigger - Turn on Doodads Creation Uncommon Forest <gen>
              • Trigger - Turn on Elevation Forest <gen>
              • Trigger - Turn on Tree Creation low Forest <gen>
              • Trigger - Turn on Uncommon Terrain Forest <gen>
              • Trigger - Turn on Common Terrain Forest <gen>
              • Trigger - Turn on Resource Creation Low Forest <gen>
              • Trigger - Turn on Dense Resource Creation Low <gen>
              • Trigger - Turn on Item Creation low Forest <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Setup_Biome_Result Equal to 2
                • Then - Actions
                  • Trigger - Turn on Doodads Creation Desert <gen>
                  • Trigger - Turn on Doodads Creation Uncommon Desert <gen>
                  • Trigger - Turn on Elevation Desert <gen>
                  • Trigger - Turn on Tree Creation low Desert <gen>
                  • Trigger - Turn on Uncommon Terrain Desert <gen>
                  • Trigger - Turn on Common Terrain Desert <gen>
                  • Trigger - Turn on Resource Creation Low Desert <gen>
                  • Trigger - Turn on Dense Resource Creation Low <gen>
                  • Trigger - Turn on Item Creation low Desert <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Setup_Biome_Result Equal to 3
                    • Then - Actions
                      • Trigger - Run Base Terrain Ice <gen> (checking conditions)
                      • Trigger - Turn on Doodads Creation Ice <gen>
                      • Trigger - Turn on Doodads Creation Uncommon Ice <gen>
                      • Trigger - Turn on Elevation Ice <gen>
                      • Trigger - Turn on Tree Creation low Ice <gen>
                      • Trigger - Turn on Uncommon Terrain Ice <gen>
                      • Trigger - Turn on Common Terrain Ice <gen>
                      • Trigger - Turn on Resource Creation Low Ice <gen>
                      • Trigger - Turn on Dense Resource Creation Low <gen>
                      • Trigger - Turn on Item Creation low Ice <gen>
                    • Else - Actions
          • Trigger - Run Finisher <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Setup_Res_Result Equal to 2
        • Then - Actions
          • Trigger - Run Melee Initialization <gen> (checking conditions)
          • Trigger - Run Godly Effects <gen> (checking conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Setup_Biome_Result Equal to 1
            • Then - Actions
              • Trigger - Turn on Doodads Creation Forest <gen>
              • Trigger - Turn on Doodads Creation Uncommon Forest <gen>
              • Trigger - Turn on Elevation Forest <gen>
              • Trigger - Turn on Tree Creation Forest <gen>
              • Trigger - Turn on Uncommon Terrain Forest <gen>
              • Trigger - Turn on Common Terrain Forest <gen>
              • Trigger - Turn on Resource Creation Forest <gen>
              • Trigger - Turn on Dense Resource Creation <gen>
              • Trigger - Turn on Item Creation Forest <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Setup_Biome_Result Equal to 2
                • Then - Actions
                  • Trigger - Turn on Doodads Creation Desert <gen>
                  • Trigger - Turn on Doodads Creation Uncommon Desert <gen>
                  • Trigger - Turn on Elevation Desert <gen>
                  • Trigger - Turn on Tree Creation Desert <gen>
                  • Trigger - Turn on Uncommon Terrain Desert <gen>
                  • Trigger - Turn on Common Terrain Desert <gen>
                  • Trigger - Turn on Resource Creation Desert <gen>
                  • Trigger - Turn on Dense Resource Creation <gen>
                  • Trigger - Turn on Item Creation Desert <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Setup_Biome_Result Equal to 3
                    • Then - Actions
                      • Trigger - Run Base Terrain Ice <gen> (checking conditions)
                      • Trigger - Turn on Doodads Creation Ice <gen>
                      • Trigger - Turn on Doodads Creation Uncommon Ice <gen>
                      • Trigger - Turn on Elevation Ice <gen>
                      • Trigger - Turn on Tree Creation Ice <gen>
                      • Trigger - Turn on Uncommon Terrain Ice <gen>
                      • Trigger - Turn on Common Terrain Ice <gen>
                      • Trigger - Turn on Resource Creation Ice <gen>
                      • Trigger - Turn on Dense Resource Creation <gen>
                      • Trigger - Turn on Item Creation Ice <gen>
                    • Else - Actions
          • Trigger - Run Finisher <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Setup_Res_Result Equal to 3
        • Then - Actions
          • Trigger - Run Melee Initialization <gen> (checking conditions)
          • Trigger - Run Godly Effects <gen> (checking conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Setup_Biome_Result Equal to 1
            • Then - Actions
              • Trigger - Turn on Doodads Creation Forest <gen>
              • Trigger - Turn on Doodads Creation Uncommon Forest <gen>
              • Trigger - Turn on Elevation Forest <gen>
              • Trigger - Turn on Tree Creation high Forest <gen>
              • Trigger - Turn on Uncommon Terrain Forest <gen>
              • Trigger - Turn on Common Terrain Forest <gen>
              • Trigger - Turn on Resource Creation High Forest <gen>
              • Trigger - Turn on Dense Resource Creation High <gen>
              • Trigger - Turn on Item Creation high Forest <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Setup_Biome_Result Equal to 2
                • Then - Actions
                  • Trigger - Turn on Doodads Creation Desert <gen>
                  • Trigger - Turn on Doodads Creation Uncommon Desert <gen>
                  • Trigger - Turn on Elevation Desert <gen>
                  • Trigger - Turn on Tree Creation high Desert <gen>
                  • Trigger - Turn on Uncommon Terrain Desert <gen>
                  • Trigger - Turn on Common Terrain Desert <gen>
                  • Trigger - Turn on Resource Creation High Desert <gen>
                  • Trigger - Turn on Dense Resource Creation High <gen>
                  • Trigger - Turn on Item Creation high Desert <gen>
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Setup_Biome_Result Equal to 3
                    • Then - Actions
                      • Trigger - Run Base Terrain Ice <gen> (checking conditions)
                      • Trigger - Turn on Doodads Creation Ice <gen>
                      • Trigger - Turn on Doodads Creation Uncommon Ice <gen>
                      • Trigger - Turn on Elevation Ice <gen>
                      • Trigger - Turn on Tree Creation high Ice <gen>
                      • Trigger - Turn on Uncommon Terrain Ice <gen>
                      • Trigger - Turn on Common Terrain Ice <gen>
                      • Trigger - Turn on Resource Creation High Ice <gen>
                      • Trigger - Turn on Dense Resource Creation High <gen>
                      • Trigger - Turn on Item Creation high Ice <gen>
                    • Else - Actions
          • Trigger - Run Finisher <gen> (checking conditions)
        • Else - Actions
      • Trigger - Turn off (This trigger)
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )

Greetings
CodeBlack
 
Level 7
Joined
Sep 19, 2012
Messages
204
well your turnning off the trigger of the dialog when a player uses it meaning no other player can use it.
maybe this can be any use to you ? millzys Advanced Dialogs 2.0

Thanks :D

i removed the turn off and it seems to work. Need to test it with another player though.
If this was the only problem i feel a bit dumb right now xD

The System looks cool but its not what im looking for right now.

EDIT: Tested, worked...im stupid xD
 
Last edited:
Top