• 🏆 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!

GUI triggers desync problem

Status
Not open for further replies.
Level 2
Joined
Oct 25, 2012
Messages
15
I tried to fix this problem myself for about a week but did not found the solution. I read many forum posts about desync and i can answer ahead that in my case desync is not caused by GetLocalPlayer() function. Yes there is present trigger with using of it, but i tested it many times and it is working properly. I identified a group of triggers that cause desync by disabling them and all of them in "UNDEAD COMMANDERS" directory. Since a week of testing and changing them i almost gave up. i only hope you can help me with it.
Desync happen always in random time and random count of players desyncs. They only have one thing in common they happen when "zombie" interacts with other units.

  • UNDEAD REVIVE
    • Events
      • Game - The in-game time of day becomes Equal to 17.55
    • Conditions
    • Actions
      • For each (Integer NS_HR_INDEX[2]) from 2 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[2]] Equal to False
              • NS_PLAYER_IS_OBSERVER[NS_HR_INDEX[2]] Equal to False
            • Then - Actions
              • Set NS_UNIT_GROUP_INSTANT_TEMP = (Units owned by (Player(NS_HR_INDEX[2])) matching (((Unit-type of (Matching unit)) Equal to Castle) and (((Matching unit) is alive) Equal to True)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in NS_UNIT_GROUP_INSTANT_TEMP) Equal to 0
                  • ((Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES) is alive) Equal to False
                • Then - Actions
                  • Custom script: call DestroyGroup(udg_NS_UNIT_GROUP_INSTANT_TEMP)
                  • Set NS_POINT_INSTANT_TEMP[0] = (Point((Load 81 of NS_HR_INDEX[2] from NS_HASH_TABLE_HEROES), (Load 91 of NS_HR_INDEX[2] from NS_HASH_TABLE_HEROES)))
                  • Unit - Remove (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES) from the game
                  • Unit - Create 1 Undead commander for (Player(NS_HR_INDEX[2])) at NS_POINT_INSTANT_TEMP[0] facing (Load 121 of NS_HR_INDEX[2] from NS_HASH_TABLE_HEROES) degrees
                  • Hashtable - Save Handle Of(Last created unit) as 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES
                  • Custom script: call RemoveLocation(udg_NS_POINT_INSTANT_TEMP[0])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • NS_PLAYER_HAS_DARK_GIFT[NS_HR_INDEX[2]] Equal to True
                      • (Level of FRIENDSHIP (BLACK SHADOW) for (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add FRIENDSHIP (BLACK SHADOW) to (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES)
                      • Unit - Add EVIL REGENERATION (2 HP) to (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                  • Unit - Make (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES) Invulnerable
                  • Unit - Hide (Load 21 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES)
                  • Hero - Set (Load 1 of NS_HR_INDEX[2] in NS_HASH_TABLE_HEROES) experience to (((Load 31 of NS_HR_INDEX[2] from NS_HASH_TABLE_HEROES) + 1000) x 2), Hide level-up graphics
                  • Set NS_PLAYER_NIGHT_VISION[NS_HR_INDEX[2]] = True
                  • Set NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[2]] = True
                  • For each (Integer NS_HR_INDEX[3]) from 2 to 12, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[2]] Equal to True
                          • NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[3]] Equal to True
                          • ((Player(NS_HR_INDEX[2])) is an enemy of Player 1 (Red)) Equal to True
                          • ((Player(NS_HR_INDEX[3])) is an enemy of Player 1 (Red)) Equal to True
                        • Then - Actions
                          • Player - Make (Player(NS_HR_INDEX[2])) treat (Player(NS_HR_INDEX[3])) as an Ally with shared vision
                          • Player - Make (Player(NS_HR_INDEX[3])) treat (Player(NS_HR_INDEX[2])) as an Ally with shared vision
                        • Else - Actions
                          • Player - Make (Player(NS_HR_INDEX[2])) treat (Player(NS_HR_INDEX[3])) as an Enemy
                          • Player - Make (Player(NS_HR_INDEX[3])) treat (Player(NS_HR_INDEX[2])) as an Enemy
                • Else - Actions
                  • Custom script: call DestroyGroup(udg_NS_UNIT_GROUP_INSTANT_TEMP)
            • Else - Actions
      • For each (Integer NS_HR_INDEX[1]) from 2 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[1]] Equal to True
              • (Unit-type of (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)) Equal to Undead commander
              • ((Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES) is alive) Equal to False
              • NS_PLAYER_IS_OBSERVER[NS_HR_INDEX[1]] Equal to False
            • Then - Actions
              • Set NS_POINT_INSTANT_TEMP[0] = (Point((Load 81 of NS_HR_INDEX[1] from NS_HASH_TABLE_HEROES), (Load 91 of NS_HR_INDEX[1] from NS_HASH_TABLE_HEROES)))
              • Hero - Instantly revive (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES) at NS_POINT_INSTANT_TEMP[0], Hide revival graphics
              • Custom script: call RemoveLocation(udg_NS_POINT_INSTANT_TEMP[0])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NS_PLAYER_HAS_DARK_GIFT[NS_HR_INDEX[1]] Equal to True
                  • (Level of FRIENDSHIP (BLACK SHADOW) for (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)) Equal to 0
                • Then - Actions
                  • Unit - Add FRIENDSHIP (BLACK SHADOW) to (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)
                  • Unit - Add EVIL REGENERATION (2 HP) to (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)
                • Else - Actions
              • Unit - Make (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES) Invulnerable
              • Unit - Hide (Load 131 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)
            • Else - Actions
      • Countdown Timer - Start NS_TIMER_VULNERABILITY as a One-shot timer that will expire in 7.00 seconds
  • UNDEAD VILNERABILITY
    • Events
      • Time - NS_TIMER_VULNERABILITY expires
    • Conditions
    • Actions
      • For each (Integer NS_HR_INDEX[1]) from 2 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NS_PLAYER_IS_UNDEAD[NS_HR_INDEX[1]] Equal to True
              • (Unit-type of (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES)) Equal to Undead commander
            • Then - Actions
              • Unit - Make (Load 1 of NS_HR_INDEX[1] in NS_HASH_TABLE_HEROES) Vulnerable
            • Else - Actions
  • UNDEAD DIES
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Undead commander
      • NS_PLAYER_IS_UNDEAD[(Player number of (Owner of (Dying unit)))] Equal to True
    • Actions
      • Hashtable - Save (Facing of (Dying unit)) as 121 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES
      • Set NS_POINT_INSTANT_TEMP[0] = (Position of (Dying unit))
      • Hashtable - Save (X of NS_POINT_INSTANT_TEMP[0]) as 81 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES
      • Hashtable - Save (Y of NS_POINT_INSTANT_TEMP[0]) as 91 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES
      • Unit - Move (Load 131 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES) instantly to NS_POINT_INSTANT_TEMP[0], facing (Facing of (Dying unit)) degrees
      • Animation - Play (Load 131 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES)'s death animation
      • Unit - Unhide (Load 131 of (Player number of (Owner of (Dying unit))) in NS_HASH_TABLE_HEROES)
      • Custom script: call RemoveLocation(udg_NS_POINT_INSTANT_TEMP[0])
  • ADAPT ATTACK 4
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Undead commander
    • Actions
      • Hashtable - Save (0.08 + (Load 41 of (Player number of (Owner of (Attacking unit))) from NS_HASH_TABLE_HEROES)) as 41 of (Player number of (Owner of (Attacking unit))) in NS_HASH_TABLE_HEROES
  • ADAPT ARMOR 5
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Undead commander
    • Actions
      • Hashtable - Save (0.05 + (Load 51 of (Player number of (Owner of (Attacked unit))) from NS_HASH_TABLE_HEROES)) as 51 of (Player number of (Owner of (Attacked unit))) in NS_HASH_TABLE_HEROES
  • ADAPT RESISTANCE 6
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Target unit of ability being cast)) Equal to Undead commander
    • Actions
      • Hashtable - Save (1.00 + (Load 61 of (Player number of (Owner of (Target unit of ability being cast))) from NS_HASH_TABLE_HEROES)) as 61 of (Player number of (Owner of (Target unit of ability being cast))) in NS_HASH_TABLE_HEROES
  • ADAPT SPEED 7
    • Events
      • Time - Every 0.61 seconds of game time
    • Conditions
    • Actions
      • For each (Integer NS_HR_INDEX[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES)) Equal to Undead commander
              • ((Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES) is alive) Equal to True
            • Then - Actions
              • Hashtable - Save (Load 81 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) as 101 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES
              • Hashtable - Save (Load 91 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) as 111 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES
              • Set NS_POINT_INSTANT_TEMP[0] = (Position of (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain pathing at NS_POINT_INSTANT_TEMP[0] of type Walkability is off) Equal to True
                      • ((Load 71 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) / 2300.00) Greater than or equal to 70.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Jump (|cffffcc00J|r) (ZOMBIE) for (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add Jump (|cffffcc00J|r) (ZOMBIE) to (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                      • Unit - Set level of Jump (|cffffcc00J|r) (ZOMBIE) for (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer(((((Load 71 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) / 2300.00) - 70.00) x 0.20))), 1)), 20))
                • Else - Actions
              • Hashtable - Save (X of NS_POINT_INSTANT_TEMP[0]) as 81 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES
              • Hashtable - Save (Y of NS_POINT_INSTANT_TEMP[0]) as 91 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES
              • Custom script: call RemoveLocation(udg_NS_POINT_INSTANT_TEMP[0])
              • Hashtable - Save ((Square root(((Power(((Load 81 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) - (Load 101 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES)), 2.00)) + (Power(((Load 91 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) - (Load 111 of NS_HR_INDEX[0] from NS_HASH_TABLE_HER as 71 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Load 71 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) / 2300.00) Greater than or equal to 1.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Speed (ZOMBIE) for (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add Speed (ZOMBIE) to (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                      • Unit - Set level of Speed (ZOMBIE) for (Load 1 of NS_HR_INDEX[0] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer(((Load 71 of NS_HR_INDEX[0] from NS_HASH_TABLE_HEROES) / 2300.00))), 1)), 100))
                • Else - Actions
            • Else - Actions
  • ADAPT ATTACK N ARMOR 456
    • Events
      • Time - Every 3.29 seconds of game time
    • Conditions
    • Actions
      • For each (Integer NS_HR_INDEX[7]) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)) Equal to Undead commander
              • ((Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) is alive) Equal to True
            • Then - Actions
              • Player - Set the current research level of Adapt attack strength to (Min((Max((Integer((Load 41 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 0)), 100)) for (Player(NS_HR_INDEX[7]))
              • Player - Set the current research level of Adapt armor defence to (Min((Max((Integer((Load 51 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 0)), 100)) for (Player(NS_HR_INDEX[7]))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 41 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) Greater than or equal to 50.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Claws (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add Claws (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                      • Unit - Add Insane power (|cffffcc00I|r) (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                      • Unit - Set level of Insane power (|cffffcc00I|r) (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((((Load 41 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) - 50.00) x 0.20))), 1)), 25))
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 51 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) Greater than or equal to 50.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Spiked armor (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add Spiked armor (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                      • Unit - Set level of Spiked armor (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((((Load 51 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) - 50.00) x 0.50))), 1)), 35))
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) Greater than or equal to 1.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Magic protection (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)) Equal to 0
                    • Then - Actions
                      • Unit - Add Regeneration (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                      • Unit - Add Magic protection (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                      • Unit - Add Health (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                      • Unit - Add Magic protection (DESCRIPTION) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                    • Else - Actions
                      • Unit - Set level of Regeneration (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 1)), 45))
                      • Unit - Set level of Magic protection (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 1)), 45))
                      • Unit - Set level of Health (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 1)), 45))
                      • Unit - Set level of Magic protection (DESCRIPTION) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES))), 1)), 45))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) Greater than or equal to 30.00
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Block magic (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)) Equal to 0
                            • Then - Actions
                              • Unit - Add Block magic (ZOMBIE) to (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES)
                            • Else - Actions
                              • Unit - Set level of Block magic (ZOMBIE) for (Load 1 of NS_HR_INDEX[7] in NS_HASH_TABLE_HEROES) to (Min((Max((Integer((((Load 61 of NS_HR_INDEX[7] from NS_HASH_TABLE_HEROES) - 20.00) x 0.20))), 1)), 5))
                        • Else - Actions
                • Else - Actions
            • Else - Actions
 

Attachments

  • devils_land_n527dd.w3x
    3.7 MB · Views: 22
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
Post your triggers here :\

To post them, click one of the triggers in WE and above "Events" where it states the trigger name right click the name and hit "Copy as Text" and when u paste them here in [trigger][/trigger] tags
 
Level 8
Joined
Aug 13, 2009
Messages
466
I can't see anything player specific in there (I'm not an expert).
All I can think of is it's actually some other trigger or you're loading a null value from a hash table
and using it and the game semi-crashes because of it.
 
Last edited:
Level 2
Joined
Oct 25, 2012
Messages
15
The game is not semi-crashes, since i disabled the autokick function in my ghost bot i exactly know that it is desync. Other players missunderstanding what desync is and therefore they think that they always win.
If i accidently load a null value, for real, integer, bool or string variable game is not crash. I cant say the same for handle variables because i did not tested.
 
Level 2
Joined
Oct 25, 2012
Messages
15
I fixed it myself. Problem was in weapon upgrade in adapt attack n armor trigger. When zombie gets too much weapon upgrades there were a very little chance that every attack will cause the desync. So i replaced it with ability.
 
Status
Not open for further replies.
Top