Choose Hero Dialog doesn't work!

garion992

TH.net Regular
Reaction score
17
Hello everyone,

I have a big problem! I wanted to make a map like Herocraft but exept of using a Tavern for selecting heroes i want to use a Dialog for selecting heroes. It doesn't makes any heroes and the buttons to next page don't work too. Im not very good with dialogs and variables, soo please can someone help me

Note: i have made variables
-DialogButtons dialog button Array 30
-Heroes unit-type Array 30
-HeroDialog1 t/m 6

I have made those triggers:
Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        -------- Hero List --------
        Set Heroes[1] = Paladin
        Set Heroes[2] = Archmage
        Set Heroes[3] = Mountainking
        Set Heroes[4] = Bloodmage
        Set Heroes[5] = No unit-type
        Set Heroes[6] = Blademaster
        Set Heroes[7] = Blademaster
        Set Heroes[8] = Blademaster
        Set Heroes[9] = Blademaster
        Set Heroes[10] = No unit-type
        Set Heroes[11] = Blademaster
        Set Heroes[12] = Blademaster
        Set Heroes[13] = Blademaster
        Set Heroes[14] = Blademaster
        Set Heroes[15] = No unit-type
        Set Heroes[16] = Blademaster
        Set Heroes[17] = Blademaster
        Set Heroes[18] = Blademaster
        Set Heroes[19] = Blademaster
        Set Heroes[20] = No unit-type
        Set Heroes[21] = Blademaster
        Set Heroes[22] = Blademaster
        Set Heroes[23] = Blademaster
        Set Heroes[24] = Blademaster
        Set Heroes[25] = No unit-type
        Set Heroes[26] = Blademaster
        Set Heroes[27] = Blademaster
        Set Heroes[28] = Blademaster
        Set Heroes[29] = Blademaster
        Set Heroes[30] = No unit-type
Code:
ShowSelectHeroDialog
    Events
        Time - Elapsed game time is 11.00 seconds
    Conditions
    Actions
        -------- Setup for Dialog 1 --------
        Dialog - Clear HeroDialog1
        Dialog - Change the title of HeroDialog1 to Choose a Human Hero
        Dialog - Create a dialog button for HeroDialog1 labelled Paladin
        Set DialogButtons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog1 labelled Archmage
        Set DialogButtons[2] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog1 labelled Mountain King
        Set DialogButtons[3] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog1 labelled Blood Mage
        Set DialogButtons[4] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog1 labelled Go to page 2 >>>
        Set DialogButtons[5] = (Last created dialog Button)
        -------- Setup for Dialog 2 --------
        Dialog - Clear HeroDialog2
        Dialog - Change the title of HeroDialog2 to Choose a Orc Hero
        Dialog - Create a dialog button for HeroDialog2 labelled Lich
        Set DialogButtons[6] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog2 labelled Demon Hunter
        Set DialogButtons[7] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog2 labelled Warden
        Set DialogButtons[8] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog2 labelled Fire Lord
        Set DialogButtons[9] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog2 labelled Go to page 3 >>>
        Set DialogButtons[10] = (Last created dialog Button)
        -------- Setup for Dialog 3 --------
        Dialog - Clear HeroDialog3
        Dialog - Change the title of HeroDialog3 to Choose a Night Elf ...
        Dialog - Create a dialog button for HeroDialog3 labelled Lich
        Set DialogButtons[11] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog3 labelled Lich
        Set DialogButtons[12] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog3 labelled Lich
        Set DialogButtons[13] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog3 labelled Lich
        Set DialogButtons[14] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog2 labelled Go to page 4 >>>
        Set DialogButtons[15] = (Last created dialog Button)
        -------- Setup for Dialog 4 --------
        Dialog - Clear HeroDialog4
        Dialog - Change the title of HeroDialog4 to Choose a Undead Her...
        Dialog - Create a dialog button for HeroDialog4 labelled Lich
        Set DialogButtons[16] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog4 labelled Lich
        Set DialogButtons[17] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog4 labelled Lich
        Set DialogButtons[18] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog4 labelled Lich
        Set DialogButtons[19] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog4 labelled Go to page 5 >>>
        Set DialogButtons[20] = (Last created dialog Button)
        -------- Setup for Dialog 5 --------
        Dialog - Clear HeroDialog5
        Dialog - Change the title of HeroDialog5 to Choose a Neutral He...
        Dialog - Create a dialog button for HeroDialog5 labelled Lich
        Set DialogButtons[21] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog5 labelled Lich
        Set DialogButtons[22] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog5 labelled Lich
        Set DialogButtons[23] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog5 labelled Lich
        Set DialogButtons[24] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog5 labelled Lich
        Set DialogButtons[25] = (Last created dialog Button)
        -------- Setup for Dialog 6 --------
        Dialog - Clear HeroDialog6
        Dialog - Change the title of HeroDialog6 to Choose a Neutral He...
        Dialog - Create a dialog button for HeroDialog6 labelled Lich
        Set DialogButtons[26] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog6 labelled Lich
        Set DialogButtons[27] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog6 labelled Lich
        Set DialogButtons[28] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog6 labelled Lich
        Set DialogButtons[29] = (Last created dialog Button)
        Dialog - Create a dialog button for HeroDialog6 labelled Lich
        Set DialogButtons[30] = (Last created dialog Button)
        -------- Showing the dialog to all players --------
        Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
            Loop - Actions
                Dialog - Show HeroDialog1 for (Picked player)
Code:
DoSelectHero
    Events
        Dialog - A dialog button is clicked for HeroDialog1
        Dialog - A dialog button is clicked for HeroDialog2
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[5]
            Then - Actions
                Dialog - Show HeroDialog2 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[10]
            Then - Actions
                Dialog - Show HeroDialog3 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[15]
            Then - Actions
                Dialog - Show HeroDialog4 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[20]
            Then - Actions
                Dialog - Show HeroDialog5 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[25]
            Then - Actions
                Dialog - Show HeroDialog6 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[30]
            Then - Actions
                Dialog - Show HeroDialog1 for (Triggering player)
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[10]
                    Then - Actions
                        Dialog - Show HeroDialog1 for (Triggering player)
                        Skip remaining actions
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[(Integer A)]
            Then - Actions
                Unit - Create 1 Heroes[(Integer A)] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                Selection - Select (Last created unit) for (Triggering player)
                Game - Display to (Player group((Triggering player))) the text: ((Name of (Triggering unit)) +  is under your command!)
            Else - Actions
 
K

Kerberos

Guest
> -HeroDialog1 t/m 6

What do you mean by that? What kind of variable is it?
 

Potatisbil

New Member
Reaction score
6
Can't actually see anything wrong with yer trigger :S although i have not experimented with dialogs too much...

//potatisbil
 

garion992

TH.net Regular
Reaction score
17
HeroDialog1 t/m 6

Answer

HeroDialog1 - Dialog New - Dialog (Default)
HeroDialog2 - Dialog New - Dialog (Default)
HeroDialog3 - Dialog New - Dialog (Default)
HeroDialog4 - Dialog New - Dialog (Default)
HeroDialog5 - Dialog New - Dialog (Default)
HeroDialog6 - Dialog New - Dialog (Default)
 
S

Sunny_D

Guest
in the last trigger.... i see you used "integer A" but you dont have a for-loop in there ;)

and for sure you cant use "triggering unit" as the event isnt related to units. you can only do "triggering player" or "last created unit" in your case.
 
S

Sunny_D

Guest
i think, that should do it: ;)

Code:
DoDialog
    Events
        Dialog - A dialog button is clicked for HeroDialog1
        Dialog - A dialog button is clicked for HeroDialog2
        Dialog - A dialog button is clicked for HeroDialog3
        Dialog - A dialog button is clicked for HeroDialog4
        Dialog - A dialog button is clicked for HeroDialog5
        Dialog - A dialog button is clicked for HeroDialog6
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[5]
            Then - Actions
[COLOR="Red"]                ------ Im not 100% sure if you would need the hide dialog function here -----[/COLOR]
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog2 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 DialogButtons[10]
            Then - Actions
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog3 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 DialogButtons[15]
            Then - Actions
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog4 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 DialogButtons[20]
            Then - Actions
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog5 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 DialogButtons[25]
            Then - Actions
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog6 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 DialogButtons[30]
            Then - Actions
                Dialog - Hide (Clicked dialog) for (Triggering player)
                Dialog - Show HeroDialog1 for (Triggering player)
            Else - Actions

[B]For each (Integer A) from 1 to 30[/B]
    [B]Loop - Actions[/B]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
[B]                (Clicked dialog button) Equal to DialogButtons[(Integer A)]
                (Clicked dialog button) Not Equal to DialogButtons[5]
                (Clicked dialog button) Not Equal to DialogButtons[10]
                (Clicked dialog button) Not Equal to DialogButtons[15]
                (Clicked dialog button) Not Equal to DialogButtons[20]
                (Clicked dialog button) Not Equal to DialogButtons[25]
                (Clicked dialog button) Not Equal to DialogButtons[30][/B]
            Then - Actions
                Unit - Create 1 Heroes[(Integer A)] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                Selection - Select (Last created unit) for (Triggering player)
                Game - Display to (Player group((Triggering player))) the text: ((Proper name of [B](Last created unit)[/B]) +  is under your command!)
            Else - Actions
 

garion992

TH.net Regular
Reaction score
17
Thx!!!

I have not used the visibility and it almost works Perfect!!! (when you come in dialog 6 and then go to dialog 1 the names of dialog are gone :( ) But thats not very important :)
Thank you for the great help!
 

garion992

TH.net Regular
Reaction score
17
Final Script

Here is the script i used that now works thx to you :)

Code:
DoDialog
    Events
        Dialog - A dialog button is clicked for HeroDialog1
        Dialog - A dialog button is clicked for HeroDialog2
        Dialog - A dialog button is clicked for HeroDialog3
        Dialog - A dialog button is clicked for HeroDialog4
        Dialog - A dialog button is clicked for HeroDialog5
        Dialog - A dialog button is clicked for HeroDialog6
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[5]
            Then - Actions
                Dialog - Show HeroDialog2 for (Triggering player)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[10]
            Then - Actions
                Dialog - Show HeroDialog3 for (Triggering player)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[15]
            Then - Actions
                Dialog - Show HeroDialog4 for (Triggering player)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[20]
            Then - Actions
                Dialog - Show HeroDialog5 for (Triggering player)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[25]
            Then - Actions
                Dialog - Show HeroDialog6 for (Triggering player)
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtons[30]
            Then - Actions
                Dialog - Show HeroDialog1 for (Triggering player)
                Skip remaining actions
            Else - Actions
        For each (Integer A) from 1 to 30, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to DialogButtons[(Integer A)]
                    Then - Actions
                        Unit - Create 1 Heroes[(Integer A)] for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                        Selection - Select (Last created unit) for (Triggering player)
                        Game - Display to (Player group((Triggering player))) the text: ((Name of (Last created unit)) +  is under your command!)
                    Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top