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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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