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

Status
Not open for further replies.
So I've come here to post a few triggers that I believe are the culprit of my map desyncing.
If you agree please tell me why and how to fix it ;p

  • Fix Weather Crap
    • Events
    • Conditions
    • Actions
      • For each (Integer TempInteger) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set TempPlayer1 = (Player(TempInteger))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Indoors[TempInteger] Equal to True
            • Then - Actions
              • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
              • Sound - Remove WeatherSound1 across (Playable map area)
              • Sound - Remove WeatherSound2 across (Playable map area)
              • Environment - Turn WeatherEffect1 Off
              • Environment - Turn WeatherEffect2 Off
              • Environment - Set fog to style Linear, z-start 0.00, z-end 99999.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
              • Custom script: endif
            • Else - Actions
              • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
              • Environment - Set fog to style Linear, z-start 0.00, z-end 99999.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
              • Custom script: endif
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CurrentWeather Equal to 1
                • Then - Actions
                  • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                  • Sound - Add WeatherSound2 across (Playable map area)
                  • Environment - Turn WeatherEffect2 On
                  • Custom script: endif
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • CurrentWeather Equal to 3
                          • CurrentWeather Equal to 2
                    • Then - Actions
                      • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                      • Sound - Add WeatherSound1 across (Playable map area)
                      • Environment - Turn WeatherEffect1 On
                      • Custom script: endif
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CurrentWeather Equal to 4
                        • Then - Actions
                          • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                          • Sound - Add WeatherSound1 across (Playable map area)
                          • Sound - Add WeatherSound2 across (Playable map area)
                          • Environment - Turn WeatherEffect1 On
                          • Environment - Turn WeatherEffect2 On
                          • Custom script: endif
                        • Else - Actions
  • House Leave
    • Events
      • Unit - A unit enters Leave House <gen>
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of TempUnit) Not equal to Bag
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of TempUnit) Not equal to Player 12 (Brown)
            • Then - Actions
              • Set TempPlayer2 = (Owner of TempUnit)
            • Else - Actions
              • Set TempPlayer2 = Spirit
          • Custom script: if GetLocalPlayer() == udg_TempPlayer2 then
          • Destructible - Show Log Roof 0970 <gen>
          • Destructible - Show Log Roof 0971 <gen>
          • Destructible - Show Log Roof 0972 <gen>
          • Destructible - Show Log Roof 0973 <gen>
          • Destructible - Show Log Roof 0974 <gen>
          • Destructible - Show Log Roof 0975 <gen>
          • Destructible - Show Log Roof 0976 <gen>
          • Destructible - Show Log Roof 0977 <gen>
          • Custom script: endif
          • Trigger - Turn on Fix Buffs <gen>
          • Unit Group - Remove TempUnit from InDoorGroup
          • For each (Integer TempInteger) from 1 to 11, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempUnit Equal to Survivor[TempInteger]
                • Then - Actions
                  • Set Indoors[TempInteger] = False
                • Else - Actions
          • Trigger - Run Fix Weather Crap <gen> (ignoring conditions)
        • Else - Actions
Keep in mind that those destructibles I hide are targeted as invulnerable and cannot not take damage. But I have my own theory. I have an trigger that sends down thunderbolts periodicly and deals damage to an AREA. I don't know if that will still damage invulnerable destructibles, and if it does that probably could cause a desync. (Cuz for 1 player its hidden and another it is not)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Do not enable/disable triggers locally, running threads has to be in sync. I do not think that the region sounds cause problems. If they do, you may use an empty sound for other players.

And yes, hiding destructables is also dangerous. I guess they do not show up in pick destructable actions. They might block sight or pathing and also trigger actions might affect them differently.
 
So I've combined the locals in the triggers and removed the local sound playing.
  • Fix Weather
    • Events
    • Conditions
    • Actions
      • For each (Integer TempInteger) from 1 to 11, do (Actions)
        • Loop - Actions
          • Set TempPlayer1 = (Player(TempInteger))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Indoors[TempInteger] Equal to True
            • Then - Actions
              • Set TempString = death
              • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
              • Environment - Turn WeatherEffect1 Off
              • Environment - Turn WeatherEffect2 Off
              • Environment - Set fog to style Linear, z-start 0.00, z-end 99999.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
              • Animation - Play the TempString animation for all doodads of type Log Roof within (Playable map area)
              • Custom script: endif
            • Else - Actions
              • Set TempString = stand
              • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
              • Animation - Play the TempString animation for all doodads of type Log Roof within (Playable map area)
              • Environment - Set fog to style Linear, z-start 0.00, z-end 5000.00, density 0.50 and color (30.00%, 30.00%, 30.00%)
              • Custom script: endif
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CurrentWeather Equal to 1
                • Then - Actions
                  • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                  • Environment - Turn WeatherEffect2 On
                  • Custom script: endif
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • CurrentWeather Equal to 3
                          • CurrentWeather Equal to 2
                    • Then - Actions
                      • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                      • Environment - Turn WeatherEffect1 On
                      • Custom script: endif
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CurrentWeather Equal to 4
                        • Then - Actions
                          • Custom script: if GetLocalPlayer() == udg_TempPlayer1 then
                          • Environment - Turn WeatherEffect1 On
                          • Environment - Turn WeatherEffect2 On
                          • Custom script: endif
                        • Else - Actions
The only culprit I have left is weather effects, which I have had yet to test...
If show/hiding weather effects locally is desyncable someone please tell me.
 
Turning on and off weather effects is fine locally, but here, you're creating them locally, which is not ok:

  • Environment - Set fog to style Linear, z-start 0.00, z-end 5000.00, density 0.50 and color (30.00%, 30.00%, 30.00%)
You should set the values above into variables (30%, 0.0, 5000, 0.5)
And set these values to 0 for local players, then run the above action outside of a local player block.
 
Level 5
Joined
Sep 19, 2006
Messages
152
Do not enable/disable triggers locally, running threads has to be in sync.

So would a trigger like the following be problematic?

JASS:
    if winner_boo == true then
        call DisableTrigger (gg_trg_CreepsDeath)
        call DisableTrigger (gg_trg_CreepsDeathUndead)
        call DisableTrigger (gg_trg_HydraDeath)
        call DisableTrigger (gg_trg_Every1Seconds)
        call TriggerExecute (gg_trg_GameFinish)
    else
        call TriggerExecute (gg_trg_CreepsCreation)
    endif
 
For these lines:
  • Sound - Remove WeatherSound1 across (Playable map area)
  • Sound - Remove WeatherSound2 across (Playable map area)
  • Sound - Add....
I don't remember the JASS equivalents, but that might be causing your problem as well. Instead of removing/adding sounds within the local player block, you should instead just locally modify the volume of the sound.
 
Status
Not open for further replies.
Top