• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What m'I doing wrong? (GetLocalPlayer)

Status
Not open for further replies.
Level 11
Joined
Oct 9, 2015
Messages
721
So this is causing players to be disconected, can anyone tell me what did I did wrong ?

  • Menu Buttons
    • Events
      • Dialog - A dialog button is clicked for EscMenu
    • Conditions
      • (Clicked dialog button) Equal to EscMenuButtonsDF
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to EscMenuButtonsDF
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageFloaters[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Set DamageFloaters[(Player number of (Triggering player))] = False
            • Else - Actions
              • Set DamageFloaters[(Player number of (Triggering player))] = True
        • Else - Actions
      • Set PlayerVar = (Triggering player)
      • Dialog - Clear EscMenu
      • Dialog - Change the title of EscMenu to Options
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageFloaters[(Player number of (Triggering player))] Equal to True
        • Then - Actions
          • Dialog - Create a dialog button for EscMenu labelled Damage Floaters: ON
        • Else - Actions
          • Dialog - Create a dialog button for EscMenu labelled Damage Floaters: OF...
      • Set EscMenuButtonsDF = (Last created dialog Button)
      • Dialog - Create a dialog button for EscMenu labelled Exit
      • Custom script: if GetLocalPlayer()==udg_PlayerVar then
      • Dialog - Show EscMenu for PlayerVar
      • Custom script: endif
The trigger for showing the dialog isn't causing disconects, but dialog button clicks are. Here are the trigger for showing the dialog:
  • Creating Menu
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
    • Conditions
    • Actions
      • Set PlayerVar = (Triggering player)
      • Dialog - Clear EscMenu
      • Dialog - Change the title of EscMenu to Options
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DamageFloaters[(Player number of (Triggering player))] Equal to True
        • Then - Actions
          • Dialog - Create a dialog button for EscMenu labelled Damage Floaters: ON
        • Else - Actions
          • Dialog - Create a dialog button for EscMenu labelled Damage Floaters: OF...
      • Set EscMenuButtonsDF = (Last created dialog Button)
      • Dialog - Create a dialog button for EscMenu labelled Exit
      • Custom script: if GetLocalPlayer()==udg_PlayerVar then
      • Dialog - Show EscMenu for PlayerVar
      • Custom script: endif
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
It will "glitch" because you're clearing and manipulating a single dialogue.

You need to have separate Dialogues for each Menu you wish to have.

You do not need to use GetLocalPlayer for Dialogues as the built in function works, and likely trying to will result in issues.
 
Level 10
Joined
Oct 5, 2008
Messages
355
For your solution, i would refer to the answer p0ke brought up. The best solution would be to have different dialogues. Another Method would be to have a dialog for each player, so you only need to work with 2 dialog per player, whose values can be changed (like when you have options and you want to show on the button if an option is enabled or not, this could cause the sameglitches fi you would only take a single dialog for options, for example).

But i just want to think the reason why it desyncs. Most non-visual interactions with handles (mostly the ones which create/destroy them or otherwise differentiate the gamestate like moving or changing health values) will cause desyncs with GetLocalPlayer(). Dialogs and Buttons are handles either (or since a few patches ago agents, but these are still handle-types). It looks like that either the pressing of a button or the changes of the dialog that comes from the trigger are causing this probem, since i suppose the trigger fires also desynchronised, since the player wouldn't normally be able to interact with the dialog.
Has someone else encountered something like this before?
 
Status
Not open for further replies.
Top