I hope there's an easy solution for this; thank you in advance for reviewing and helping out.
I'm trying to create a setup screen that each player (2 in total) selects things like their race, which units they want, et cetera. the issue is that, while it works well enough when I test it, when I test with a friend the dialogues do not work right. Basically, there are 4 screens that have a "NEXT" Button. If I am player 1, when player 2 presses 'NEXT', I see player 2's dialog and items even though I should not. The following image shows an example of a trigger that should be activated.
I tried to make it so that it hides only the triggering player's dialogs and will show them the next one, but something apparently is not working as intended. Help!
it might just be that after you create the labels or buttons that you should immediately hide them for all players and then show them for the triggering player
from what you have provided its kinda hard to see what is happening what is showing up the labels or buttons?
or are things being hidden from the player can we see screenshot of it happening maybe?
I'll have to try hiding the dialogs. I'm not sure that the suggestion by soul carver applies, unfortunately.
Is it possible to set up all of the dialog items in one trigger and just hide/show them as needed?
Thanks for the suggestions, btw. Could you give me an example of when it is useful to use the periodic updates rather than reactive updates from some input?
The entire issue is due to your arrays which are not even needed for the intended purpose that you're using them for. Currently you have setup mulitple copies of the same dialog and then saved them to a variable for each player; this is incorrect as dialogs and items are already done on a per player basis. Don't use triggering player for the index of the saved dialog variables. Think of it as currently you have 2 dialogs and your showing/hide each players dialog rather than what its supposed to be as one "master" dialog that is showing/hide at the option of the player.
The entire issue is due to your arrays which are not even needed for the intended purpose that you're using them for. Currently you have setup mulitple copies of the same dialog and then saved them to a variable for each player; this is incorrect as dialogs and items are already done on a per player basis. Don't use triggering player for the index of the saved dialog variables. Think of it as currently you have 2 dialogs and your showing/hide each players dialog rather than what its supposed to be as one "master" dialog that is showing/hide at the option of the player.
He's so right, just set the dialogs up once, give them each unique dialog item variables, or a 1 column array, then with all your triggers you can adjust them specifically, using "convert player to player group (triggering player)" to have said dialog item adjust for only that player.
Any changes one player makes to a dialog, will only affect that player, unless you trigger otherwise.
In your case, you want to change "pages" then make each "page" a panel dialog item type, then set each one of those Panels up to a variable with 1 array. So first page would be "Variable A[1]" second would be "Variable A[2]" etc, on panel creation (for every panel past 1) hide it on creation for all players. Now when the dialog pops up, it will only display any item within dialog panel 1. Then make your next page button, but attach it to the dialog itself, not a panel, from there you can easily make a trigger that will change the active page, for only the player using the dialog.
It should be pretty simple to make a Event: player uses dialog item Condition: Dialog item is Next button Action: If then else If: (Variable A[TriggeringPlayer]) < Max Pages Then: Hide Page (Variable A) for Triggering Player, Set Variable A = Variable A +1, Show Page(Variable A) for Triggering Player
Then do the reverse for the previous button.
With that logic you should be able to handle the rest, just keep in mind that things like dialogs don't need to be made for each player, as they can be easily edited to display for individual players.
Rollback Post to RevisionRollBack
Zergling Blood : starcraft://map/1/35684
Game of Thrones : starcraft://map/1/189756
Tacticraft : starcraft://map/1/223625
Ugh. This is the second 'programming pass' I've taken at this map- The first time I programmed it so that dialog items were created once and then hidden/shown to players as needed, but it ended up showing the items to everyone. So I took a break, came back a few weeks later, and reprogrammed the dialog screens to do what you see here in the screenshot. I got the same problem as before where the dialog items display for both active players as they go through.
I can try re-sizing the dialog items/dialogs this week back to how they were. I don't want to go back to the first version of the triggers I made as they're a lot messier. I really hate that this first section of the map is holding me up for so long!
Thank you for the explainations- at least I know theoretically how they should work.
Also, when you say not to use Triggering player, this just displays the integer of a player (1-14..?), right?
I think you may be misunderstanding the issue at heart. While yes triggering player is actually just an integer, the issues isn't that your using the wrong reference/index/etc its that you've created two dialogs; you shouldn't be using arrays at all (thats the issue). What is happening in your map is with two copies of the same dialog, you end up hiding one and but it still shows because in reality you've only hide one dialog and not the copy too. If this is done correctly it actually won't be messier is any shape or form.
Basically look at the trigger where the dialog is created and ensure that is its not created via a player loop and that your not creating it for player 1 and then player 2,etc. Only create it once for ALL players. If you still have issues after having a good look at the dialog creation trigger, just post it up here and i can pinpoint the issue even through the mess in a heartbeat.
Alright. I'll make some changes- when I said that the first triggers I made were messier when they were single rather than an array of dialogs, I meant that I just didn't organize or name things as well as I should have and it was hard to follow and debug. At work right now, though- it might be a while.
Perhaps I mis-typed. I don't mean preload in a formal sense of the checkbox that you can load assets.. I mean- have a trigger that creates all of the dialogs/dialog items that i'll use at the beginning of the game and hide them. I just tried throwing something together that does this and it seems to work, so I answered my own question. :)
Yes and in fact i recommend it provided you used threaded definitions so its works smoothly. Dialogs normally are hidden until you tell them to show but they are still "there".
Rollback Post to RevisionRollBack
When I want your opinion...I'll give it to you!
To post a comment, please login or register a new account.
Hello,
I hope there's an easy solution for this; thank you in advance for reviewing and helping out.
I'm trying to create a setup screen that each player (2 in total) selects things like their race, which units they want, et cetera. the issue is that, while it works well enough when I test it, when I test with a friend the dialogues do not work right. Basically, there are 4 screens that have a "NEXT" Button. If I am player 1, when player 2 presses 'NEXT', I see player 2's dialog and items even though I should not. The following image shows an example of a trigger that should be activated.
I tried to make it so that it hides only the triggering player's dialogs and will show them the next one, but something apparently is not working as intended. Help!
it might just be that after you create the labels or buttons that you should immediately hide them for all players and then show them for the triggering player
from what you have provided its kinda hard to see what is happening what is showing up the labels or buttons?
or are things being hidden from the player can we see screenshot of it happening maybe?
@En7ropi: Go
After you create all of your dialog items then you do a
that gets all the players set up with the same values
when you update the dialog items you would do in in a periodic trigger as such
I'll have to try hiding the dialogs. I'm not sure that the suggestion by soul carver applies, unfortunately.
Is it possible to set up all of the dialog items in one trigger and just hide/show them as needed?
Thanks for the suggestions, btw. Could you give me an example of when it is useful to use the periodic updates rather than reactive updates from some input?
The entire issue is due to your arrays which are not even needed for the intended purpose that you're using them for. Currently you have setup mulitple copies of the same dialog and then saved them to a variable for each player; this is incorrect as dialogs and items are already done on a per player basis. Don't use triggering player for the index of the saved dialog variables. Think of it as currently you have 2 dialogs and your showing/hide each players dialog rather than what its supposed to be as one "master" dialog that is showing/hide at the option of the player.
He's so right, just set the dialogs up once, give them each unique dialog item variables, or a 1 column array, then with all your triggers you can adjust them specifically, using "convert player to player group (triggering player)" to have said dialog item adjust for only that player.
Any changes one player makes to a dialog, will only affect that player, unless you trigger otherwise.
In your case, you want to change "pages" then make each "page" a panel dialog item type, then set each one of those Panels up to a variable with 1 array. So first page would be "Variable A[1]" second would be "Variable A[2]" etc, on panel creation (for every panel past 1) hide it on creation for all players. Now when the dialog pops up, it will only display any item within dialog panel 1. Then make your next page button, but attach it to the dialog itself, not a panel, from there you can easily make a trigger that will change the active page, for only the player using the dialog.
It should be pretty simple to make a Event: player uses dialog item Condition: Dialog item is Next button Action: If then else If: (Variable A[TriggeringPlayer]) < Max Pages Then: Hide Page (Variable A) for Triggering Player, Set Variable A = Variable A +1, Show Page(Variable A) for Triggering Player
Then do the reverse for the previous button.
With that logic you should be able to handle the rest, just keep in mind that things like dialogs don't need to be made for each player, as they can be easily edited to display for individual players.
@hobbidude: Go and @EchoedRequiem: Go
Ugh. This is the second 'programming pass' I've taken at this map- The first time I programmed it so that dialog items were created once and then hidden/shown to players as needed, but it ended up showing the items to everyone. So I took a break, came back a few weeks later, and reprogrammed the dialog screens to do what you see here in the screenshot. I got the same problem as before where the dialog items display for both active players as they go through.
I can try re-sizing the dialog items/dialogs this week back to how they were. I don't want to go back to the first version of the triggers I made as they're a lot messier. I really hate that this first section of the map is holding me up for so long!
Thank you for the explainations- at least I know theoretically how they should work.
Also, when you say not to use Triggering player, this just displays the integer of a player (1-14..?), right?
@En7ropi: Go
I think you may be misunderstanding the issue at heart. While yes triggering player is actually just an integer, the issues isn't that your using the wrong reference/index/etc its that you've created two dialogs; you shouldn't be using arrays at all (thats the issue). What is happening in your map is with two copies of the same dialog, you end up hiding one and but it still shows because in reality you've only hide one dialog and not the copy too. If this is done correctly it actually won't be messier is any shape or form.
Basically look at the trigger where the dialog is created and ensure that is its not created via a player loop and that your not creating it for player 1 and then player 2,etc. Only create it once for ALL players. If you still have issues after having a good look at the dialog creation trigger, just post it up here and i can pinpoint the issue even through the mess in a heartbeat.
@hobbidude: Go
Alright. I'll make some changes- when I said that the first triggers I made were messier when they were single rather than an array of dialogs, I meant that I just didn't organize or name things as well as I should have and it was hard to follow and debug. At work right now, though- it might be a while.
I appreciate extending your help.
Is it possible to 'preload' all of the dialogs at the start (and hide them all), then use triggers to show/hide the items/dialogs as needed?
no, preload only works for data assets, and banks.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
Perhaps I mis-typed. I don't mean preload in a formal sense of the checkbox that you can load assets.. I mean- have a trigger that creates all of the dialogs/dialog items that i'll use at the beginning of the game and hide them. I just tried throwing something together that does this and it seems to work, so I answered my own question. :)
@En7ropi: Go
Yes and in fact i recommend it provided you used threaded definitions so its works smoothly. Dialogs normally are hidden until you tell them to show but they are still "there".