So in my map I've decided to try something a little bit different and make a shop system entirely out of dialog. The actual shop part of it works fine as far as I can tell, but I'm having issues with a show/hide button when there is multiple players in the game (which would be 99% of the time when it's released). If I click the show button then it show's the shopping menu, that works, but if it's open and one of the other players opens the menu then mine closes. It works fine with one player, but with multiple it's buggy. And it's not that I'm using a single boolean variable either. Here is the trigger in question;
"Show/Hide Shop"ClickedEventsDialog-AnyDialogItemisusedbyPlayerAnyPlayerwitheventtypeClickedLocalVariablesConditions(Useddialogitem)==Show/HideShopButtonActions-------P1General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==1ShopisVisible?[1]==falseThenDialog-ShowDialog[2]for(Playergroup(1))Variable-SetShopisVisible?[1]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(1))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(1))ElseDialog-HideDialog[2]for(Playergroup(1))Variable-SetShopisVisible?[1]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(1))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(1))-------P2General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==2ShopisVisible?[2]==falseThenDialog-ShowDialog[2]for(Playergroup(2))Variable-SetShopisVisible?[2]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(2))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(2))ElseDialog-HideDialog[2]for(Playergroup(2))Variable-SetShopisVisible?[2]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(2))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(2))-------P3General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==3ShopisVisible?[3]==falseThenDialog-ShowDialog[2]for(Playergroup(3))Variable-SetShopisVisible?[3]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(3))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(3))ElseDialog-HideDialog[2]for(Playergroup(3))Variable-SetShopisVisible?[3]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(3))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(3))-------P4General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==4ShopisVisible?[4]==falseThenDialog-ShowDialog[2]for(Playergroup(4))Variable-SetShopisVisible?[4]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(4))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(4))ElseDialog-HideDialog[2]for(Playergroup(4))Variable-SetShopisVisible?[4]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(4))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(4))-------P5General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==5ShopisVisible?[5]==falseThenDialog-ShowDialog[2]for(Playergroup(5))Variable-SetShopisVisible?[5]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(5))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(5))ElseDialog-HideDialog[2]for(Playergroup(5))Variable-SetShopisVisible?[5]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(5))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(5))-------P6General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==6ShopisVisible?[6]==falseThenDialog-ShowDialog[2]for(Playergroup(6))Variable-SetShopisVisible?[6]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(6))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(6))ElseDialog-HideDialog[2]for(Playergroup(6))Variable-SetShopisVisible?[6]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(6))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(6))-------P7General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==7ShopisVisible?[7]==falseThenDialog-ShowDialog[2]for(Playergroup(7))Variable-SetShopisVisible?[7]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(7))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(7))ElseDialog-HideDialog[2]for(Playergroup(7))Variable-SetShopisVisible?[7]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(7))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(7))-------P8General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringplayer)==8ShopisVisible?[8]==falseThenDialog-ShowDialog[2]for(Playergroup(8))Variable-SetShopisVisible?[8]=trueDialog-SetShow/HideShopButtontextto"Hide Shop"for(Playergroup(8))Dialog-SetShow/HideShopButtontooltipto"Hides the shop bar from immediate v..."for(Playergroup(8))ElseDialog-HideDialog[2]for(Playergroup(8))Variable-SetShopisVisible?[8]=falseDialog-SetShow/HideShopButtontextto"Show Shop"for(Playergroup(8))Dialog-SetShow/HideShopButtontooltipto"Show's the shop bar, which allows y..."for(Playergroup(8))
What's my problem? I can't figure this out... Is there a better way of detecting who used the dialog item?
LMFAO figured it out I think. Forgot to put the other condition inside of the first ITE Statement.
Well it's good to see you managed to work it out :) Just to let you know, you can simplify this code greatly. Anytime you have a section of code that repeats itself except for a different number, 99% of the time you can use a for loop, or a pick each integer loop to do all the work for you.
Example:
Pick each integer between 1 and 8 (i.e. for players 1 to 8)
If (triggering player) == Pick integer
AND Shop is visible [Picked integer] == false
Then.... etc.
So in my map I've decided to try something a little bit different and make a shop system entirely out of dialog. The actual shop part of it works fine as far as I can tell, but I'm having issues with a show/hide button when there is multiple players in the game (which would be 99% of the time when it's released). If I click the show button then it show's the shopping menu, that works, but if it's open and one of the other players opens the menu then mine closes. It works fine with one player, but with multiple it's buggy. And it's not that I'm using a single boolean variable either. Here is the trigger in question;
What's my problem? I can't figure this out... Is there a better way of detecting who used the dialog item?
LMFAO figured it out I think. Forgot to put the other condition inside of the first ITE Statement.
Well it's good to see you managed to work it out :) Just to let you know, you can simplify this code greatly. Anytime you have a section of code that repeats itself except for a different number, 99% of the time you can use a for loop, or a pick each integer loop to do all the work for you.
Example:
Pick each integer between 1 and 8 (i.e. for players 1 to 8)
If (triggering player) == Pick integer
AND Shop is visible [Picked integer] == false
Then.... etc.