When using the event "Dialog Item Is Used", my Dialog Item variable does not show up as a usable variable, why?
I have one trigger for setting up and showing a dialog with dialog buttons. When creating dialog buttons, i use Set Variable with Last created dialog item to set my empty Dialog item variables. I use "Create a dialog item (button)" for my dialog items.
Events usually do not refer to variables, because of the simple fact, that you can use one trigger for all of your dialog buttons. Just put in a switch or if/then/else in the actions. Takes up less triggers, and does exactly the same.
You can refference global variables from events (with custom script atleast). But it wouldn't make sence, since GUI events are added to triggers at map init, and at that point in time, your variable will have the value "No dialog item" - which is not what you want. Regardless of what the variable will be in the future, it is the value it has when the event is registered that counts.
I'm guessing this is why blizzard decided not to show them on the list - to avoid confusion.
The only way to do it in pure GUI is as suggested, use conditions. The only downside is that if you have 50 buttons, and one of them is pressed, 50 triggers will be run, and 49 of them will fail the conditions. Where with custom script, you can add the events after you create the button, and then only have 1 trigger run when you press the button.
For most cases, this is not an issue. It will probably be a tiny bit faster with just one trigger, but it will most likely be unnoticeable. Some people have been getting errors about too many triggers running at the same time when using the GUI way, but I think you will need to create a lot of dialog triggers before you run into that problem.
When using the event "Dialog Item Is Used", my Dialog Item variable does not show up as a usable variable, why?
I have one trigger for setting up and showing a dialog with dialog buttons. When creating dialog buttons, i use Set Variable with Last created dialog item to set my empty Dialog item variables. I use "Create a dialog item (button)" for my dialog items.
Make sure the variables you are using for your dialog items are global variables, not local.
It is a global variable, please see pictures below for further information.
http://imgur.com/I0kp3 http://imgur.com/9QlLQ http://imgur.com/nHz9l
Just use a condition insted Conditions: Used dialog item == ArchmageAscendus
Oh lol, should've thought of that. Isnt it strange that it doesnt work though? Thanks!
Well, it's kind of strange, but then, having N triggers for N buttons is actually overkill. That simplifies it a bit :)
Events usually do not refer to variables, because of the simple fact, that you can use one trigger for all of your dialog buttons. Just put in a switch or if/then/else in the actions. Takes up less triggers, and does exactly the same.
@sonnert: Go
Generally you can not reference variables in events.
You can refference global variables from events (with custom script atleast). But it wouldn't make sence, since GUI events are added to triggers at map init, and at that point in time, your variable will have the value "No dialog item" - which is not what you want. Regardless of what the variable will be in the future, it is the value it has when the event is registered that counts.
I'm guessing this is why blizzard decided not to show them on the list - to avoid confusion.
The only way to do it in pure GUI is as suggested, use conditions. The only downside is that if you have 50 buttons, and one of them is pressed, 50 triggers will be run, and 49 of them will fail the conditions. Where with custom script, you can add the events after you create the button, and then only have 1 trigger run when you press the button.
For most cases, this is not an issue. It will probably be a tiny bit faster with just one trigger, but it will most likely be unnoticeable. Some people have been getting errors about too many triggers running at the same time when using the GUI way, but I think you will need to create a lot of dialog triggers before you run into that problem.