I am trying to setup tip dialogues that pop up after certain units are built for a group of players. I would would like for the text to play once for the triggering player and then turn off just for them. I understand how to accomplish this inefficiently; by repeating the same triggering to each player, but I think its time for me to step up to the plate and do this the right way with an array.
This is my current thinking process, I first need to setup an integer [?] array and set the size to the number of players I want running the tips. Next, I believe I need to define the 'slots', like 'slot' one = player 1. Then, somehow link this to the dialogue triggers I've created. Can someone explain to me how I would go about accomplishing this?
You must remember to make arrays 1 size larger than number of players because they start as 0.
Create a global variable, for you purpose you can set it's type to byte, and make it an array of size number of players+1.
In the trigger you make, in conditions add comparison if Variable[Triggering player] == 0, (replace triggering player with anything that will fit your events and return that players number). That way it'll check the value you need. And at the beggining/end of the trigger set variable[triggering player]==1, so next time the checks will fail and trigger won't start for that player.
You must remember to make arrays 1 size larger than number of players because they start as 0.
No need for this. Blizz has done it in the GUI. If you declare an array with Size 5 in GUI, in Script it will have Size 6...
Thats why you wont have problems with indexes starting at 1.
Hey guys,
I am trying to setup tip dialogues that pop up after certain units are built for a group of players. I would would like for the text to play once for the triggering player and then turn off just for them. I understand how to accomplish this inefficiently; by repeating the same triggering to each player, but I think its time for me to step up to the plate and do this the right way with an array.
This is my current thinking process, I first need to setup an integer [?] array and set the size to the number of players I want running the tips. Next, I believe I need to define the 'slots', like 'slot' one = player 1. Then, somehow link this to the dialogue triggers I've created. Can someone explain to me how I would go about accomplishing this?
Thanks for any help.
You must remember to make arrays 1 size larger than number of players because they start as 0.
Create a global variable, for you purpose you can set it's type to byte, and make it an array of size number of players+1.
In the trigger you make, in conditions add comparison if Variable[Triggering player] == 0, (replace triggering player with anything that will fit your events and return that players number). That way it'll check the value you need. And at the beggining/end of the trigger set variable[triggering player]==1, so next time the checks will fail and trigger won't start for that player.
No need for this. Blizz has done it in the GUI. If you declare an array with Size 5 in GUI, in Script it will have Size 6...
Thats why you wont have problems with indexes starting at 1.
Cheers Then
Hey guys,
Thanks for your help. A thousand cool points to you both.