WC3 World Editor - Race Chooser "Next Page" button

Status
Not open for further replies.
Level 4
Joined
Dec 11, 2019
Messages
55
Hey everyone, i have been working on a simple map trigger, which includes a selection screen in the middle and buttons to press to pick their factions/races. My problem here is, i planned to add about 14(15 with random) factions but it cuts off at 11 factions, i am not far advanced with making a Next page and return to that page
selection button, could someone provide a simple way? heres what i got so far. I Appricate any help.

--
11.PNG
 
Level 4
Joined
Dec 11, 2019
Messages
55
Hello Bolty. This should work:

Create another dialog. Move some buttons to the new dialog. Create 1 new dialog button for each dialog that will be used to change which dialog is shown. When those new dialog buttons are pressed hide current dialog and show the other dialog for that player.
Alright, from what i can understand, i would create a whole new dialog, without any events. Move some of the buttons not shown and maybe 2 extra for the next and return button, i could provide the map since i test it on a random map i picked out.
 
Level 24
Joined
Feb 27, 2019
Messages
833
Alright, from what i can understand, i would create a whole new dialog, without any events. Move some of the buttons not shown and maybe 2 extra for the next and return button, i could provide the map since i test it on a random map i picked out.
Yes, create a new dialog variable (it appears in my test that dialog arrays dont work?? strange af). The new dialog and its buttons can be created and assigned in the same trigger. What I mean with 2 extra buttons is 1 button for each dialog. So as you say it, the one for the first dialog can be called Next page and the one for the second dialog can be called Return. These two buttons will function differently than the rest. If the Next page is pressed then hide the first dialog and show the second. If dialog button Return is pressed then hide the second dialog and show the first.

  • Create dialogs
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of Dialog1 to Choose a Race [1/2]
      • Dialog - Change the title of Dialog2 to Choose a Race [2/2]
      • Dialog - Create a dialog button for Dialog1 labelled Random
      • Set VariableSet DialogButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Dark Elf
      • Set VariableSet DialogButton[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Next page
      • Set VariableSet DialogButton[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled Empire Knights
      • Set VariableSet DialogButton[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled Orc
      • Set VariableSet DialogButton[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled Return
      • Set VariableSet DialogButton[6] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog1 for (Picked player)
      • Game - Display to (All players) the text: Everyone has 15 sec...
  • Dialog button pressed
    • Events
      • Dialog - A dialog button is clicked for Dialog1
      • Dialog - A dialog button is clicked for Dialog2
    • Conditions
    • Actions
      • Set VariableSet PlayerNumber = (Player number of (Triggering player))
      • -------- Random --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[1]
        • Then - Actions
          • -------- Do actions --------
          • Custom script: return
        • Else - Actions
      • -------- Dark Elf --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[2]
        • Then - Actions
          • -------- Do actions --------
          • Custom script: return
        • Else - Actions
      • -------- Empire Knights --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[4]
        • Then - Actions
          • -------- Do actions --------
          • Custom script: return
        • Else - Actions
      • -------- Orc --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[5]
        • Then - Actions
          • -------- Do actions --------
          • Custom script: return
        • Else - Actions
      • -------- Next page button --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[3]
        • Then - Actions
          • Dialog - Change the title of Dialog2 to Choose a Race [2/2]
          • Dialog - Hide Dialog1 for (Player(PlayerNumber))
          • Dialog - Show Dialog2 for (Player(PlayerNumber))
          • Custom script: return
        • Else - Actions
      • -------- Return button --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DialogButton[6]
        • Then - Actions
          • Dialog - Change the title of Dialog1 to Choose a Race [1/2]
          • Dialog - Hide Dialog2 for (Player(PlayerNumber))
          • Dialog - Show Dialog1 for (Player(PlayerNumber))
        • Else - Actions
For some reason I needed to change the title after swapping dialogs shown, if the title bugs out in multiplayer change both titles instead.

The custom script return means that the trigger skips the remaining actions but is not required.

To post your triggers easily you can right click the trigger name inside Trigger functions and select copy as text then paste it in the post and write [.trigger]pasted text here[./trigger] without the .'s.

Afterthoughts: Since the first button in each dialog is highlighted per heaps use that button as Next page and Return. In my example button 3 is Next page and Return is button 6. They could be button 1 and 2 or the second last and last buttons instead so it becomes more ordered. Unless a similar order as the example makes more sense to you. Using button 1 and 2 would make adding more races SLIGHTLY easier in the future.
 
Level 4
Joined
Dec 11, 2019
Messages
55
Alright i will give it a try, heres the test map and trigger correctly given out this time, thanks again. i will see what i can do.

  • Name Buttons
    • Events
      • Time - Elapsed game time is 0.02 seconds
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units in (Playable map area))
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Dialog - Clear RaceChoose
      • Dialog - Change the title of RaceChoose to Choose a Race
      • Dialog - Create a dialog button for RaceChoose labelled Random
      • Set VariableSet Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Dark Elf
      • Set VariableSet Button[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Empire Knights
      • Set VariableSet Button[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Orc
      • Set VariableSet Button[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Undead
      • Set VariableSet Button[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Naga
      • Set VariableSet Button[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Srehtii
      • Set VariableSet Button[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Minotaur
      • Set VariableSet Button[8] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Barbarian
      • Set VariableSet Button[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled High Elf
      • Set VariableSet Button[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Unhold - Wood Elf
      • Set VariableSet Button[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Demon
      • Set VariableSet Button[12] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Satyr
      • Set VariableSet Button[13] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Dwarf
      • Set VariableSet Button[14] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChoose labelled Dark Dwarf
      • Set VariableSet Button[15] = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show RaceChoose for (Picked player)
      • Game - Display to (All players) for 15.00 seconds the text: Everyone has 15 sec...
 

Attachments

  • Trigger Test.w3x
    251.3 KB · Views: 17
Level 4
Joined
Dec 11, 2019
Messages
55
I updated it with your version and it works now! the only thing is, does random still use all 14 faction buttons? heres the updated map version incase you wanted to look into.
 

Attachments

  • Trigger Test.w3x
    252.8 KB · Views: 26
Level 24
Joined
Feb 27, 2019
Messages
833
In the test map the random button triggers a trigger that uses any of 15 numbers but only 4 races are present in the test map. If all 14 races are added it should be random number between 1-14. If you want to keep the same number as the buttons then you can do from 2-15 as long as those are the same numbers in the conditions.
 
Status
Not open for further replies.
Top