Hi guys. I have learned so much from this site and wish to thank you all for posting your knowledge!!
I have been trying to create a 4 page ( or just a scrolling dialog would be fine too. basically I want to be able to add new achievements without too much work ) custom Achievement dialog for my game. It works fine ( although my programming leaves much to be desired ) for me when I test it, but when multiple players are in the game, it goes wacky. For example: If I open the dialog, and then another player opens the dialog, only he can scroll through the pages. The achievements earned are loaded and saved correctly. I am just having a problem with the player group (player) or even triggering player.
I was hoping that someone could possibly do a tutorial on something like this before I go insane. I think I just programmed it wrong as I have zero loops and I think this is necessary ( there are a lot of achievements ) to be able to have them all in one trigger.
What I was trying to do:
There is an Achievements button that is shown for up to 4 players.
When any player clicks on the Achievements button, it hides and shows the Achievements dialog with all Achievements that player has earned.
The player should be able to switch between pages (or if this can be done with a scroll bar, even better) and be able to close each page without affecting another player's Achievement dialog.
Relatively simple I think, and I have most of it working. I just think I went about it all wrong.
Please help me save my sanity and write a tutorial for this. My code is a mess. I have way too many variables and triggers after watching numerous other tutorials on similar dialogs.
Thanks for reading.
Faust
P.S. I can post the code I have if needed, but I would rather not as I think it is just a huge mess.
Ah, tutorials... If you think about the problem for a while, you'll definitely figure out a good solution that makes sense to you.
I have no idea how you coded up the thing but in your case I would manage each dialog independently per-player. That means an array of 16 dialogs, and other arrays of 16 dialog items for buttons and such. Each dialog would only be visible to the corresponding player and only he could interact with it.
Beyond that, it doesn't sound too complex. If it works for a single player, it will work in multiplayer with each player having his dialog.
Ah, tutorials... If you think about the problem for a while, you'll definitely figure out a good solution that makes sense to you.
I have no idea how you coded up the thing but in your case I would manage each dialog independently per-player. That means an array of 16 dialogs, and other arrays of 16 dialog items for buttons and such. Each dialog would only be visible to the corresponding player and only he could interact with it.
Beyond that, it doesn't sound too complex. If it works for a single player, it will work in multiplayer with each player having his dialog.
no need to create it 16 times. As long as the structure is the same, the displayed info can be managed on a per player basis. e.g. show/hide dialog item for player X (or was it for player group (Convert player X to player group))
I've attached a map I did that demonstrtes how to achieve what you're
trying to do.
Thanks Dustin! I did however notice that you show the dialog items to all players. Shouldn't that be Triggering Player?
Also, to make the dialog appear after clicking an Achievement button, I would just show for triggering player right? And after clicking a Close button, hide for triggering player? Am I getting this? ^^
Helral, I assumed he wanted per-player achievements (with players able to see the achievements of other players). If the information is shared by all, then sure, just one dialog will do.
Actually, the achievements are the same for each player. I basically show a red image if the specific user doesn't have the achievement and a normal image if he/she does. Each player has the same dialog, but whether or not the image is red or normal depends on each user's own achievements. I hope that was understandable. :)
What Dustin sent may be what I am looking for but I still have to mess with it to make sure. Like I wrote in the post above, there are a lot of All Players where I think Triggering Player should be used...but I may be wrong. If you could have a look at the map he posted, that would help a great deal.
Again, to reiterate, I need a the same dialog to show for each of the four players individually. For example, if player one and player two are both looking at the dialog at the same time, they should be able to change pages and close the dialog without affecting the other player.
Ok, so this is what I was trying to do and it works for me when I am testing. The question is, will it work for 4 players and each player can use it without affecting the other players?
//
edit: I noticed that the buttons are no longer hiding the previous screens. Also, I am getting the famous param/value errors due to localization. I think I can fix that on my own though.
Ok, I now have it working fine. Whew! :-) What I am wondering now, is how to get the images that I show for the achievements to only show on that page.
For example:
User opens achievements window and see all of his achievements on page 1. When he clicks to page 2, the achievements for page1 are hidden and his page 2 achievements are shown. Every player has the same achievements.
The trigger for the actual achievement dialog and this is the part I don't get. I have 2 images that will show. As you will see they will show on all pages. I just need them to show on page 1 though. When I go to page 2, I want different images to show, etc...
DisplayAchievementsEventsDialog-AnyDialogItemisusedbyPlayerAnyPlayerwitheventtypeClickedLocalVariablesI=0<Integer>Conditions(Useddialogitem)==AchevementsButtonDialogButtonActions------- We need to create all the dialog items and hide them.------- Dialog = Main Dialog Box------- Dialog Buttons = Array of the two buttons [Next and Previous]------- Dialog Labelss = Array of all the Labels for the Dialog.Dialog-HideAchevementsButtonDialogfor(Allplayers)Dialog-CreateaModaldialogofsize(1200,900)at(0,0)relativetoCenterofscreenVariable-SetDisplayAchievementsDialog=(Lastcreateddialog)Dialog-HideDisplayAchievementsDialogfor(Allplayers)Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsDialogButtonSizeX,DisplayAchievementsDialogButtonSizeY)anchoredtoBottomRightwithanoffsetof((DisplayAchievementsDialogButtonOffset+DisplayAchievementsDialogButtonSizeX),DisplayAchievementsDialogButtonOffset)settingthetooltipto"Previous"withbuttontext"<<"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[1]=(Lastcreateddialogitem)Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsDialogButtonSizeX,DisplayAchievementsDialogButtonSizeY)anchoredtoBottomRightwithanoffsetof(DisplayAchievementsDialogButtonOffset,DisplayAchievementsDialogButtonOffset)settingthetooltipto"Next"withbuttontext">>"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[2]=(Lastcreateddialogitem)Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsCloseButtonSize,DisplayAchievementsCloseButtonSize)anchoredtoTopRightwithanoffsetof(DisplayAchievementsCloseButtonOffset,DisplayAchievementsCloseButtonOffset)settingthetooltipto"Close Achievements"withbuttontext"X"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[3]=(Lastcreateddialogitem)------- I used Integer loop here to speed things up, creating however many dialogs are set to MaxPages.General-ForeachintegerIfrom1toDisplayAchievementsMaxPageswithincrement1,do(Actions)ActionsDialog-CreatealabelfordialogDisplayAchievementsDialogwiththedimensions(300,50)anchoredtoCenterwithanoffsetof(60,0)withthetext("Dialog Item Text "+(Text(I)))colorsettoWhitetextwriteoutsettoFalsewithawriteoutdurationof1.0Variable-SetDisplayAchievementsDialogLabels[I]=(Lastcreateddialogitem)Dialog-Createanimagefordialog(Lastcreateddialog)withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(50,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-zergling.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImageZergling[1]=(Lastcreateddialogitem)Dialog-Createanimagefordialog(Lastcreateddialog)withthedimensions(76,76)anchoredtoTopLeftwithanoffsetof(126,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-zergling.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImageZergling[2]=(Lastcreateddialogitem)------- Make sure to Hide the Dialog Item.Dialog-HideDisplayAchievementsDialogLabels[I]for(Allplayers)------- Now we setup and show the Dialog to the player.Dialog-ShowDisplayAchievementsDialogfor(Playergroup((Triggeringplayer)))Dialog-ShowDisplayAchievementsDialogLabels[DisplayAchievementsFirstPage]for(Playergroup((Triggeringplayer)))
And finally the dialog click trigger for changing which page you are seeing
DialogClickedEventsDialog-AnyDialogItemisusedbyPlayerAnyPlayerwitheventtypeClickedLocalVariablesClickedDialogButton=(Useddialogitem)<DialogItem>ConditionsActions------- Checks to see if they clicked the LEFT, Previous button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[1]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Allplayers)Variable-SetDisplayAchievementsCurrentPage=(DisplayAchievementsCurrentPage-1)------- This IF THEN checks to see if it needs to loop the Current Page to the End.General-If(Conditions)thendo(Actions)elsedo(Actions)IfDisplayAchievementsCurrentPage<DisplayAchievementsFirstPageThenVariable-SetDisplayAchievementsCurrentPage=DisplayAchievementsMaxPagesElseDialog-ShowDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Allplayers)Else------- Checks to see if they clicked the RIGHT, Next button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[2]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Allplayers)Variable-SetDisplayAchievementsCurrentPage=(DisplayAchievementsCurrentPage+1)------- This IF THEN checks to see if it needs to loop the Current Page to the Beginning.General-If(Conditions)thendo(Actions)elsedo(Actions)IfDisplayAchievementsCurrentPage>DisplayAchievementsMaxPagesThenVariable-SetDisplayAchievementsCurrentPage=DisplayAchievementsFirstPageElseDialog-ShowDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Allplayers)Else------- Checks to see if they clicked the CLOSE button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[3]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))Dialog-HideDisplayAchievementsDialogfor(Playergroup((Triggeringplayer)))Dialog-ShowAchevementsButtonDialogfor(Playergroup((Triggeringplayer)))Else
Thank you Dustin374 for posting your map and I just modified what you posted to what I needed.
in the second trigger you are creating 2 images per page, but you are setting them to the same variable: e.g.
image[1] = image 1 page 1
image[2] = image 2 page 1
image[1] = image 1 page 2
image[2] = image 2 page 2
if you now try to use image[1] to hide the image on page 1 you will fail, because it is set to the image on page 2. same goes for image[2].
solution:
make the variable "Display Achievements Image Zergling" a 2 Dimensional array, first value is page, second value is image nr.:
image[1][1] = image 1 page 1
image[1][2] = image 2 page 1
image[2][1] = image 1 page 2
image[2][2] = image 2 page 2
now you can hide the images on page 1 with image[1][1] and image[1][2]
Also in the last trigger you are using (All players) several times instead of (Player group((Triggering player)).
The Hide Display Achievements .... and Show Display Achievements .... actions.
And finally you are recreating the dialogs each time the button is pressed, bit of overkill if you ask me. ain't it simpler to just create them once and then just hide/show that single dialog for the specific player that presses the button?
AchievementButtonDialogEventsGame-MapinitializationLocalVariablesi=0<Integer>ConditionsActionsGeneral-Foreachintegerifrom1toDisplayAchievementsMaxPageswithincrement1,do(Actions)ActionsVariable-SetPage[i]=iGeneral-Foreachintegerifrom1toColumnswithincrement1,do(Actions)ActionsVariable-SetColumn[i]=iDialog-CreateaModaldialogofsize(1200,900)at(0,0)relativetoCenterofscreenVariable-SetDisplayAchievementsDialog=(Lastcreateddialog)Dialog-HideDisplayAchievementsDialogfor(Playergroup((Triggeringplayer)))Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsDialogButtonSizeX,DisplayAchievementsDialogButtonSizeY)anchoredtoBottomRightwithanoffsetof((DisplayAchievementsDialogButtonOffset+DisplayAchievementsDialogButtonSizeX),DisplayAchievementsDialogButtonOffset)settingthetooltipto"Previous"withbuttontext"<<"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[1]=(Lastcreateddialogitem)Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsDialogButtonSizeX,DisplayAchievementsDialogButtonSizeY)anchoredtoBottomRightwithanoffsetof(DisplayAchievementsDialogButtonOffset,DisplayAchievementsDialogButtonOffset)settingthetooltipto"Next"withbuttontext">>"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[2]=(Lastcreateddialogitem)Dialog-CreateabuttonfordialogDisplayAchievementsDialogwiththedimensions(DisplayAchievementsCloseButtonSize,DisplayAchievementsCloseButtonSize)anchoredtoTopRightwithanoffsetof(DisplayAchievementsCloseButtonOffset,DisplayAchievementsCloseButtonOffset)settingthetooltipto"Close Achievements"withbuttontext"X"andthehoverimagesetto""Variable-SetDisplayAchievementsDialogButtons[3]=(Lastcreateddialogitem)------- I used Integer loop here to speed things up, creating however many dialogs are set to MaxPages.General-Foreachintegerifrom1toDisplayAchievementsMaxPageswithincrement1,do(Actions)ActionsDialog-CreatealabelfordialogDisplayAchievementsDialogwiththedimensions(300,50)anchoredtoCenterwithanoffsetof(60,0)withthetext("Dialog Item Text "+(Text(i)))colorsettoWhitetextwriteoutsettoFalsewithawriteoutdurationof1.0Variable-SetDisplayAchievementsDialogLabels[i]=(Lastcreateddialogitem)Dialog-HideDisplayAchievementsDialogLabels[i]for(ActivePlayers)General-If(Conditions)thendo(Actions)elsedo(Actions)Ifi==1ThenDialog-CreateanimagefordialogDisplayAchievementsDialogwiththedimensions(76,76)anchoredtoTopLeftwithanoffsetof(50,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-zergling.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[1]]=(Lastcreateddialogitem)Dialog-Hide(Lastcreateddialogitem)for(Allplayers)Dialog-CreateanimagefordialogDisplayAchievementsDialogwiththedimensions(76,76)anchoredtoTopLeftwithanoffsetof(126,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-roach.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[2]]=(Lastcreateddialogitem)Dialog-Hide(Lastcreateddialogitem)for(Allplayers)ElseGeneral-If(Conditions)thendo(Actions)elsedo(Actions)Ifi==2ThenDialog-CreateanimagefordialogDisplayAchievementsDialogwiththedimensions(76,76)anchoredtoTopLeftwithanoffsetof(50,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-roach.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImage[Page2][DisplayAchievementsRoach][Column[1]]=(Lastcreateddialogitem)Dialog-Hide(Lastcreateddialogitem)for(Allplayers)Dialog-CreateanimagefordialogDisplayAchievementsDialogwiththedimensions(76,76)anchoredtoTopLeftwithanoffsetof(126,50)settingthetooltipto""usingtheimageAssets\Textures\btn-unit-zerg-roach.ddsasaNormaltypewithtiledsettoTruetintcolorWhiteandblendmodeNormalVariable-SetDisplayAchievementsImage[Page2][DisplayAchievementsRoach][Column[2]]=(Lastcreateddialogitem)Dialog-Hide(Lastcreateddialogitem)for(Allplayers)Else------- Make sure to Hide the Dialog Item.Dialog-CreateaModaldialogofsize(225,65)at(0,335)relativetoBottomRightofscreenVariable-SetAchievementsButtonDialog=(Lastcreateddialog)Dialog-CreateabuttonfordialogAchievementsButtonDialogwiththedimensions(220,60)anchoredtoCenterwithanoffsetof(0,0)settingthetooltipto"Open Achievement window"withbuttontext"Achievements"andthehoverimagesetto""Variable-SetAchievementsButtonDialogButton=(Lastcreateddialogitem)Dialog-ShowAchievementsButtonDialogfor(ActivePlayers)
DialogClickedEventsDialog-AnyDialogItemisusedbyPlayerAnyPlayerwitheventtypeClickedLocalVariablesClickedDialogButton=(Useddialogitem)<DialogItem>ConditionsActions------- Checks to see if they clicked the LEFT, Previous button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[1]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))Variable-SetDisplayAchievementsCurrentPage=(DisplayAchievementsCurrentPage-1)------- This IF THEN checks to see if it needs to loop the Current Page to the End.General-If(Conditions)thendo(Actions)elsedo(Actions)IfDisplayAchievementsCurrentPage<DisplayAchievementsFirstPageThenVariable-SetDisplayAchievementsCurrentPage=DisplayAchievementsMaxPagesDialog-HideDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[1]]for(Playergroup((Triggeringplayer)))Dialog-HideDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[2]]for(Playergroup((Triggeringplayer)))ElseDialog-ShowDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))Else------- Checks to see if they clicked the RIGHT, Next button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[2]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))General-If(Conditions)thendo(Actions)elsedo(Actions)IfDisplayAchievementsCurrentPage==1ThenDialog-HideDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[1]]for(Playergroup((Triggeringplayer)))Dialog-HideDisplayAchievementsImage[Page[1]][DisplayAchievementsZergling][Column[2]]for(Playergroup((Triggeringplayer)))ElseVariable-SetDisplayAchievementsCurrentPage=(DisplayAchievementsCurrentPage+1)------- This IF THEN checks to see if it needs to loop the Current Page to the Beginning.General-If(Conditions)thendo(Actions)elsedo(Actions)IfDisplayAchievementsCurrentPage>DisplayAchievementsMaxPagesThenVariable-SetDisplayAchievementsCurrentPage=DisplayAchievementsFirstPageElseDialog-ShowDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))Else------- Checks to see if they clicked the CLOSE button.General-If(Conditions)thendo(Actions)elsedo(Actions)IfClickedDialogButton==DisplayAchievementsDialogButtons[3]ThenDialog-HideDisplayAchievementsDialogLabels[DisplayAchievementsCurrentPage]for(Playergroup((Triggeringplayer)))Dialog-HideDisplayAchievementsDialogfor(Playergroup((Triggeringplayer)))Dialog-ShowAchievementsButtonDialogfor(Playergroup((Triggeringplayer)))Else
Just a quick comment first. The column, page and display achievement xxxxx variables are just so that it is easier to read the code.
Now on to the questions. I have a line in the first trigger: "Dialog - Hide Display Achievements Dialog Labels[i] for (Active Players)". If I use (Player Group (Triggering Player)) then when I click the achievement button, I get all of the labels at once on top of each other. If I just click through, then it is fine after it goes through all 4 pages. I have no idea why that is, but when I use (Active Players) it works fine.
Next question. I create all of the image files in the first trigger. Do I then need to do a show/hide with an IF THEN statement to show or hide them all depending on what "Display Achievements Current Page" is equal to, or is there an easier way?
Thanks a million. I am almost there.
Faust
P.S. Would this be "easier" with Action Definitions?
Now on to the questions. I have a line in the first trigger: "Dialog - Hide Display Achievements Dialog Labels[i] for (Active Players)". If I use (Player Group (Triggering Player)) then when I click the achievement button, I get all of the labels at once on top of each other. If I just click through, then it is fine after it goes through all 4 pages. I have no idea why that is, but when I use (Active Players) it works fine.
you forget to check which page to display, or on creation to hide everything except what is on the first page.
Next question. I create all of the image files in the first trigger. Do I then need to do a show/hide with an IF THEN statement to show or hide them all depending on what "Display Achievements Current Page" is equal to, or is there an easier way?
Mark achievements per player for visible/not visible. Then just check it with a loop over the full achievements array for that page.
Thanks again Helral! I am reading all about them now and see myself doind a major overhaul on my code. I have already reprogrammed everything into loops and variables and have saved so much space, not to mention how much easier it is to debug.
Thanks for all of your help!!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi guys. I have learned so much from this site and wish to thank you all for posting your knowledge!!
I have been trying to create a 4 page ( or just a scrolling dialog would be fine too. basically I want to be able to add new achievements without too much work ) custom Achievement dialog for my game. It works fine ( although my programming leaves much to be desired ) for me when I test it, but when multiple players are in the game, it goes wacky. For example: If I open the dialog, and then another player opens the dialog, only he can scroll through the pages. The achievements earned are loaded and saved correctly. I am just having a problem with the player group (player) or even triggering player.
I was hoping that someone could possibly do a tutorial on something like this before I go insane. I think I just programmed it wrong as I have zero loops and I think this is necessary ( there are a lot of achievements ) to be able to have them all in one trigger.
What I was trying to do:
There is an Achievements button that is shown for up to 4 players. When any player clicks on the Achievements button, it hides and shows the Achievements dialog with all Achievements that player has earned. The player should be able to switch between pages (or if this can be done with a scroll bar, even better) and be able to close each page without affecting another player's Achievement dialog.
Relatively simple I think, and I have most of it working. I just think I went about it all wrong.
Please help me save my sanity and write a tutorial for this. My code is a mess. I have way too many variables and triggers after watching numerous other tutorials on similar dialogs.
Thanks for reading.
Faust
P.S. I can post the code I have if needed, but I would rather not as I think it is just a huge mess.
Ah, tutorials... If you think about the problem for a while, you'll definitely figure out a good solution that makes sense to you.
I have no idea how you coded up the thing but in your case I would manage each dialog independently per-player. That means an array of 16 dialogs, and other arrays of 16 dialog items for buttons and such. Each dialog would only be visible to the corresponding player and only he could interact with it.
Beyond that, it doesn't sound too complex. If it works for a single player, it will work in multiplayer with each player having his dialog.
I've attached a map I did that demonstrtes how to achieve what you're trying to do.
Moved Thread: this is about dialogs and not about UI (SC2Layout)
no need to create it 16 times. As long as the structure is the same, the displayed info can be managed on a per player basis. e.g. show/hide dialog item for player X (or was it for player group (Convert player X to player group))
Thanks Dustin! I did however notice that you show the dialog items to all players. Shouldn't that be Triggering Player?
Also, to make the dialog appear after clicking an Achievement button, I would just show for triggering player right? And after clicking a Close button, hide for triggering player? Am I getting this? ^^
Helral, I assumed he wanted per-player achievements (with players able to see the achievements of other players). If the information is shared by all, then sure, just one dialog will do.
@StragusMapster: Go
Actually, the achievements are the same for each player. I basically show a red image if the specific user doesn't have the achievement and a normal image if he/she does. Each player has the same dialog, but whether or not the image is red or normal depends on each user's own achievements. I hope that was understandable. :)
What Dustin sent may be what I am looking for but I still have to mess with it to make sure. Like I wrote in the post above, there are a lot of All Players where I think Triggering Player should be used...but I may be wrong. If you could have a look at the map he posted, that would help a great deal.
Again, to reiterate, I need a the same dialog to show for each of the four players individually. For example, if player one and player two are both looking at the dialog at the same time, they should be able to change pages and close the dialog without affecting the other player.
Thanks!!
Faust
@Faust7777: Go
Ok, so this is what I was trying to do and it works for me when I am testing. The question is, will it work for 4 players and each player can use it without affecting the other players?
//
edit: I noticed that the buttons are no longer hiding the previous screens. Also, I am getting the famous param/value errors due to localization. I think I can fix that on my own though.
@Faust7777: Go
Ok, I now have it working fine. Whew! :-) What I am wondering now, is how to get the images that I show for the achievements to only show on that page.
For example:
User opens achievements window and see all of his achievements on page 1. When he clicks to page 2, the achievements for page1 are hidden and his page 2 achievements are shown. Every player has the same achievements.
This is driving me crazy!
Here is the code I have so far:
The variables:
My achievement button to actually show the achievements:
The trigger for the actual achievement dialog and this is the part I don't get. I have 2 images that will show. As you will see they will show on all pages. I just need them to show on page 1 though. When I go to page 2, I want different images to show, etc...
And finally the dialog click trigger for changing which page you are seeing
Thank you Dustin374 for posting your map and I just modified what you posted to what I needed.
Faust
in the second trigger you are creating 2 images per page, but you are setting them to the same variable: e.g.
image[1] = image 1 page 1
image[2] = image 2 page 1
image[1] = image 1 page 2
image[2] = image 2 page 2
if you now try to use image[1] to hide the image on page 1 you will fail, because it is set to the image on page 2. same goes for image[2].
solution:
make the variable "Display Achievements Image Zergling" a 2 Dimensional array, first value is page, second value is image nr.:
image[1][1] = image 1 page 1
image[1][2] = image 2 page 1
image[2][1] = image 1 page 2
image[2][2] = image 2 page 2
now you can hide the images on page 1 with image[1][1] and image[1][2]
Also in the last trigger you are using (All players) several times instead of (Player group((Triggering player)). The Hide Display Achievements .... and Show Display Achievements .... actions.
And finally you are recreating the dialogs each time the button is pressed, bit of overkill if you ask me. ain't it simpler to just create them once and then just hide/show that single dialog for the specific player that presses the button?
@Helral: Go
Helral: Thank you very much! This is really helping and I almost get it. Before I ask yet another question, here is the updated code:
Variables:
The first trigger:
The second trigger:
The third and last trigger:
Just a quick comment first. The column, page and display achievement xxxxx variables are just so that it is easier to read the code.
Now on to the questions. I have a line in the first trigger: "Dialog - Hide Display Achievements Dialog Labels[i] for (Active Players)". If I use (Player Group (Triggering Player)) then when I click the achievement button, I get all of the labels at once on top of each other. If I just click through, then it is fine after it goes through all 4 pages. I have no idea why that is, but when I use (Active Players) it works fine.
Next question. I create all of the image files in the first trigger. Do I then need to do a show/hide with an IF THEN statement to show or hide them all depending on what "Display Achievements Current Page" is equal to, or is there an easier way?
Thanks a million. I am almost there.
Faust
P.S. Would this be "easier" with Action Definitions?
you forget to check which page to display, or on creation to hide everything except what is on the first page.
Mark achievements per player for visible/not visible. Then just check it with a loop over the full achievements array for that page.
Yes.
Action Definition examples: (not all might be useful for you to implement)
@Helral: Go
Thanks again Helral! I am reading all about them now and see myself doind a major overhaul on my code. I have already reprogrammed everything into loops and variables and have saved so much space, not to mention how much easier it is to debug.
Thanks for all of your help!!