I just started working on aspects of my map that require dialogs (and buttons). I quickly realized that if I'm going to use the trigger Event: Dialog Item Used, that I'm going to need a -LOT- of IF statements and lengthly nested loops to determine which button (out of hundreds) was clicked. That got me thinking that I might be approaching my dialogs the wrong way. I have separate dialogs and dialog items for every player. Here's an example:
There are 10 players and they each have 5 buttons for skills. Those skills can be completely different based on the player, and the images and tooltips will change throughout the game. So I have an array of 10 dialogs (one per player), and two arrays of dialog items 10x5=50 items (5 skills per player); in total, 50 buttons and 50 images. This way I can make changes to one player's dialogs without affecting the others.
It occurs to me that maybe I only need 1 dialog with 5 buttons and 5 images? And I could simply do "Set dialog item image to [ ] for player [ ]" to ensure that each player sees a different image. So Button_Skill1 is visible to all players and each player sees a different image, and gets different results based on conditions involving the triggering player. 5 Buttons to manage and 5 Images to swap, rather than 50 of each.
Is my new thought the correct way to do this? Or is there a downside or functional limitation I've overlooked? Creating a copy of each dialog/item per player was how I followed a tutorial example, but now I don't understand the reason the tutorial author did it that way.
Dude, you already figured it out whats with the long post?
:)
It was a combination of tutorials using the former method of giving each player their own set of dialogs, and my lack of expertise in programming and data communications. Wasn't sure if there'd be unexpected consequences or limits to the functionality if many people are all trying to interact with the same button at the same time, or if in an abstract sense everybody gets their own copy of the button anyways. So I tried to be as descriptive as possible.
I just started working on aspects of my map that require dialogs (and buttons). I quickly realized that if I'm going to use the trigger Event: Dialog Item Used, that I'm going to need a -LOT- of IF statements and lengthly nested loops to determine which button (out of hundreds) was clicked. That got me thinking that I might be approaching my dialogs the wrong way. I have separate dialogs and dialog items for every player. Here's an example:
There are 10 players and they each have 5 buttons for skills. Those skills can be completely different based on the player, and the images and tooltips will change throughout the game. So I have an array of 10 dialogs (one per player), and two arrays of dialog items 10x5=50 items (5 skills per player); in total, 50 buttons and 50 images. This way I can make changes to one player's dialogs without affecting the others.
It occurs to me that maybe I only need 1 dialog with 5 buttons and 5 images? And I could simply do "Set dialog item image to [ ] for player [ ]" to ensure that each player sees a different image. So Button_Skill1 is visible to all players and each player sees a different image, and gets different results based on conditions involving the triggering player. 5 Buttons to manage and 5 Images to swap, rather than 50 of each.
Is my new thought the correct way to do this? Or is there a downside or functional limitation I've overlooked? Creating a copy of each dialog/item per player was how I followed a tutorial example, but now I don't understand the reason the tutorial author did it that way.
Yes, one dialog for everyone is the correct way to do this. You can change the image, size, offset and visibility on a per-player basis.
@CheezDip: Go
Dude, you already figured it out whats with the long post?
:)
It was a combination of tutorials using the former method of giving each player their own set of dialogs, and my lack of expertise in programming and data communications. Wasn't sure if there'd be unexpected consequences or limits to the functionality if many people are all trying to interact with the same button at the same time, or if in an abstract sense everybody gets their own copy of the button anyways. So I tried to be as descriptive as possible.
Thanks for the replies :)
If you have dialogs in arrays per player number then to get the button you just need to use Dialog[Triggering Player].Button[Array].