HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog and dialog buttons problem

08-20-2004, 12:23 AM#1
Arkidas
OKay Im making a dialog with dialog buttons to select music, so when you type -music you get dialog with many dialog buttons labelled with the name of the music. But its a problem here, only COmradeship button appears, please help me and tell me why that happens. Here are all the codes:

Code:
Call on Musiclist
    Events
        Player - Player 2 (Blue) types a chat message containing -music as An exact match
    Conditions
    Actions
        Dialog - Show MusiclistDialog[1] for Player 2 (Blue)

Code:
Musiclist
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Dialog - Change the title of MusiclistDialog[1] to Select Music To Play
        Dialog - Create a dialog button for MusiclistDialog[1] labelled Comradeship
        Set Musiclistbuttons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[2] labelled Sad Mystery
        Set Musiclistbuttons[2] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[3] labelled Arthas Theme
        Set Musiclistbuttons[3] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[4] labelled Heroic Victory
        Set Musiclistbuttons[4] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[5] labelled WAR2 Music
        Set Musiclistbuttons[5] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[6] labelled Pursuit Theme
        Set Musiclistbuttons[6] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[7] labelled Illidan's Theme
        Set Musiclistbuttons[7] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[8] labelled Naga Theme
        Set Musiclistbuttons[8] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[9] labelled Dark Victory
        Set Musiclistbuttons[9] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[10] labelled Tension
        Set Musiclistbuttons[10] = (Last created dialog Button)
        Dialog - Create a dialog button for MusiclistDialog[1] labelled Cancel
        Set Musiclistbuttons[11] = (Last created dialog Button)

Code:
Select Music
    Events
        Dialog - A dialog button is clicked for MusiclistDialog[1]
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to Musiclistbuttons[1]
            Then - Actions
                Sound - Play Comradeship <gen>
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Clicked dialog button) Equal to Musiclistbuttons[2]
                    Then - Actions
                        Sound - Play SadMystery <gen>
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Clicked dialog button) Equal to Musiclistbuttons[3]
                            Then - Actions
                                Sound - Play ArthasTheme <gen>
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Clicked dialog button) Equal to Musiclistbuttons[4]
                                    Then - Actions
                                        Sound - Play HeroicVictory <gen>
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Clicked dialog button) Equal to Musiclistbuttons[5]
                                            Then - Actions
                                                Sound - Play War2IntroMusic <gen>
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Clicked dialog button) Equal to Musiclistbuttons[6]
                                                    Then - Actions
                                                        Sound - Play PursuitTheme <gen>
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Clicked dialog button) Equal to Musiclistbuttons[7]
                                                            Then - Actions
                                                                Sound - Play IllidansTheme <gen>
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        (Clicked dialog button) Equal to Musiclistbuttons[8]
                                                                    Then - Actions
                                                                        Sound - Play NagaTheme <gen>
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                (Clicked dialog button) Equal to Musiclistbuttons[9]
                                                                            Then - Actions
                                                                                Sound - Play DarkVictory <gen>
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        (Clicked dialog button) Equal to Musiclistbuttons[10]
                                                                                    Then - Actions
                                                                                        Sound - Play Tension <gen>
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                (Clicked dialog button) Equal to Musiclistbuttons[9]
                                                                                            Then - Actions
                                                                                                Sound - Play DarkVictory <gen>
                                                                                            Else - Actions
                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                    If - Conditions
                                                                                                        (Clicked dialog button) Equal to Musiclistbuttons[11]
                                                                                                    Then - Actions
                                                                                                        Sound - Stop music After fading
                                                                                                    Else - Actions
                                                                                                        Do nothing
08-20-2004, 11:22 AM#2
Arkidas
uh, bump sorry....
08-20-2004, 03:12 PM#3
LegolasArcher
You don't want you're dialog variable to be an array. Only the dialog button variable. Make all of the Set [variable] = [value] statements look like the following:

Quote:
Dialog - Create a dialog button for MusiclistDialog labelled Comradeship

Also, I'm not sure how many ifs are nested, but I believe there is a limit of 26 nested ifs, altthough I don't know if that still applies.

If I helped, please leave a rep.
08-20-2004, 04:50 PM#4
Arohk
dont combinate the IF/then/else actions
08-20-2004, 04:56 PM#5
Xestar
I'm not quite sure about this but... :



Musiclist
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Dialog - Change the title of MusiclistDialog[1] to Select Music To Play
Dialog - Create a dialog button for MusiclistDialog[1] labelled Comradeship
Set Musiclistbuttons[1] = (Last created dialog Button)
Dialog - Create a dialog button for MusiclistDialog[2] labelled Sad Mystery
Set Musiclistbuttons[2] = (Last created dialog Button)
Dialog - Create a dialog button for MusiclistDialog[3] labelled Arthas Theme
Set Musiclistbuttons[3] = (Last created dialog Button)
Dialog - Create a dialog button for MusiclistDialog[4] labelled Heroic Victory


I think the problem is :

The first dialog button is created for MusicListDialog[1]
The Second is created for MusicListDialog[2]

I think, that if you want the buttons to appear in the same DialogBox you need to create ALL the buttons for : MusicListDialog[1]

Like This:

Dialog - Change the title of MusiclistDialog[1] to Select Music To Play
Dialog - Create a dialog button for MusiclistDialog[1] labelled Comradeship
Set Musiclistbuttons[1] = (Last created dialog Button)
Dialog - Create a dialog button for MusiclistDialog[1] labelled Sad Mystery
Set Musiclistbuttons[2] = (Last created dialog Button)


I hope I explained it right ;)
I think this should work :8



btw : Nice Idea
08-20-2004, 05:03 PM#6
Arkidas
thanks legolas you will get a rep from me :) Btw no it works everythign now after I just changed the dialog to no array, though lol did I really do that? didnt I created all for array nr. 1? hehe ^^ I must have tought I was setting the veriables but it does work now since I have no array, I dont need any array though. But thanks, yes it is a nice idea