• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Voting List - Dialog Question

Status
Not open for further replies.
So I created a dialog box with an array of 6 buttons that I want to cycle through when clicked, so that the dialog box doesn't close it just updates the button name and this can be done for a period of 45 seconds:

Enable Heroes -> Disable Heroes

Normal Resources -> Medium Resources -> High Resources

All Tiers -> Tier 1 Only -> Tier 2 Only

No Research Done -> All Research Done

Map Bounds -> Boarderless Map

Done


Either when the 45 seconds is up or when the done button is clicked is when the results for each button are dealt with. So far all I've been able to do is set up the dialog box with the 6 buttons - however I can't figure out how to get them to replace each other and how to keep the whole box from disappearing when one button is clicked.
 
No, you would have variables with Array ticked, referring as:
  • For each (IntegerA) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set Dialog[Player number of Player(IntegerA)] = (Last created dialog)
The above could also be
  • For each (IntegerA) from 1 to 12, do (Actions)
    • Loop - Actions
      • Set Dialog[(IntegerA)] = (Last created dialog)
and when the button is clicked
  • Dialog - Hide Dialog[Player number of (Triggering player)]
 
I am confused, apologies.

I created the below trigger, it creates the first few buttons and does not yet deal with what happens when one is clicked, but my concern is that the dialog box is hidden and I wanted the buttons to cycle through after you clicked them.

I've seen this done before, specifically on Dawn of Chaos, but I don't know how they did it.
 

Attachments

  • (1)HeroDialog_Sample_AceHart.w3x
    11.4 KB · Views: 57
I modified it a bit to show you how to enhance it with new options, after the button is clicked:
  • ShowDialog
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- Setup for Dialog 1 --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_Vote[GetForLoopIndexA()]= DialogCreate( )
          • Dialog - Change the title of Vote[(Integer A)] to Voting Options
          • Dialog - Create a dialog button for Vote[(Integer A)] labelled Heroes Enabled
          • Set DialogButtonArray[(Integer A)] = (Last created dialog Button)
          • Dialog - Create a dialog button for Vote[(Integer A)] labelled Default Resources
          • Set DialogButtonArrayB[(Integer A)] = (Last created dialog Button)
          • Dialog - Create a dialog button for Vote[(Integer A)] labelled Done
          • Set DialogButtonArrayC[(Integer A)] = (Last created dialog Button)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
              • ((Player((Integer A))) controller) Equal to User
            • Then - Actions
              • Dialog - Show Vote[(Integer A)] for (Player((Integer A)))
            • Else - Actions
          • Trigger - Add to DoDialog <gen> the event (Dialog - A dialog button is clicked for Vote[(Integer A)])
  • DoDialog
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Clicked dialog button) Equal to Sure[(Player number of (Triggering player))]
              • (Clicked dialog button) Equal to NotSure[(Player number of (Triggering player))]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Sure[(Player number of (Triggering player))]
            • Then - Actions
              • Game - Display to (All players) the text: Sure option.
            • Else - Actions
              • Game - Display to (All players) the text: Not sure option.
          • Dialog - Hide (Clicked dialog) for (Triggering player)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to DialogButtonArray[(Player number of (Triggering player))]
            • Then - Actions
              • Game - Display to (All players) the text: Heroes Enabled opti...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to DialogButtonArrayB[(Player number of (Triggering player))]
                • Then - Actions
                  • Game - Display to (All players) the text: Default Resources O...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to DialogButtonArrayC[(Player number of (Triggering player))]
                    • Then - Actions
                      • Game - Display to (All players) the text: Done option.
                    • Else - Actions
          • Dialog - Clear Vote[(Player number of (Triggering player))]
          • Dialog - Change the title of Vote[(Player number of (Triggering player))] to New Dialog
          • Dialog - Create a dialog button for Vote[(Player number of (Triggering player))] labelled I am sure.
          • Set Sure[(Player number of (Triggering player))] = (Last created dialog Button)
          • Dialog - Create a dialog button for Vote[(Player number of (Triggering player))] labelled I am not sure.
          • Set NotSure[(Player number of (Triggering player))] = (Last created dialog Button)
          • Dialog - Show Vote[(Player number of (Triggering player))] for (Triggering player)
Test map: View attachment Dialog test.w3x
 
That makes sense, but how would I make it so when you choose one option and then click "sure" it brings you back to the original menu but with the option button for that option removed? That way I can use the same menu for all the different options and the only way to exit is to click done or wait the 45 seconds.


It might help you to see the current voting system I use.

This adds players to the integer and ignores computer players input:
  • TechLimitAddPlayers
    • Events
      • Map initialization
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
          • (Player 1 (Red) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
          • (Player 2 (Blue) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
          • (Player 4 (Purple) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
          • (Player 5 (Yellow) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
          • (Player 6 (Orange) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
          • (Player 7 (Green) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 10 (Light Blue) slot status) Equal to Is playing
          • (Player 10 (Light Blue) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
          • (Player 12 (Brown) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
          • (Player 12 (Brown) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
          • (Player 8 (Pink) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
          • (Player 9 (Gray) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) slot status) Equal to Is playing
          • (Player 11 (Dark Green) controller) Equal to User
        • Then - Actions
          • Set Tech1Check = (Tech1Check + 1)
          • Set Tech2Check = (Tech2Check + 1)
          • Set TechHeroCheck = (TechHeroCheck + 1)
          • Set MaxTechCheck = (MaxTechCheck + 1)
          • Set ResourceMCheck = (ResourceMCheck + 1)
          • Set ResourceHCheck = (ResourceHCheck + 1)
        • Else - Actions
Then the Level 1 Tech only restriction if voted for:
  • VoteLvl1
    • Events
      • Player - Player 1 (Red) types a chat message containing tech 1 only as An exact match
      • Player - Player 2 (Blue) types a chat message containing tech 1 only as An exact match
      • Player - Player 3 (Teal) types a chat message containing tech 1 only as An exact match
      • Player - Player 4 (Purple) types a chat message containing tech 1 only as An exact match
      • Player - Player 5 (Yellow) types a chat message containing tech 1 only as An exact match
      • Player - Player 6 (Orange) types a chat message containing tech 1 only as An exact match
      • Player - Player 7 (Green) types a chat message containing tech 1 only as An exact match
      • Player - Player 8 (Pink) types a chat message containing tech 1 only as An exact match
      • Player - Player 9 (Gray) types a chat message containing tech 1 only as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing tech 1 only as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing tech 1 only as An exact match
      • Player - Player 12 (Brown) types a chat message containing tech 1 only as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in TechGroup1) Equal to False
        • Then - Actions
          • Set Tech1Vote = (Tech1Vote + 1)
          • Player Group - Add (Triggering player) to TechGroup1
          • Trigger - Run VoteLvl1Enable <gen> (checking conditions)
        • Else - Actions
Then the check to enable the option:
  • VoteLvl1Enable
    • Events
    • Conditions
      • Tech1Check Equal to Tech1Vote
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Limit training of Stronghold to 0 for (Picked player)
          • Player - Limit training of Keep to 0 for (Picked player)
      • Game - Display to (All players) the text: |cff995500Racial tr...
      • Trigger - Turn off VoteLvl1 <gen>
      • Trigger - Turn off VoteLvl2 <gen>
      • Trigger - Turn off VoteLvl2Enable <gen>
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top