So I have hit a snag, it would seem that if you move a dialog item for a player it moves that dialog item for all players. Anyone know of a way around this or do my mobile dialogs that move differently for each player have to be made as separate dialog items for each player?
If the move dialog item action doesnt work properly i think there is no other way. But it is really not much work. Just change the variable of the item to an array. Instead of creating one item you use "for each integer" and hide the items for everyone but the one player.
The function for moving dialog items should have a parameter "playergroup". You just need to make sure that you set this playergroup properly. Say I wanted to move the dialog item for only player 1, it would probably be PlayerGroupSingle(1).
There is no need to create 1 dialog item for each player. Recycle them as much as possible. Its better in the long run. If that doesn't work then its like Beethoven says.. The function is broken, but I highly doubt so because I use it very frequently and have found that it works just fine.
I have it set to move it for player to playergroup 1 but it still moves it for all players. :(
IE Convert player to playergroup player 1. I even tried debugging it listing who was in that player group, just me but when other people cause a dialog item to move it moves mine and vice verse.
Player = (Player group(Player)) <Player Group>
(Trait)RefreshIndexOptions:Action,CreateThreadReturnType:(None)ParametersPlayer=0<Integer>Index=0<Integer>GrammarText:(Trait)RefreshIndex(Player,Index)HintText:(None)CustomScriptCodeLocalVariablesPlayer=(Playergroup(Player))<PlayerGroup>Class=((Trait)ClassDisplayed(Player))<Integer>Positions=((Trait)GetButtonPositions(Class))<String>ButtonCount=(Integer((Word1ofPositions)))<Integer>ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If-------Isthebuttonsupposedtobeshownforthistraittree?Index<=ButtonCountThenDialog-Show(Trait)Buttons[Index].Button for Player
Dialog - Show (Trait) Buttons[Index].Image for Player
Dialog - Set (Trait) Buttons[Index].Button tooltip to ((Trait) Build Button Tooltip(Player, Index)) for Player
Dialog - Set (Trait) Buttons[Index].Image image to (Trait Image: (((Trait) Player Trait Index to Trait ID(Player, Index)))) for Player
General - If (Conditions) then do (Actions) else do (Actions)
If
Index != 0
Then
Dialog - Set (Trait) Buttons[Index].Rank Display text to (Combine ("<sval="ModRightSize12">", (Text(((Trait) Get Info(Player, Index, Current)))), "/", (Text(((Trait) Get Info(Player, Index, Max)))), " (", (Text(((Trait) Get Info(Player, Index, Cost Per Rank)))), ")")) for (All players)
Else
Dialog - Set (Trait) Buttons[Index].Rank Display text to "" for (All players)
Dialog - Move (Trait) Buttons[Index].Button to ((Real((50 * (Integer((Word ((Index * 2) + 2) of Positions)))))), (Real((-50 * (Integer((Word ((Index * 2) + 3) of Positions))))))) in grid relative to Bottom Left of (Trait) Page.Frame for Player (from Bottom Left)
Else
------- Hide the button if it shouldnt be shown.
Dialog - Hide (Trait) Buttons[Index].Button for Player
Dialog - Disable (Trait) Buttons[Index].Button for Player
Dialog - Set (Trait) Buttons[Index].Image image to Blank for Player
Dialog - Move (Trait) Buttons[Index].Button to (0, 0) relative to Top Left of dialog for Player
Dialog - Set (Trait) Buttons[Index].Rank Display text to "" for (All players)
General - If (Conditions) then do (Actions) else do (Actions)
If
------- Should this one be enabled?
------- Is the person high enough level.
((Trait) Level Req(Class, Index)) <= Player Data[Player].(Player) Level
((Trait) Check Final Tier Index(Player, Index, Button Active?)) == true
Then
Dialog - Enable (Trait) Buttons[Index].Button for Player
Dialog - Enable (Trait) Buttons[Index].Image for Player
Else
Dialog - Disable (Trait) Buttons[Index].Button for Player
Dialog - Disable (Trait) Buttons[Index].Image for Player
Do you have any events attached to this trigger?
If not, what are the conditions for this function to be called? The only logical explanation to why its moving for everything that I can think of is that whatever line of code that is calling this function is calling and iterating for all players. So its actually moving one by one. The one way to find out is if you have a print statement that prints whenever this function is called. if you find that it is printing multiple lines when it should be printing only one, then you should roughly be able to narrow down the source of your problem.
I'm still skimming through the code, but i dont see anything wrong.
The one way to find out is if you have a print statement that prints whenever this function is called. if you find that it is printing multiple lines when it should be printing only one, then you should roughly be able to narrow down the source of your problem.
I do this with the function calling it.
One final thing is this also happens with my floating item image.
Wait.. Just to be clear, are you trying to move a dialog or dialog item? Because im recalling that whenever you move a dialog, its going to move for everyone. Dialog items (controls) can be moved on a player by player basis. Dialogs, cannot.
It is a dialog item the dialog itself is a full screen hidden dialog since I know I cant move it on a player dependent basis.
The only possible thing I can think of is that I'm using move dialog item in grid relative to. In order to get the image to pop up over another image without having to determine its on screen position.
Need some help here... Could you please tell me what exactly this function is supposed to do? I can't seem to find this item in the API. So I've no idea how its supposed to work. But I suspect its this function that's screwing up the movement.
I'm guessing it moves a dialog item relative to another dialog item.
Also, what are each of the parameters? Specifically these ones:
gv_p_sls.lv_b
gv_b_sls[lp_i].lv_b
It would be great if you could post a screenshot of these as well.
Edit: With reference to post 9, I suppose there is one way to check if the function is screwy.
Try to use the standard dialog item move function instead and see if you still get the same problem.
It's not the best way since you need to determine on screen position, but if it narrows down the problem it would probably help.
This is for picking up an item in the inventory which moves a floating button over the inventory spot.
gv_p_sls.lv_b is the actual pickup dialog item that shows the item now hovering (i plan someday to make it follow the cursor)
gv_b_sls[lp_i].lv_b is the items icon in the bag dialog item.
When you pick up an item it moves the dialog item for the pickup over the inventory slot and changes it to look like the item while the in bag one grays out. When another player picks up an item your hovering item moves to the same spot as theirs. I cant show this because i dont have the guy i usually use to test this out with online.
So to get the problem more clearly defined.. When you click the item in the inventory, that floating button is appearing for all players instead of just you?
Forgive me if this is a bit of a pointless post.. Just wanna make sure I'm understanding the problem..
I'd like to take a look at the trigger that is used to pick up the item. If you posted it above, which one is it? >_>
I'm specifically referring to the one that when you click the inventory, and it responds by moving the hovering image. I'll take a closer look at it and see if I can spot anything..
edit: It really does seem like this is a problem with the move dialog item in grid relative function. I have been over it time and again and It should only pass it to the player in question, theres no way it could be doing the trigger multiple times.
Heres the click dialog button main trigger.
Script:
[Input] Click Dialog Button
Events
Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Local Variables
Index = 0 <Integer>
Dialog = (Dialog containing (Used dialog item)) <Dialog>
Player = (Triggering player) <Integer>
Conditions
Actions
General - If (Conditions) then do (Actions)
If
Or
Conditions
(Used dialog item) == (Death) Menu Dialog Item[1]
(Used dialog item) == (Death) Menu Dialog Item[2]
Then
-DST- Action: - (Death) Menu Select(Player)
General - Skip remaining actions
General - If (Conditions) then do (Actions)
If
Or
Conditions
Dialog == (Action Bars) Bar[0].Screen
Dialog == (Action Bars) Bar[1].Screen
Dialog == (Action Bars) Bar[2].Screen
Dialog == (Action Bars) Bar[3].Screen
Then
General - While (Conditions) are true, do (Actions)
Conditions
Index < 48ActionsGeneral-If(Conditions)thendo(Actions)If(Useddialogitem)==(ActionBars)DisplaySlot[Index].ButtonThen-DST-Unfinished:-(ActionBars)ActivateButton(Player,Index)General-SkipremainingactionsVariable-ModifyIndex:+1General-If(Conditions)thendo(Actions)IfDialog ==(Trait)Page.ScreenThenGeneral-If(Conditions)thendomultiple(Actions)IfThenElseGeneral-Elseif(Conditions)thendo(Actions)ElseIf(Useddialogitem)==(Trait)Page.CloseButtonThenDialog-Hide(Trait)Page.Screenfor(Playergroup(Player))General-SkipremainingactionsGeneral-Elseif(Conditions)thendo(Actions)ElseIfOrConditions(Useddialogitem)==(Trait)ClassTreeButtons[0].Button(Useddialogitem)==(Trait)ClassTreeButtons[1].Button(Useddialogitem)==(Trait)ClassTreeButtons[2].ButtonThen-DST-Action:-(Trait)ClickTierButton(Player,(Useddialogitem))General-Skipremainingactions-DST-Action:-(Trait)ClickButton(Player,(Useddialogitem))General-If(Conditions)thendo(Actions)IfOrConditionsDialog ==BagWin[0].ScreenDialog ==BagWin[1].ScreenDialog ==BagWin[2].ScreenDialog ==BagWin[3].ScreenDialog ==BagWin[4].ScreenDialog ==CraftWin.ScreenDialog ==StatusWin.ScreenDialog ==StorageWin.ScreenThen-DST-Action:-(Inventory)ClickButton(Player,Dialog)
which goes to the pickup option near the end in here:
U got gmail? Might be easier to contact through there. The trigger generated script has really shitty function names, so its very hard to tell what all the function calls do. I looked through the code you posted @ #13 but can't find any calls to:
void gf_in_pk (int lp_p, int lp_i) , The function from post 7.
I'm trying to trace the function flow to see how it leads to the dialog item movement thing.. but theres alot of missing pieces to the puzzle My suggestion is press ctrl+f11, save the script and mail me the file.. I'll skim through it and see if i can figure anything out..
Well, I have a ventrilo server if you have it.
edit: wow its really late ill be back tomorrow after work ><
This is how it works basically, I removed the parts that dont matter.
[Input] Click Dialog Button
Events
Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Local Variables
Index = 0 <Integer>
Dialog = (Dialog containing (Used dialog item)) <Dialog>
Player = (Triggering player) <Integer>
Conditions
Actions
General - If (Conditions) then do (Actions)
If
Or
Conditions
Dialog == Bag Win[0].Screen
Dialog == Bag Win[1].Screen
Dialog == Bag Win[2].Screen
Dialog == Bag Win[3].Screen
Dialog == Bag Win[4].Screen
Dialog == Craft Win.Screen
Dialog == Status Win.Screen
Dialog == Storage Win.Screen
Then
-DST- Action: - (Inventory) Click Button(Player, Dialog)
(Inventory)ClickButtonOptions:Action,CreateThreadReturnType:(None)ParametersPlayer=0<Integer>Dialog=NoDialog<Dialog>GrammarText:(Inventory)ClickButton(Player,Dialog)HintText:(None)CustomScriptCodeLocalVariablesDialog=Dialog<Dialog>c=0<Integer>Player=Player<Integer>TempButton=0<Integer>TempWin<(Item)WindowLabel>UsedButton=999<Integer>UsedWin<(Item)WindowLabel>ActionsGeneral-If(Conditions)thendomultiple(Actions)IfThenElseGeneral-Elseif(Conditions)thendo(Actions)ElseIf-------PerformPickupifnothingispickedupPickItem[Player].Pickup Active == false
Used Button != 999
Then
-DST- Action: - (Inventory) Pickup(Player, Used Button)
Could I please take a look a the script for the Click button function?
I do strongly suspect its the DialogControlMoveGrid... Function.. is there any chance you could try and use DialogControlSetPosition instead and see if that works?.. If it doesn't then there must be something thats causing the trigger to prematurely trigger..
Thanks for verifying that. :/ Thats kinda retarded isn't it.
Edit: Pointing to your post below, and because I want to keep my post count at 4o4 for now :P
I strongly advise against having 1 dialog item for each player. if you're having 14 players, thats ALOT of duplicates. It might seem fine, but in the long run, there might be too many variables, which may affect game performance (as these variables would be stored in memory) But then again, this is just in theory..
Yes, because the way it functions is exactly what I needed. Now I have to figure something else out ><.
Edit: I'll have to use multiple dialog items for each player. My inventories use move relative because it keeps all the dialog items connected so if i move the main "frame" dialog item the rest of them move with it. I would have to redo my entire inventory system to not do that same with trait window system.
Screw that, until blizz fixes the problem I'll generate a dialog item for each player.
edit2: At least I only have to create 10 pickup item dialogs because the rest of it works fine. I just have to figure out how to redo my trait window now. I guess I can make a set of buttons for each configuration that the tree can be displayed in and just use the tree that fits. Right now I have it reorganize all visible buttons which tbh is probably not the best way.
TL;DR : Sorry for the repetition and if the problem is already solved.
My suggestion is a little inefficient, but it would definitely work.
Step 1: Create a Dialog for EACH player. Use an Array to set them up as different variables.
Step 2: Create a Dialog Item of your choice in those dialogs.
Step 3: Hide all dialogs for ALL players except the one it's designed for.
Yes, it will be a long trigger...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I have hit a snag, it would seem that if you move a dialog item for a player it moves that dialog item for all players. Anyone know of a way around this or do my mobile dialogs that move differently for each player have to be made as separate dialog items for each player?
If the move dialog item action doesnt work properly i think there is no other way. But it is really not much work. Just change the variable of the item to an array. Instead of creating one item you use "for each integer" and hide the items for everyone but the one player.
@Sneakervek: Go
The function for moving dialog items should have a parameter "playergroup". You just need to make sure that you set this playergroup properly. Say I wanted to move the dialog item for only player 1, it would probably be PlayerGroupSingle(1).
There is no need to create 1 dialog item for each player. Recycle them as much as possible. Its better in the long run. If that doesn't work then its like Beethoven says.. The function is broken, but I highly doubt so because I use it very frequently and have found that it works just fine.
@FuzzYD: Go
I have it set to move it for player to playergroup 1 but it still moves it for all players. :(
IE Convert player to playergroup player 1. I even tried debugging it listing who was in that player group, just me but when other people cause a dialog item to move it moves mine and vice verse.
Player = (Player group(Player)) <Player Group>
Here it is in script.
Do you have any events attached to this trigger? If not, what are the conditions for this function to be called? The only logical explanation to why its moving for everything that I can think of is that whatever line of code that is calling this function is calling and iterating for all players. So its actually moving one by one. The one way to find out is if you have a print statement that prints whenever this function is called. if you find that it is printing multiple lines when it should be printing only one, then you should roughly be able to narrow down the source of your problem.
I'm still skimming through the code, but i dont see anything wrong.
This is the line that moves the dialog, but it appears to be only moving for the PlayerGroupSingle named lv_p.
@FuzzYD: Go
Thats actually the default for an icon not being shown which hides it and moves it off screen.
is the player group of the player input
Thats the line that moves the dialog based on the position for the class. And as GUI
I do this with the function calling it.
One final thing is this also happens with my floating item image.
I have done all sorts of debug messaging telling me whose in the playegroup and when it fires and i cant get anything from it.
@Sneakervek: Go
Wait.. Just to be clear, are you trying to move a dialog or dialog item? Because im recalling that whenever you move a dialog, its going to move for everyone. Dialog items (controls) can be moved on a player by player basis. Dialogs, cannot.
@FuzzYD: Go
It is a dialog item the dialog itself is a full screen hidden dialog since I know I cant move it on a player dependent basis.
The only possible thing I can think of is that I'm using move dialog item in grid relative to. In order to get the image to pop up over another image without having to determine its on screen position.
@Sneakervek: Go
Need some help here... Could you please tell me what exactly this function is supposed to do? I can't seem to find this item in the API. So I've no idea how its supposed to work. But I suspect its this function that's screwing up the movement.
libCamp_gf_MoveDialogItemInGridRelative(gv_p_sls.lv_b, lv_p, c_anchorLeft, gv_b_sls[lp_i].lv_b, c_anchorCenter, 0.0, 0.0);
I'm guessing it moves a dialog item relative to another dialog item.
Also, what are each of the parameters? Specifically these ones:
It would be great if you could post a screenshot of these as well.
Edit: With reference to post 9, I suppose there is one way to check if the function is screwy. Try to use the standard dialog item move function instead and see if you still get the same problem. It's not the best way since you need to determine on screen position, but if it narrows down the problem it would probably help.@FuzzYD: Go
The main Window is the trait window, each button is moved for the player in relation to the from which is itself a dialog item in a fullscreen dialog.
libCamp_gf_MoveDialogItemInGridRelative(gv_p_sls.lv_b, lv_p, c_anchorLeft, gv_b_sls[lp_i].lv_b, c_anchorCenter, 0.0, 0.0);
This is for picking up an item in the inventory which moves a floating button over the inventory spot.
gv_p_sls.lv_b is the actual pickup dialog item that shows the item now hovering (i plan someday to make it follow the cursor)
gv_b_sls[lp_i].lv_b is the items icon in the bag dialog item.
When you pick up an item it moves the dialog item for the pickup over the inventory slot and changes it to look like the item while the in bag one grays out. When another player picks up an item your hovering item moves to the same spot as theirs. I cant show this because i dont have the guy i usually use to test this out with online.
So to get the problem more clearly defined.. When you click the item in the inventory, that floating button is appearing for all players instead of just you?Forgive me if this is a bit of a pointless post.. Just wanna make sure I'm understanding the problem..I'd like to take a look at the trigger that is used to pick up the item. If you posted it above, which one is it? >_>
I'm specifically referring to the one that when you click the inventory, and it responds by moving the hovering image. I'll take a closer look at it and see if I can spot anything..
@FuzzYD: Go
Post #7 has the actual pickup function.
edit: It really does seem like this is a problem with the move dialog item in grid relative function. I have been over it time and again and It should only pass it to the player in question, theres no way it could be doing the trigger multiple times.
Heres the click dialog button main trigger. Script:
GUI:
which goes to the pickup option near the end in here:
U got gmail? Might be easier to contact through there. The trigger generated script has really shitty function names, so its very hard to tell what all the function calls do. I looked through the code you posted @ #13 but can't find any calls to:
void gf_in_pk (int lp_p, int lp_i) , The function from post 7.
I'm trying to trace the function flow to see how it leads to the dialog item movement thing.. but theres alot of missing pieces to the puzzle My suggestion is press ctrl+f11, save the script and mail me the file.. I'll skim through it and see if i can figure anything out..
@FuzzYD: Go
Well, I have a ventrilo server if you have it. edit: wow its really late ill be back tomorrow after work ><
This is how it works basically, I removed the parts that dont matter.
Ah, its clearer how they're all linked now.
Could I please take a look a the script for the Click button function?
I do strongly suspect its the DialogControlMoveGrid... Function.. is there any chance you could try and use DialogControlSetPosition instead and see if that works?.. If it doesn't then there must be something thats causing the trigger to prematurely trigger..
@FuzzYD: Go
It is in fact move dialog item in grid/relative. I had similar issues, until I reverted to just move dialog item.
@deathtorn: Go
Thanks for verifying that. :/ Thats kinda retarded isn't it.
Edit: Pointing to your post below, and because I want to keep my post count at 4o4 for now :P
I strongly advise against having 1 dialog item for each player. if you're having 14 players, thats ALOT of duplicates. It might seem fine, but in the long run, there might be too many variables, which may affect game performance (as these variables would be stored in memory) But then again, this is just in theory..
@FuzzYD: Go
Yes, because the way it functions is exactly what I needed. Now I have to figure something else out ><.
Edit: I'll have to use multiple dialog items for each player. My inventories use move relative because it keeps all the dialog items connected so if i move the main "frame" dialog item the rest of them move with it. I would have to redo my entire inventory system to not do that same with trait window system.
Screw that, until blizz fixes the problem I'll generate a dialog item for each player.
edit2: At least I only have to create 10 pickup item dialogs because the rest of it works fine. I just have to figure out how to redo my trait window now. I guess I can make a set of buttons for each configuration that the tree can be displayed in and just use the tree that fits. Right now I have it reorganize all visible buttons which tbh is probably not the best way.
@Sneakervek: Go
TL;DR : Sorry for the repetition and if the problem is already solved.
My suggestion is a little inefficient, but it would definitely work.
Step 1: Create a Dialog for EACH player. Use an Array to set them up as different variables. Step 2: Create a Dialog Item of your choice in those dialogs. Step 3: Hide all dialogs for ALL players except the one it's designed for.
Yes, it will be a long trigger...