Returning array values, is there a function or alternative?
Post #1 Bolshevik09 May 13 2012, 5:59 pm
Post #3
Ahli
May 13 2012, 7:25 pm
|
Nothing yet! Almost done. Very powerful, very strong.
|
I'm using 1 trigger with a generic event.
Then I check all dialog items (which are buttons) with loops to find out which has been used. When I found it, I'm starting a custom action definition which takes the player and the button's ID in the array as a parameter. What really happens when the button is clicked, is controlled by that custom action definition. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post #4 Bolshevik09 May 13 2012, 8:18 pm
|
Can i see an example? ^
i tried setting the items current dialog item value to 1 - 30 and using these 2 conditions: 1<= (used dialog item current value) <=30 Dialog containing dialog item and that worked but when i clicked other dialog's items, my trigger came back "error cannot get value" even though the dialog containing was different. The condition "Dialog containing dialog item" doesnt seem to be able to tell my dialogs apart. If i can somehow save each dialog item as a string 1-30 and then use a "within bounds" condition to recall then that would be great. something like: 1<= (sting integer from string) <=30 ![]() ![]() ![]() ![]() ![]() ![]() |
Post #5
Ahli
May 13 2012, 8:26 pm
|
Nothing yet! Almost done. Very powerful, very strong.
|
![]() 1. Completely generic event 2. check which dialog is visible for the player (-> visible == dialog's buttons are clickable) 3. compare buttons with the used one 4. pass information somewhere else to do the magic because your trigger can become very long with many dialogs and it should only find out which button in which dialog was used. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post #6 Bolshevik09 May 14 2012, 12:03 am
|
What if i have multiple dialogs open which i do?
This seems too complex or i just don't understand it. I can do this if i can just figure out out to have the system take a # from a string with letters as well I can store 30 strings such as Shop01 Shop02 Shop03 etc and a "within bounds" condition to check it. So is there a way to return which array of the variable was used or to return numbers out of strings? What about a preset that allows all arrays in a variable to be true such as: used dialog item"SHOP"[any]? ![]() ![]() ![]() ![]() ![]() ![]() |
Post #7
Ahli
May 14 2012, 12:18 am
|
Nothing yet! Almost done. Very powerful, very strong.
|
You check all buttons and someday you find the right one and execute all necessary actions from there. Action definitions are just a more modular way of writing down the code that should be executed.
The approach that I use is to search till you find the used button by button comparison. AfaIk that's the way other mappers do it, too. 4. pass information somewhere else to do the magic because your trigger can become very long with many dialogs and it should only find out which button in which dialog was used. This seems too complex or i just don't understand it. I can do this if i can just figure out out to have the system take a # from a string with letters as well I can store 30 strings such as Shop01 Shop02 Shop03 etc and a "within bounds" condition to check it. So is there a way to return which array of the variable was used or to return numbers out of strings? What about a preset that allows all arrays in a variable to be true such as: used dialog item"SHOP"[any]? But I don't quite understand how you imagine it to work. I guess you want to analyze the string you get somehow to determine the window. Then you want to get the number you somehow store in the button to get the array's list? If you try to form the string and the number directly into a reference for an array, that won't work. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Post #8 Bolshevik09 May 14 2012, 2:48 am
|
Well the reason that i am getting error messages is because if i click on a dialog item that has never had a "Current value" set via triggers, then it returns errors..
So i have to leave it as following: Events -dialog item is used Conditions -Dialog of Dialog Item = SHOP Actions -Set local variable "DValue" = current value of Dialog item used -If Then Else bla bla bla I think blizzard might want to set the default value of Dialog Items = 0 so that they will atleast not return errors ![]() ![]() ![]() ![]() ![]() ![]() |
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)
+ guest(s)
[05:29 pm]
[05:25 pm]
[05:11 pm]
[05:10 pm]
[04:52 pm]
[05:14 am]
[04:42 am]






![[close]](/images/up.gif)