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

[Trigger] Desync on start

Status
Not open for further replies.
Level 24
Joined
Nov 9, 2006
Messages
2,558
Hello, i'm currently working on a map called Warcraft Royale and i've got some problems with desyncs at the start of my game. I assume it has something to do with initial triggers causing some errors. So if anyone could look quickly over my triggers i would appreciate it. Typically players desync when there are 6 or more players = 1 desync, the more players the more desync.

Init, creates error on screen when casting on impossible positions
  • //TESH.scrollpos=0
  • //TESH.alwaysfold=0
  • function Sim_Error takes player ForPlayer, string msg returns nothing
    • local sound error = CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
    • if (GetLocalPlayer() == ForPlayer) then
      • if (msg!="") and (msg!=null) then
        • call ClearTextMessages()
        • call DisplayTimedTextToPlayer(ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
      • endif
      • call StartSound( error )
    • endif
    • call KillSoundWhenDone( error)
    • set error=null
  • endfunction
Bunch of variable presets
  • Variables 1 Random
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Random Hero --------
      • Set RandomHeroType[1] = Paladin
      • Set RandomHeroType[2] = Archmage
      • Set RandomHeroType[3] = Mountain King
      • Set RandomHeroType[4] = Blood Mage
      • Set RandomHeroType[5] = Blademaster
      • Set RandomHeroType[6] = Far Seer
      • Set RandomHeroType[7] = Tauren Chieftain
      • Set RandomHeroType[8] = Shadow Hunter
      • Set RandomHeroType[9] = Death Knight
      • Set RandomHeroType[10] = Lich
      • Set RandomHeroType[11] = Dreadlord
      • Set RandomHeroType[12] = Crypt Lord
      • Set RandomHeroType[13] = Keeper of the Grove
      • Set RandomHeroType[14] = Priestess of the Moon
      • Set RandomHeroType[15] = Demon Hunter
      • Set RandomHeroType[16] = Warden
      • Set RandomHeroType[17] = Alchemist
      • Set RandomHeroType[18] = Naga Sea Witch
      • Set RandomHeroType[19] = Tinker
      • Set RandomHeroType[20] = Beastmaster
      • Set RandomHeroType[21] = Dark Ranger
      • Set RandomHeroType[22] = Firelord
      • Set RandomHeroType[23] = Pandaren Brewmaster
      • Set RandomHeroType[24] = Pit Lord
      • Set RandomHeroType[25] = Ranger
      • Set RandomHeroType[26] = Ancient of Winter
      • Set RandomHeroType[27] = Ogre Battlemage
      • -------- Random Human --------
      • Set RandomHeroHuman[1] = Paladin
      • Set RandomHeroHuman[2] = Archmage
      • Set RandomHeroHuman[3] = Mountain King
      • Set RandomHeroHuman[4] = Blood Mage
      • Set RandomHeroHuman[5] = Ranger
      • -------- Random Orc --------
      • Set RandomHeroOrc[1] = Blademaster
      • Set RandomHeroOrc[2] = Far Seer
      • Set RandomHeroOrc[3] = Tauren Chieftain
      • Set RandomHeroOrc[4] = Shadow Hunter
      • Set RandomHeroOrc[5] = Ogre Battlemage
      • -------- Random Undead --------
      • Set RandomHeroUndead[1] = Death Knight
      • Set RandomHeroUndead[2] = Lich
      • Set RandomHeroUndead[3] = Dreadlord
      • Set RandomHeroUndead[4] = Crypt Lord
      • -------- Random Night Elf --------
      • Set RandomHeroNightElf[1] = Keeper of the Grove
      • Set RandomHeroNightElf[2] = Priestess of the Moon
      • Set RandomHeroNightElf[3] = Demon Hunter
      • Set RandomHeroNightElf[4] = Warden
      • Set RandomHeroNightElf[5] = Ancient of Winter
      • -------- Random Neutral --------
      • Set RandomHeroNeutral[1] = Alchemist
      • Set RandomHeroNeutral[2] = Naga Sea Witch
      • Set RandomHeroNeutral[3] = Tinker
      • Set RandomHeroNeutral[4] = Beastmaster
      • Set RandomHeroNeutral[5] = Dark Ranger
      • Set RandomHeroNeutral[6] = Firelord
      • Set RandomHeroNeutral[7] = Pandaren Brewmaster
      • Set RandomHeroNeutral[8] = Pit Lord
      • -------- Random Strength --------
      • Set RandomHeroStrength[1] = Paladin
      • Set RandomHeroStrength[2] = Mountain King
      • Set RandomHeroStrength[3] = Tauren Chieftain
      • Set RandomHeroStrength[4] = Death Knight
      • Set RandomHeroStrength[5] = Dreadlord
      • Set RandomHeroStrength[6] = Crypt Lord
      • Set RandomHeroStrength[7] = Alchemist
      • Set RandomHeroStrength[8] = Beastmaster
      • Set RandomHeroStrength[9] = Pandaren Brewmaster
      • Set RandomHeroStrength[10] = Pit Lord
      • Set RandomHeroStrength[11] = Ancient of Winter
      • -------- Random Agility --------
      • Set RandomHeroAgility[1] = Blademaster
      • Set RandomHeroAgility[2] = Shadow Hunter
      • Set RandomHeroAgility[3] = Priestess of the Moon
      • Set RandomHeroAgility[4] = Demon Hunter
      • Set RandomHeroAgility[5] = Warden
      • Set RandomHeroAgility[6] = Dark Ranger
      • Set RandomHeroAgility[7] = Firelord
      • Set RandomHeroAgility[8] = Ranger
      • -------- Random Intelligence --------
      • Set RandomHeroIntelligence[1] = Archmage
      • Set RandomHeroIntelligence[2] = Blood Mage
      • Set RandomHeroIntelligence[3] = Far Seer
      • Set RandomHeroIntelligence[4] = Lich
      • Set RandomHeroIntelligence[5] = Keeper of the Grove
      • Set RandomHeroIntelligence[6] = Naga Sea Witch
      • Set RandomHeroIntelligence[7] = Tinker
      • Set RandomHeroIntelligence[8] = Ogre Battlemage
      • -------- Random Melee --------
      • Set RandomHeroMelee[1] = Paladin
      • Set RandomHeroMelee[2] = Mountain King
      • Set RandomHeroMelee[3] = Blademaster
      • Set RandomHeroMelee[4] = Tauren Chieftain
      • Set RandomHeroMelee[5] = Death Knight
      • Set RandomHeroMelee[6] = Dreadlord
      • Set RandomHeroMelee[7] = Crypt Lord
      • Set RandomHeroMelee[8] = Demon Hunter
      • Set RandomHeroMelee[9] = Warden
      • Set RandomHeroMelee[10] = Alchemist
      • Set RandomHeroMelee[11] = Tinker
      • Set RandomHeroMelee[12] = Beastmaster
      • Set RandomHeroMelee[13] = Pandaren Brewmaster
      • Set RandomHeroMelee[14] = Pit Lord
      • Set RandomHeroMelee[15] = Ancient of Winter
      • -------- Random Ranged --------
      • Set RandomHeroRanged[1] = Archmage
      • Set RandomHeroRanged[2] = Blood Mage
      • Set RandomHeroRanged[3] = Far Seer
      • Set RandomHeroRanged[4] = Shadow Hunter
      • Set RandomHeroRanged[5] = Lich
      • Set RandomHeroRanged[6] = Keeper of the Grove
      • Set RandomHeroRanged[7] = Priestess of the Moon
      • Set RandomHeroRanged[8] = Naga Sea Witch
      • Set RandomHeroRanged[9] = Dark Ranger
      • Set RandomHeroRanged[10] = Firelord
      • Set RandomHeroRanged[11] = Ranger
      • Set RandomHeroRanged[12] = Ogre Battlemage
More variables
  • Variables 2 Color
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Color String --------
      • Set Playercolorsstring[0] = |cffffcc00
      • Set Playercolorsstring[1] = |c00ff0303
      • Set Playercolorsstring[2] = |c000042ff
      • Set Playercolorsstring[3] = |c001ce6b9
      • Set Playercolorsstring[4] = |c00540081
      • Set Playercolorsstring[5] = |c00fffc01
      • Set Playercolorsstring[6] = |c00feba0e
      • Set Playercolorsstring[7] = |c0020c000
      • Set Playercolorsstring[8] = |c00e55bb0
      • Set Playercolorsstring[9] = |cFF808080
      • Set Playercolorsstring[10] = |cFF8080FF
      • Set Playercolorsstring[11] = |cFF008080
      • Set Playercolorsstring[12] = |cFF804000
      • Set Playercolorsstring[13] = |cFF8B0000
      • Set Playercolorsstring[14] = |cFF4169E1
      • Set Playercolorsstring[15] = |cFF40E0D0
      • Set Playercolorsstring[16] = |cFF800080
      • Set Playercolorsstring[17] = |cFFF08080
      • Set Playercolorsstring[18] = |c004E2A04
      • Set Playercolorsstring[19] = |cFF9ACD32
      • Set Playercolorsstring[20] = |cFFDDA0DD
      • Set Playercolorsstring[21] = |cFF000000
      • Set Playercolorsstring[22] = |cFFFFFFFF
      • Set Playercolorsstring[22] = |cFFFFFFFF
      • Set Playercolorsstring[23] = |cFF7FFFD4
      • Set Playercolorsstring[24] = |cFFDEB887
      • -------- Color --------
      • Set PlayerColor[0] = Black
      • Set PlayerColor[1] = Red
      • Set PlayerColor[2] = Blue
      • Set PlayerColor[3] = Teal
      • Set PlayerColor[4] = Purple
      • Set PlayerColor[5] = Yellow
      • Set PlayerColor[6] = Orange
      • Set PlayerColor[7] = Green
      • Set PlayerColor[8] = Pink
      • Set PlayerColor[9] = Gray
      • Set PlayerColor[10] = Light Blue
      • Set PlayerColor[11] = Dark Green
      • Set PlayerColor[12] = Brown
      • Set PlayerColor[13] = Maroon
      • Set PlayerColor[14] = Navy
      • Set PlayerColor[15] = Turquoise
      • Set PlayerColor[16] = Violet
      • Set PlayerColor[17] = Wheat
      • Set PlayerColor[18] = Peach
      • Set PlayerColor[19] = Mint
      • Set PlayerColor[20] = Lavender
      • Set PlayerColor[21] = Coal
      • Set PlayerColor[22] = Snow
      • Set PlayerColor[23] = Emerald
      • Set PlayerColor[24] = Peanut
      • -------- Color String --------
      • Set ColorString[0] = Black
      • Set ColorString[1] = Red
      • Set ColorString[2] = Blue
      • Set ColorString[3] = Teal
      • Set ColorString[4] = Purple
      • Set ColorString[5] = Yellow
      • Set ColorString[6] = Orange
      • Set ColorString[7] = Green
      • Set ColorString[8] = Pink
      • Set ColorString[9] = Grat
      • Set ColorString[10] = Light Blue
      • Set ColorString[11] = Dark Green
      • Set ColorString[12] = Brown
      • Set ColorString[13] = Maroon
      • Set ColorString[14] = Navy
      • Set ColorString[15] = Turquoise
      • Set ColorString[16] = Violet
      • Set ColorString[17] = Wheat
      • Set ColorString[18] = Peach
      • Set ColorString[19] = Mint
      • Set ColorString[20] = Lavender
      • Set ColorString[21] = Coal
      • Set ColorString[22] = Snow
      • Set ColorString[23] = Emerald
      • Set ColorString[24] = Peanut
Even more variables
  • Variables 3 Circle
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Circle Variables --------
      • Set CircleRadius = 25000.00
      • Set CircleTimerColdown = 420.00
      • Set CircleMovementSpeedReduction = 10.00
      • Set CircleTimerColdownReduction = 60.00
      • Set CircleStaticDmg = 0.00
      • Set CircleStaticShrink = 25.00
      • Set CircleTimerMin = 60.00
      • Set CircleMaxReduction = 0
      • Set CircleMaxShrinkPercentage = 25
      • Set CircleIsShrinking = False
      • Set CircleNewPoint = (Center of (Playable map area))
      • Set CircleOldPoint = (Center of (Playable map area))
      • Set CircleCurrentRadius = CircleRadius
      • -------- Hint String --------
      • Set HintString[1] = Buy units from shops as first priority, so that killing creeps becomes easier. Use "|cffffcc00-ping unit shop|r" to find nearby shops.
      • Set HintString[2] = Your units will survive longer if you let the damage they take spread across evenly.
      • Set HintString[3] = If you click [|cffffcc00A|r]ttack with a unit on another friendly unit, creeps will change aggro to that target instead.
      • Set HintString[4] = If you're struggling with a type of resource drop, you can trade one type for another at the market place.
      • Set HintString[5] = As a temporary solution to food shortage, you can buy the "|cffffcc00tiny farm item|r" from item shops. The circle will destroy buildings though.
      • Set HintString[6] = With gold abundance and food shortage, your gold is better spent empowering your hero.
      • Set HintString[7] = Invest in spying units to find out who the enemy heroes are, what items they carry and what units they have.
      • Set HintString[8] = You can use large units and items such as "tiny farm or tower item" to lock in or zone out players.
      • Set HintString[9] = Dead players have full vision of the map. As a dead player don't give away positions. Show some courtesy!
      • Set HintString[10] = You should always bring some form of healing with you.
Last variables i swear
  • Variables 4 Drop Table
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- T1 = 3 Powerups --------
      • Set ItemTypePowerupTier1[1] = Tome of Strength +1
      • Set ItemTypePowerupTier1[2] = Tome of Agility +1
      • Set ItemTypePowerupTier1[3] = Tome of Intelligence +1
      • -------- T2 = 3 Powerups --------
      • Set ItemTypePowerupTier2[1] = Tome of Strength +2
      • Set ItemTypePowerupTier2[2] = Tome of Agility +2
      • Set ItemTypePowerupTier2[3] = Tome of Intelligence +2
      • -------- T3 = 3 Powerups --------
      • Set ItemTypePowerupTier3[1] = Tome of Strength +3
      • Set ItemTypePowerupTier3[2] = Tome of Agility +3
      • Set ItemTypePowerupTier3[3] = Tome of Intelligence +3
      • -------- T1 = 2 Resources --------
      • Set ItemTypeResourceBundleTier1[1] = Small Gold Stack
      • Set ItemTypeResourceBundleTier1[2] = Small Lumber Bundle
      • Set ItemTypeResourceBundleTier1[3] = Small Food Stack
      • -------- T2 = 2 Resources --------
      • Set ItemTypeResourceBundleTier2[1] = Medium Gold Stack
      • Set ItemTypeResourceBundleTier2[2] = Medium Lumber Bundle
      • Set ItemTypeResourceBundleTier2[3] = Medium Food Stack
      • -------- T3 = 2 Resources --------
      • Set ItemTypeResourceBundleTier3[1] = Large Gold Stack
      • Set ItemTypeResourceBundleTier3[2] = Large Lumber Bundle
      • Set ItemTypeResourceBundleTier3[3] = Large Food Stack
      • -------- T1 = 10 Items --------
      • Set ItemTypePermanentitemTier1[1] = Cloak of Shadows
      • Set ItemTypePermanentitemTier1[2] = Gauntlets of Ogre Strength +3
      • Set ItemTypePermanentitemTier1[3] = Slippers of Agility +3
      • Set ItemTypePermanentitemTier1[4] = Mantle of Intelligence +3
      • Set ItemTypePermanentitemTier1[5] = Boots of Speed
      • Set ItemTypePermanentitemTier1[6] = Circlet of Nobility
      • Set ItemTypePermanentitemTier1[7] = Circlet of Nobility
      • Set ItemTypePermanentitemTier1[8] = Claws of Attack +6
      • Set ItemTypePermanentitemTier1[9] = Ring of Protection +2
      • Set ItemTypePermanentitemTier1[10] = Staff of Teleportation
      • -------- T2 = 15 Items --------
      • Set ItemTypePermanentitemTier2[1] = Claws of Attack +9
      • Set ItemTypePermanentitemTier2[2] = Pendant of Energy
      • Set ItemTypePermanentitemTier2[3] = Periapt of Vitality
      • Set ItemTypePermanentitemTier2[4] = Ring of Protection +3
      • Set ItemTypePermanentitemTier2[5] = Ring of Regeneration
      • Set ItemTypePermanentitemTier2[6] = Talisman of Evasion
      • Set ItemTypePermanentitemTier2[7] = Alleria's Flute of Accuracy
      • Set ItemTypePermanentitemTier2[8] = Belt of Giant Strength +6
      • Set ItemTypePermanentitemTier2[9] = Boots of Quel'Thalas +6
      • Set ItemTypePermanentitemTier2[10] = Diamond of Summoning
      • Set ItemTypePermanentitemTier2[11] = Legion Doom-Horn
      • Set ItemTypePermanentitemTier2[12] = Robe of the Magi +6
      • Set ItemTypePermanentitemTier2[13] = Runed Bracers
      • Set ItemTypePermanentitemTier2[14] = Scourge Bone Chimes
      • Set ItemTypePermanentitemTier2[14] = Sobi Mask
      • Set ItemTypePermanentitemTier2[15] = The Lion Horn of Stormwind
      • -------- T3 = 15 Items --------
      • Set ItemTypePermanentitemTier3[1] = Ancient Janggo of Endurance
      • Set ItemTypePermanentitemTier3[2] = Claws of Attack +12
      • Set ItemTypePermanentitemTier3[3] = Cloak of Flames
      • Set ItemTypePermanentitemTier3[4] = Crystal Ball
      • Set ItemTypePermanentitemTier3[5] = Helm of Valor
      • Set ItemTypePermanentitemTier3[6] = Hood of Cunning
      • Set ItemTypePermanentitemTier3[7] = Khadgar's Pipe of Insight
      • Set ItemTypePermanentitemTier3[8] = Medallion of Courage
      • Set ItemTypePermanentitemTier3[9] = Warsong Battle Drums
      • Set ItemTypePermanentitemTier3[10] = Amulet of Spell Shield
      • Set ItemTypePermanentitemTier3[11] = Khadgar's Gem of Health
      • Set ItemTypePermanentitemTier3[12] = Orb of Darkness
      • Set ItemTypePermanentitemTier3[13] = Pendant of Mana
      • Set ItemTypePermanentitemTier3[14] = Ring of Protection +4
      • Set ItemTypePermanentitemTier3[15] = Staff of Silence
      • -------- T4/Artifact = 7 Items --------
      • Set ItemTypeArtifact[1] = Claws of Attack +15
      • Set ItemTypeArtifact[2] = Crown of Kings +5
      • Set ItemTypeArtifact[3] = Kelen's Dagger of Escape
      • Set ItemTypeArtifact[4] = Mask of Death
      • Set ItemTypeArtifact[5] = Orb of Frost
      • Set ItemTypeArtifact[6] = Ring of Protection +5
      • Set ItemTypeArtifact[7] = Tome of Power
Theres probably something wrong here..
  • Settings
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Game - Set Lock resource trading to Off
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Player - Turn Gives bounty On for (Player((Integer A)))
              • Player - Set (Player((Integer A))) Food max to 100
              • Player - Set (Player((Integer A))) Food cap to 12
              • Player Group - Add (Player((Integer A))) to PingGroup
              • Player Group - Add (Player((Integer A))) to HintGroup
              • Player Group - Add (Player((Integer A))) to IncomeGroup
              • Player - For (Player((Integer A))), turn Alliance (non-aggression) On toward Neutral Passive
              • Player - For (Player((Integer A))), turn Friendly spell targeting On toward Neutral Passive
              • Player - For Neutral Passive, turn Alliance (non-aggression) On toward (Player((Integer A)))
              • Player - For Neutral Passive, turn Friendly spell targeting On toward (Player((Integer A)))
            • Else - Actions
              • Do nothing
Quests
  • Quest
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Quest - Create a Optional quest titled Info with the description This map was made b..., using icon path ReplaceableTextures\CommandButtons\BTNSentryWard.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Optional quest titled Commands with the description Player Commands: -..., using icon path ReplaceableTextures\CommandButtons\BTNFaerieFire.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Optional quest titled Credits with the description Protector of the Pi..., using icon path ReplaceableTextures\CommandButtons\BTNPeasant.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Required quest titled Goal with the description Be the last hero st..., using icon path ReplaceableTextures\CommandButtons\BTNBattleStations.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Required quest titled Item Drops with the description When killing neutra..., using icon path ReplaceableTextures\CommandButtons\BTNINV_Misc_Coin_02.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Required quest titled The Circle with the description The circle is a bar..., using icon path ReplaceableTextures\CommandButtons\BTNAbility_Tracking.blp
      • Quest - Enable (Last created quest)
      • Quest - Create a Required quest titled Balance Changes with the description This is the list of..., using icon path ReplaceableTextures\CommandButtons\BTNClayFigurine.blp
      • Quest - Enable (Last created quest)
Might be something here, but i don't know
  • Start and Soul Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: |cffffcc00Map by:|r...
      • Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • -------- Wait --------
      • Wait 10.00 game-time seconds
      • Cinematic - Fade in over 1.00 seconds using texture Black Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • -------- Create Circle --------
      • Set TempPoint1 = (Center of (Playable map area))
      • Unit - Create 1 Eye of the Circle for Neutral Passive at TempPoint1 facing 0.00 degrees
      • Set CircleUnit = (Last created unit)
      • -------- Enable Triggers --------
      • Trigger - Turn off Squad Command <gen>
      • Trigger - Turn on Income <gen>
      • Trigger - Turn on Damage Tick Loop <gen>
      • Trigger - Run Create Timer <gen> (checking conditions)
      • -------- Create Souls --------
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Set TempPoint1 = (Random point in Spawn <gen>)
              • Player Group - Add (Player((Integer A))) to PlayersRemaining
              • Unit - Create 1 Soul of a Hero for (Player((Integer A))) at TempPoint1 facing 0.00 degrees
              • Set PlayerUnit[(Player number of (Player((Integer A))))] = (Last created unit)
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
              • Selection - Select (Last created unit) for (Player((Integer A)))
              • Camera - Pan camera for (Player((Integer A))) to TempPoint1 over 0.00 seconds
              • Unit - Add Hero Race List to (Triggering unit)
              • Unit - Add Hero Traits List to (Triggering unit)
              • Unit - Add Hero Attribute List to (Triggering unit)
              • Custom script: call RemoveLocation(udg_TempPoint1)
            • Else - Actions
              • Do nothing
      • -------- Create Multiboard --------
      • Trigger - Run Create Multiboard <gen> (checking conditions)
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
Nothing in any of those triggers should cause a problem. SimError has been used for over a decade like that and I have never heard of it desynching anyone. Variable setting is not something that can ever cause a desynch if there are no GetLocalPlayer() blocks involved.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Yeah thats kind of what i thought, but the desyncs happen so frequently i don't really know where to start.

Have you eliminated player error as a cause? If people play your map after playing a widgetized map (corrupts WC3's cache), they will always desync, and must restart Warcraft 3 to prevent this (refreshes cache). These desyncs happen only at game start.
 
Nothing in any of those triggers should cause a problem. SimError has been used for over a decade like that and I have never heard of it desynching anyone. Variable setting is not something that can ever cause a desynch if there are no GetLocalPlayer() blocks involved.

I suspect some desyncs on the latest patches are caused from Blizzard switching the sound provider to FMOD. So, it could make sense that SimError is the cause as it plays an error sound.

Try your map on the latest PTR and see if it works.
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
I don't know if I'm thinking it right but in this block:
  • joinminus.gif
    if.gif
    if (GetLocalPlayer() == ForPlayer) then
    • line.gif
      joinminus.gif
      if.gif
      if (msg!="") and (msg!=null) then
      • line.gif
        line.gif
        join.gif
        if.gif
        call ClearTextMessages()
      • line.gif
        line.gif
        joinbottom.gif
        if.gif
        call DisplayTimedTextToPlayer(ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
    • line.gif
      join.gif
      if.gif
      endif
    • line.gif
      joinbottom.gif
      if.gif
      call StartSound( error )
  • join.gif
    if.gif
    endif
  • join.gif
    if.gif
    call KillSoundWhenDone( error)
I think that the red line is the culprit. The sound is only played for the local player so the sound will be destroyed only for that local player, the sound never got played on the other clients so it will never get destroyed for those clients. IIrc I've never tested destroying agent locally tho, so I'm not sure. Try playing around the sound volume instead and just play the sound for all players.

Checking player slot status at map init will cause desyncs, since not all player states are synced while they are loading the game.
I believe that's not true, at least on older patches, < 1.28.
 
Quilnez should be right about the sound. It just plays for one player, so the destroy isn't synced, which is bad.

.. and also about that using Slot State of players should not desync on init. Many codes use this, including player-specified ones like [vJASS] - PlayerUtils.
The player state should be defined already, after you joined games lobby and have downloaded the map, when the config() function runs:

JASS:
function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "TRIGSTR_003" )
    call SetPlayers( 1 )
    call SetTeams( 1 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, -2304.0, 1280.0 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER ) // <---- example here <----
    call InitGenericPlayerSlots(  )
endfunction
..when the game starts, and loading has finished, then the main() function runs, and fires all inits. At this point, all players have run their config() already.
 
Can you elaborate what desync at start of the game means? As you posted a trigger which fires at "Elapsed Game Time 0 Seconds", does it mean the desync does not happen directly at/after loading, but when the game already started?

The trigger "Elapsed Game Time 0 Seconds" directly lets multiple other triggers run, that we don't see, and might also indirectly let even more triggers run that we don't see, too. Triggers that use the event "A unit enters world", or "A Player selects a unit", could be fired be some of the actions. Could you test, if the desyncs still happen, if you only keep the triggers activated which run on "Map Initialization"?
 
Status
Not open for further replies.
Top