• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

millzys Advanced Dialogs 2.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: -Kobas-
This system provides you with a advanced dialog system that allows you to set options. then proceed when done. this example shows a dialog for game modes


Features
-easy to undterstand and import to your map
-easy to customize to your liking

  • dialog set up
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Text_hero[1] = |c00FFFF00Hero selection:|r |c0000FF00All pick|r
      • Set Text_hero[2] = |c00FFFF00Hero selection:|r |c00FFA500All Random|r
      • Set Text_Gold[1] = |c00FF6600Starting Gold:|r |c00FFFF00500|r
      • Set Text_Gold[2] = |c00FF6600Starting Gold:|r |c00FFFF001000|r
      • Set Text_Gold[3] = |c00FF6600Starting Gold:|r |c00FFFF001500|r
      • Set Text_exp_rate[1] = |c00FFFF00Experience Rate:|r |c00912CEE100%|r
      • Set Text_exp_rate[2] = |c00FFFF00Experience Rate:|r |c006959CD90%|r
      • Set Text_exp_rate[3] = |c00FFFF00Experience Rate:|r |c00836FFF80%|r
      • Set Text_exp_rate[4] = |c00FFFF00Experience Rate:|r |c00551A8B110%|r
      • -------- --------
      • -------- setting modes to default --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set Dialog_mode_integer[(Integer A)] = 1
      • -------- --------
      • -------- Main Dialog --------
      • Dialog - Change the title of Dialog to Game Options
      • Dialog - Create a dialog button for Dialog labelled Text_hero[1]
      • Set Button_Main[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Text_Gold[1]
      • Set Button_Main[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Text_exp_rate[1]
      • Set Button_Main[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c0000FF00Done|r
      • Set Button_Main[4] = (Last created dialog Button)
      • Dialog - Show Dialog for Player 1 (Red)
      • -------- --------
      • -------- Sub button 1 = hero selection --------
      • Dialog - Change the title of Dialogs_selections[1] to Hero selection mode...
      • Dialog - Create a dialog button for Dialogs_selections[1] labelled |c0000FF00All pick|...
      • Set Button_Sub1[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[1] labelled |c00FFA500All Rando...
      • Set Button_Sub1[2] = (Last created dialog Button)
      • -------- --------
      • -------- Sub button 2 =Starting gold --------
      • Dialog - Change the title of Dialogs_selections[2] to Gold Selection
      • Dialog - Create a dialog button for Dialogs_selections[2] labelled |c00FFFF00500|r
      • Set Button_Sub2[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[2] labelled |c00FFFF001000|r
      • Set Button_Sub2[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[2] labelled |c00FFFF001500|r
      • Set Button_Sub2[3] = (Last created dialog Button)
      • -------- --------
      • -------- Sub button 3 = exp rates --------
      • Dialog - Change the title of Dialogs_selections[3] to Experiance Rates
      • Dialog - Create a dialog button for Dialogs_selections[3] labelled |c00912CEE100%|r
      • Set Button_Sub3[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[3] labelled |c006959CD90%|r
      • Set Button_Sub3[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[3] labelled |c00836FFF80%|r
      • Set Button_Sub3[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialogs_selections[3] labelled |c00551A8B110%|r
      • Set Button_Sub3[4] = (Last created dialog Button)
  • Dialog selections
    • Events
      • Dialog - A dialog button is clicked for Dialog
      • Dialog - A dialog button is clicked for Dialogs_selections[1]
      • Dialog - A dialog button is clicked for Dialogs_selections[2]
      • Dialog - A dialog button is clicked for Dialogs_selections[3]
    • Conditions
    • Actions
      • -------- if the done button is selected it will run the mode det up --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button_Main[4]
        • Then - Actions
          • Trigger - Run Mode set up <gen> (checking conditions)
        • Else - Actions
          • -------- if one of the buttons on the main dialog is selected it will open up the sections for that button --------
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Button_Main[(Integer A)]
                • Then - Actions
                  • Dialog - Show Dialogs_selections[(Integer A)] for Player 1 (Red)
                • Else - Actions
          • -------- if its 1 of the sub button --------
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Button_Sub1[(Integer A)]
                • Then - Actions
                  • Set Dialog_mode_integer[1] = (Integer A)
                  • Trigger - Run Dialog main update <gen> (ignoring conditions)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to Button_Sub2[(Integer A)]
                    • Then - Actions
                      • Set Dialog_mode_integer[2] = (Integer A)
                      • Trigger - Run Dialog main update <gen> (ignoring conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Clicked dialog button) Equal to Button_Sub3[(Integer A)]
                        • Then - Actions
                          • Set Dialog_mode_integer[3] = (Integer A)
                          • Trigger - Run Dialog main update <gen> (ignoring conditions)
                        • Else - Actions
  • Dialog main update
    • Events
    • Conditions
    • Actions
      • Dialog - Clear Dialog
      • Dialog - Change the title of Dialog to Game options
      • Dialog - Create a dialog button for Dialog labelled Text_hero[Dialog_mode_integer[1]]
      • Set Button_Main[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Text_Gold[Dialog_mode_integer[2]]
      • Set Button_Main[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Text_exp_rate[Dialog_mode_integer[3]]
      • Set Button_Main[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled |c0000FF00Done|r
      • Set Button_Main[4] = (Last created dialog Button)
      • Dialog - Show Dialog for Player 1 (Red)
  • Mode set up
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Game modes
      • Game - Display to (All players) the text: Text_hero[Dialog_mode_integer[1]]
      • Game - Display to (All players) the text: Text_Gold[Dialog_mode_integer[2]]
      • Game - Display to (All players) the text: Text_exp_rate[Dialog_mode_integer[3]]
      • -------- mode set ups for sub button 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dialog_mode_integer[1] Equal to 1
        • Then - Actions
          • -------- Set up allpick hero selection --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dialog_mode_integer[1] Equal to 2
            • Then - Actions
              • -------- Set up all Random hero selection --------
            • Else - Actions
      • -------- mode set ups for sub button 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dialog_mode_integer[2] Equal to 1
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Set (Picked player) Current gold to 500
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dialog_mode_integer[2] Equal to 2
            • Then - Actions
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • Player - Set (Picked player) Current gold to 1000
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dialog_mode_integer[2] Equal to 3
                • Then - Actions
                  • Player Group - Pick every player in (All players) and do (Actions)
                    • Loop - Actions
                      • Player - Set (Picked player) Current gold to 1500
                • Else - Actions
      • -------- mode set ups for sub button 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dialog_mode_integer[3] Equal to 1
        • Then - Actions
          • -------- Set up the exp rate for 100% --------
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Hero - Make (Picked player) Heroes gain 100.00% experience from future kills
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dialog_mode_integer[3] Equal to 2
            • Then - Actions
              • -------- Set up the exp rate for 90% --------
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • Hero - Make (Picked player) Heroes gain 90.00% experience from future kills
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dialog_mode_integer[3] Equal to 3
                • Then - Actions
                  • -------- Set up the exp rate for 80% --------
                  • Player Group - Pick every player in (All players) and do (Actions)
                    • Loop - Actions
                      • Hero - Make (Picked player) Heroes gain 80.00% experience from future kills
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Dialog_mode_integer[3] Equal to 4
                    • Then - Actions
                      • -------- Set up the exp rate for 110% --------
                      • Player Group - Pick every player in (All players) and do (Actions)
                        • Loop - Actions
                          • Hero - Make (Picked player) Heroes gain 110.00% experience from future kills
                    • Else - Actions

Changelog
1.0 - first upload
1.1- fixxed up the if then else to make it more sufficiant
1.1b - the update for the if then else some how stoped it from working now back to the original up load
2.0 - properly set if then else to make more sufficient as requested and input some of the template mode options

Credits
thanks to kobas for is tutorial and giving me the idea
thanks to maker for fixxing up a fault in the system

Keywords:
Dialog, Dialogs, options, Game Modes, Game Mode, Selection, Selections
Contents

Just another Warcraft III map (Map)

Reviews
KILLCIDE
This is more like a template and another example of the tutorial made by -Kobas-. Unless you actually turn this into a system where users can call functions and such instead of directly editing the trigger, I'm going to have to send this to substandard.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For too long time as NeedsFix. Rejected.

Maker, 15th Aug 2011, millzys Advanced Dialogs 1.1b

Dialog selection isn't efficient enough. You do checks even after the clicked button is found.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You're doing too much work when trying to detect the clicked dialog button and also for the dialog modes. Set the if/then/elses inside each other.

Optionally you could use hashtables and get the handle id of the clicked button to know which button was clicked. You could store the needed data using the button's id as parent key.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
i havent touched hashtables so id rather not

why put the if/then/else inside each other it does the same thing

It certainly does not. If the first button is clicked, you find that out in the first if-block. But then you uselessly re-evaluate all the remaining buttons to see if you clicked them. If you put each block in its preceding block's "Else - Actions" you can avoid such redundancy.
 
Top