HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dialog Help

09-06-2004, 01:57 PM#1
AFB-DieHard
I've made a trigger to show a dialog. Here is the trigger to show the dialog:

Code:
    Dialog - Change the title of bombtimeset to Bombtimer
    Dialog - Create a dialog button for bombtimeset labelled |cffffcc001. |r|cffffffff45|r with hotkey: 49
    Set bt[0] = (Last created dialog Button)
    Dialog - Create a dialog button for bombtimeset labelled |cffffcc002.|r|cffffffff35|r with hotkey: 50
    Set bt[1] = (Last created dialog Button)
    Dialog - Create a dialog button for bombtimeset labelled |cffffcc003. |r|cffffffff25|r with hotkey: 51
    Set bt[2] = (Last created dialog Button)
    Dialog - Create a dialog button for bombtimeset labelled |cffffcc004. |r|cffffffff20|r with hotkey: 52
    Set bt[3] = (Last created dialog Button)
    Dialog - Create a dialog button for bombtimeset labelled |cffffcc005. |r|cffffffff15|r with hotkey: 53
    Set bt[4] = (Last created dialog Button)
    Dialog - Show bombtimeset for firstplayer

The dialog is shown. Here is the trigger to detect which dialog is clicked:

Code:
set BT diag difficulty
    Events
        Dialog - A dialog button is clicked for bombtimeset
    Conditions
    Actions
        If ((Clicked dialog button) Equal to bt[0]) then do (Set bombtime = 45) else do (Do nothing)
        If ((Clicked dialog button) Equal to bt[1]) then do (Set bombtime = 35) else do (Do nothing)
        If ((Clicked dialog button) Equal to bt[2]) then do (Set bombtime = 25) else do (Do nothing)
        If ((Clicked dialog button) Equal to bt[3]) then do (Set bombtime = 20) else do (Do nothing)
        If ((Clicked dialog button) Equal to bt[4]) then do (Set bombtime = 15) else do (Do nothing)

The trigger fires, but the If-Conditions are not true!
09-07-2004, 12:59 PM#2
Guest
???

I think I didn't understood your problem. The triggers looks ok to me.
09-07-2004, 04:31 PM#3
AFB-DieHard
Yeah, that's my problem. I don't know where the problem is.

The trigger fires but
If ((Clicked dialog button) Equal to bt[0])
is false...
09-07-2004, 11:33 PM#4
-={tWiStÄr}=-
i guess you should have it display (if true text- true else text- false) if it is false or not, or have you done that? Oh, also when you set the dialog if your using event-map initialization, it wont work. use time elapsed = .01 seconds
09-08-2004, 06:24 AM#5
AFB-DieHard
I have set it to 5 seconds. And I have done a trigger:

If ((Clicked dialog button) Equal to bt[0]) then do ShowMessage("bla") else do ShowMessage("bla2")

It showed bla2.
09-08-2004, 08:58 AM#6
Guest
I think I know whats your problem. When you make an array variable (lets say you made "bt[6]" as a dialog button variable), you should use ONLY values from [1] to [6], and not [0]. The value [0] is automatically created for every array, but it doesn't work as a valid value for it. So, try using "bt[1]" as first button and so on.

Salutions®
09-08-2004, 09:57 AM#7
AFB-DieHard
Thank you but i 1.) It works for no button and 2.) It didn't work when i used no array but a normal variable.
09-08-2004, 12:57 PM#8
-={tWiStÄr}=-
well, possibly its picking up a different button than the one you clicked for some reason.
09-08-2004, 05:50 PM#9
Guest
Mmmmm, I ran out of ideas for this, sorry. Just make sure the problem is not in another place and/or rewrite the triggers for dialog and buttons.

Salutions®