For my map, I'm trying to set up a better dialog to show game information. On the "advanced" dialog, i want to show the "bonus" value which is the same for all players, as well as each players current mineral count.
Bonus: 10
Player 1 Minerals: 1000
Player 2 Minerals: 948
Player 3 Minerals: 1100
...
On the "simple" dialog, I want to show the "bonus" number and JUST the specific player's mineral count.
Bonus: 10
Your Minerals: 1000
...
Since the "advanced" dialog is the same for all players, it can just be 1 that's shown to all players. And then the "simple" dialog would be an array of dialogs - one for each player (because each one shows specific player information to just that player). Does that sound like the best way to set that up?
You only need one dialog for the simple one. You would just need to change the dialog item's text value for a specific player.
If you wanted to get fancy you could do it all in one dialog window and have a button to switch between simple and advanced views, which would (presumably) increase the size of the dialog and show more dialog items for the advanced view and, for the simple view, shrink the dialog and hide some of the dialog items.
So what you're saying is have a single dialog for the "simple" version, but keep an array of dialog items, one for each player, and then show each player their own item?
So what you're saying is have a single dialog for the "simple" version, but keep an array of dialog items, one for each player, and then show each player their own item?
That would be one way to go about it, yes. Or you could have one dialog item showing the player name and minerals and change the text for each player. You have a few options here.
So the "simple" version would actually be smaller than the "advanced" version; it's less information, but it takes up less screen space. As far as I know, you can't change the size of a dialog for a specific player only eh? So unless I'm mistaken, that would require 2 separate dialogs.
Secondly, since one shows information about all players, and the other shows things about just that one player, without too many duplicate lines of code, I would need two arrays of dialog items, one for each dialog, each containing the same information. Unless you can think of something more efficient. Sorry I wasn't more specific in my op.
EDIT
So I guess now that I think about it, I should be able to just have a single array of dialog items because all the information is exactly the same for all players, I'm just changing the visibility of it all? Hmm I've never tried to do that before.
You do not need to create more than two dialogs for this- make your one "Advanced" dialog, and then one "simple" dialog. You're correct that you can't change the size of a dialog on a per-player basis, but you can change pretty much everything else individually. So you can just update your simple dialog to be different for each player. The specifics will likely vary depending on what information exactly you want, but here's an example of what you'd do:
// This would be either the trigger or action def to update the dialogLocalVariables:myPlayer(int)// Set this to the player you want the dialog to update forActions:Setdialogitem(mylabel)textto(combinetextmultiple:("Bonus Minerals: ")(convertintegertotext(Player(myPlayer)minerals))forplayergroup(convertplayertoplayergroup(myPlayer)//Here we convert the single player into a player group, because this parameter only accepts a player group. It's just an empty player group except for the specified player so it's nothing to be too concerned about, it's just an extra step // You can do this as many times as you want for as many dialog items you have. //Because only 1 player is actually seeing these changes, every player can use the same dialog, and will just see the correct information for themselves
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
To post a comment, please login or register a new account.
For my map, I'm trying to set up a better dialog to show game information. On the "advanced" dialog, i want to show the "bonus" value which is the same for all players, as well as each players current mineral count.
Bonus: 10 Player 1 Minerals: 1000 Player 2 Minerals: 948 Player 3 Minerals: 1100 ...
On the "simple" dialog, I want to show the "bonus" number and JUST the specific player's mineral count.
Bonus: 10 Your Minerals: 1000 ...
Since the "advanced" dialog is the same for all players, it can just be 1 that's shown to all players. And then the "simple" dialog would be an array of dialogs - one for each player (because each one shows specific player information to just that player). Does that sound like the best way to set that up?
@playpong: Go
You only need one dialog for the simple one. You would just need to change the dialog item's text value for a specific player.
If you wanted to get fancy you could do it all in one dialog window and have a button to switch between simple and advanced views, which would (presumably) increase the size of the dialog and show more dialog items for the advanced view and, for the simple view, shrink the dialog and hide some of the dialog items.
@BasharTeg: Go
So what you're saying is have a single dialog for the "simple" version, but keep an array of dialog items, one for each player, and then show each player their own item?
That would be one way to go about it, yes. Or you could have one dialog item showing the player name and minerals and change the text for each player. You have a few options here.
@BasharTeg: Go
So the "simple" version would actually be smaller than the "advanced" version; it's less information, but it takes up less screen space. As far as I know, you can't change the size of a dialog for a specific player only eh? So unless I'm mistaken, that would require 2 separate dialogs.
Secondly, since one shows information about all players, and the other shows things about just that one player, without too many duplicate lines of code, I would need two arrays of dialog items, one for each dialog, each containing the same information. Unless you can think of something more efficient. Sorry I wasn't more specific in my op.
EDIT
So I guess now that I think about it, I should be able to just have a single array of dialog items because all the information is exactly the same for all players, I'm just changing the visibility of it all? Hmm I've never tried to do that before.
You do not need to create more than two dialogs for this- make your one "Advanced" dialog, and then one "simple" dialog. You're correct that you can't change the size of a dialog on a per-player basis, but you can change pretty much everything else individually. So you can just update your simple dialog to be different for each player. The specifics will likely vary depending on what information exactly you want, but here's an example of what you'd do: