• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Desync & Code optimization

Status
Not open for further replies.
Level 5
Joined
Jan 23, 2020
Messages
86
Hi, I have a map that is getting more and more popular, and as a result I am getting more and more instances of desyncs being reported. I think I've narrowed it down to the Objects -> Custom Upgrades being a cause.

If anyone could check my map to see if there are any glaringly obvious desync causes or where I could optimize my code. I am not an experienced mapmaker so it's very possible there are a lot of instances.

Thank you!

City TD Solo v2.78c.w3x
 
Level 14
Joined
Feb 7, 2020
Messages
387
Few notes:

1) All non-variables except Triggering Unit will not be accurate after wait steps, and variables that get set by other triggers will also be inaccurate after wait steps. The way to accurately get around this is timers, but you can still use wait steps as long as you use Triggering Unit instead of things like Dying Unit. If another hero dies, for example, the 20 sec wait step will end and reference that most recently killed unit. It's also worth noting that most of the iterations of X Unit e.g. Dying Unit are simply slower variations of Triggering Unit in a sense. Triggers with anything that isn't (Triggering Unit) should be updated as such e.g.:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Dying unit)) Equal to Warden
    • Then - Actions
      • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Dying unit))) + |cffffff00Hero will revive in 20 seconds.|r |cffc0c0c0Type -clear to reset your hunter area.|r)
      • Wait 20.00 game-time seconds
      • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
    • Else - Actions
2) You have group, effect, and location memory leaks all over the place, learn more here: Memory Leaks

3) Even more of #1 e.g.:

  • cion enter
    • Events
      • Time - Elapsed game time is 1090.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnRED <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnBlue <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnTeal <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnPurple <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnYellow <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HunterOrange <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Golden Coin easy for Player 10 (Light Blue) at (Center of HspawnGreen <gen>) facing (Position of (Triggering unit))
        • Else - Actions
      • Sound - Play SecretFound <gen>
      • Game - Display to (All players) for 30.00 seconds the text: |cff00ff00Golden co...
      • Special Effect - Create a special effect attached to the overhead of (Last created unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
      • Special Effect - Set Time Scale of (Last created special effect) to 25.00
      • Floating Text - Create floating text that reads |cffffff00COIN SPAW... above (Random unit from (Units of type Golden Coin easy)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Wait 25.00 game-time seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Destroy (Last created special effect)
Above: Last Created X after a wait step is almost certainly going to reference the wrong thing given you have other triggers creating floating text periodically, for example. They should be stored as a variable and referenced after the wait step. Given what other code you have going on, this could inevitably lead to a desync if some funky combination of objects are referenced for players that don't exist, etc.
 
When opening the map I immediately stumbled upon this:
  • Player active red
    • Events
      • Map initialization
    • Conditions
      • (Player 1 (Red) slot status) Equal to Is unused
    • Actions
      • Set VariableSet Red_Active = False
Comparing player slots is known to desync. What I would recommend you do instead is this:
  • Player active
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PlayerActive[(Player number of (Picked player))] = True
Picking all players will only pick the players that were in the lobby when the game started.
 
Level 5
Joined
Jan 23, 2020
Messages
86
@Planetary thanks so much, I'm applying this throughout my map. Why do they include specific events if (triggering unit) works for any event?

@LazZ This seems to have made all players active regardless if they are in an empty players slot or not (creeps are now spawning for all lanes)
 
Last edited:
Player Group - Pick every player in (All players) and do (Actions)
-> Set VariableSet PlayerActive[(Player number of (Picked player))] = True

This seems to have made all players active regardless if they are in an empty players slot or not (creeps are now spawning for all lanes)
Weird. That's how I use it in my map to detect players.
 
Level 5
Joined
Jan 23, 2020
Messages
86
@LazZ Did you set "PlayerActive" as a boolean with an array?

These are the two triggers that define if a player is active/assign builder & food cap

upload_2020-5-4_0-37-6.png


upload_2020-5-4_0-37-28.png


but all lanes are still spawning regardless if a player is active or not. Spawn trigger:

upload_2020-5-4_0-46-33.png
 
Last edited:
Level 5
Joined
Oct 16, 2007
Messages
67
I usualy do it like this:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) controller) Equal to User
          • ((Picked player) slot status) Equal to Is playing
        • Then - Actions
        • Else - Actions
In Then Actions you can add what todo if the player is playing and no AI.


Edit: Sorry I didn't see that it causes as desyncs as it never has for me.


Edit 2: I did some research. It can only Desync in Map initialization, if you use it in like elapsed time is 0.00 or somwhere else it's fine. There are no other sources I found. Or is it a LUA Problem again?

Edit 3: Ok, I don't blieve it until someone has prove. The Melee Initialization Trigger, if you create a new Map, uses exactly what I did.
 
Last edited:
@LazZ Did you set "PlayerActive" as a boolean with an array?

These are the two triggers that define if a player is active, it's not working, what's wrong here?

Yeah I set it as an array because it's gonna be way more convenient for you to work with later on instead of having seperate variables that define player activity. The array number will represent the player number.
In your "Start up Red" trigger you use "matching player" in the condition before the actions. I don't think you should ever put a condition there for map init.
 
Level 5
Joined
Jan 23, 2020
Messages
86
@LazZ I got it to work in terms of creating a builder for the active player only. But all lanes are still spawning regardless if a player if active or not.

  • Player active red
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Set VariableSet Players_Active[(Player number of (Picked player))] = True
Spawning:
  • Spawning
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Red_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnRED <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Green_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnGreen <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Orange_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnOrange <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Yellow_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnYellow <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Purple_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnPurp <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Teal_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnTEAL <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Blue_Active Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnBLUE <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 
Last edited:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet ActivePlayers[(Player number of (Picked player))] = True
If you have 4 player slots and player 1, 2, and 4 is in the game, this trigger will set the variables like this (it works in my map):
  • ActivePlayers[1] = true
  • ActivePlayers[2] = true
  • ActivePlayers[3] = false
  • ActivePlayers[4] = true
Inkedupload_2020-5-4_0-37-28_LI.jpg

This matching player thing is not pointing to any player, so it will always return false and not run the actions.

Inkedupload_2020-5-4_0-46-33_LI.jpg

Also I just noticed, this is not pointing to any unit because there's no unit triggering the event.
 
Level 5
Joined
Jan 23, 2020
Messages
86
@lazz
I fixed the condition on "Start up Red" and it works now. But as for the spawning condition "Red_Active" = True, that does not exist anymore, so how do I trigger the unit create / spawn action?
 
Level 5
Joined
Jan 23, 2020
Messages
86
@LazZ I have changed it to the above but all regions still create units for all players:

  • Spawning
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[1] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnRED <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[2] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnGreen <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[3] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnOrange <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[4] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnYellow <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[5] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnPurp <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[6] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnTEAL <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_Active[6] Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Center of SpawnBLUE <gen>)
          • Unit - Create 1 monstertype for Player 12 (Brown) at TempPoint facing (Position of (Triggering unit))
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
 
Level 5
Joined
Jan 23, 2020
Messages
86
@LazZ I have a question about floating text:

I have a trigger that gives a player 2 lumber every 5 seconds. and I want floating text for the amount above the unit when it triggers.

Triggers I have so far, that are not working correctly:

  • M F gold Copy
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • If (Red_Active Equal to True) then do (Player - Add timesoul[1] to Player 1 (Red).Current lumber) else do (Do nothing)
      • If (Blue_Active Equal to True) then do (Player - Add timesoul[2] to Player 2 (Blue).Current lumber) else do (Do nothing)
      • If (Teal_Active Equal to True) then do (Player - Add timesoul[3] to Player 3 (Teal).Current lumber) else do (Do nothing)
      • If (Purple_Active Equal to True) then do (Player - Add timesoul[4] to Player 4 (Purple).Current lumber) else do (Do nothing)
      • If (Yellow_Active Equal to True) then do (Player - Add timesoul[5] to Player 5 (Yellow).Current lumber) else do (Do nothing)
      • If (Orange_Active Equal to True) then do (Player - Add timesoul[6] to Player 6 (Orange).Current lumber) else do (Do nothing)
      • If (Green_Active Equal to True) then do (Player - Add timesoul[7] to Player 7 (Green).Current lumber) else do (Do nothing)
  • S F upgrade to L1
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes an upgrade
      • Unit - A unit owned by Player 2 (Blue) Finishes an upgrade
      • Unit - A unit owned by Player 3 (Teal) Finishes an upgrade
      • Unit - A unit owned by Player 4 (Purple) Finishes an upgrade
      • Unit - A unit owned by Player 5 (Yellow) Finishes an upgrade
      • Unit - A unit owned by Player 6 (Orange) Finishes an upgrade
      • Unit - A unit owned by Player 7 (Green) Finishes an upgrade
      • Unit - A unit owned by Player 8 (Pink) Finishes an upgrade
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Soul Farm - |cffffff00Level 1 (lvl 1)
    • Actions
      • Set VariableSet timesoul[(Player number of (Triggering player))] = 2
      • Set VariableSet SoulVAR[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Trigger - Turn on SoulText L1 <gen>
  • SoulText L1
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads ((String(timesoul[(Player number of (Triggering player))])) + |cff8080ff Souls|r) above SoulVAR[(Player number of (Triggering player))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
What could I be doing wrong here?
 
Level 5
Joined
Jan 23, 2020
Messages
86
@LazZ I tried what you said. If I change "S F upgrade to L1" to owner of triggering unit, it no longer adds the lumber to the player. If its triggering player then it works.

But as for the soul text, it is currently displaying at the center of the map, and I cant wrap my head around how to display it above the triggering players unit.
 
Level 14
Joined
Feb 7, 2020
Messages
387
@Planetary thanks so much, I'm applying this throughout my map. Why do they include specific events if (triggering unit) works for any event?

@LazZ This seems to have made all players active regardless if they are in an empty players slot or not (creeps are now spawning for all lanes)
I'm not sure. Probably a legacy feature of the engine's first iteration due to the possibility of multiple events to a single trigger. Deep level architecture like that is hard to remove.
 
@LazZ strangely enough it works for Player Red, but all other players show the floating text at region - center of map.
It works for player red because it defaults to player 1 if it can't find the reference to the triggering player. If you want to display the floating text on every player's "SoulVAR" unit you need to put it in a loop like this and use picked player instead of triggering player (again, because there's no player triggering the event):

  • Melee Initialization
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads ((String(timesoul[(Player number of (Picked player))])) + |cff8080ff Souls|r) above SoulVAR[(Player number of (Picked player))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
 
Level 9
Joined
Mar 26, 2017
Messages
376
Comparing player slots is known to desync.

Interesting, I haven't seen mention of this in Desync topics on Hive.

I guess the 'Map Init' event will be the only situation where functions run for different players at completely different times. They run during Load screen and are not synced.

Would a player leaving during load screen immediately has his Slot Status updated for the purpose of Player Slot checks?

If this is the case it might explain a possibility of desync;
Imagine a player performing a Slot check on someone just before that person leaves, and another player just after. It would give two different results.

This would also mean that it shouldn't be a problem if a Slot check is done during map runtime.
 
Last edited:
Interesting, I haven't seen mention of this in Desync topics on Hive.

I guess the 'Map Init' event will be the only situation where functions run for different players at completely different times. They run during Load screen and are not synced.

Would a player leaving during load screen immediately has his Slot Status updated for the purpose of Player Slot checks?

If this is the case it might explain a possibility of desync;
Imagine a player performing a Slot check on someone just before that person leaves, and another player just after. It would give two different results.

This would also mean that it shouldn't be a problem if a Slot check is done during map runtime.
That's possible. I never thought about why it could desync. All I have is a list of things that are prone to desync if used incorrectly:

Code:
GetDestructableName
GetSoundDuration
GetSoundFileDuration
GetCameraBoundMinX
GetCameraBoundMinY
GetCameraBoundMaxX
GetCameraBoundMaxY
GetCameraField
GetCameraTargetPositionX
GetCameraTargetPositionY
GetCameraTargetPositionZ
GetCameraTargetPositionLoc
GetCameraEyePositionX
GetCameraEyePositionY
GetCameraEyePositionZ
GetCameraEyePositionLoc
GetObjectName
IsMultiboardMinimized
GetLocalPlayer
GetLocationZ
GetLocalizedString
GetLocalizedHotkey
GetUnitName
BlzGetLocalUnitZ
BlzGetUnitZ
GetItemName
BlzGetItemDescription
BlzGetItemTooltip
BlzGetItemExtendedTooltip
BlzGetLocalSpecialEffectX
BlzGetLocalSpecialEffectY
BlzGetLocalSpecialEffectZ
GetPlayerSlotState
 
Status
Not open for further replies.
Top