• 🏆 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] Unit Death/Quest Complete Trigger Causing Desync?

Level 18
Joined
Mar 16, 2008
Messages
721
[EDIT: this is confirmed NOT desyncing players. it's some other trigger. trying to debug now. sorry for being too hasty to post.]

Two players desync'd announcement on multiplayer game when this trigger ran.

  • furbolg quest complete
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to murkgul
    • Actions
      • Special Effect - Destroy fur_sfx
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Furbolg 0197 <gen> is alive) Equal to True
        • Then - Actions
          • Unit - Order Furbolg 0197 <gen> to Right-Click Felwood Tree Wall 2438 <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (fur_quest is discovered) Equal to True
              • (Neutral Furbolg Hut (Den of Wonders) 0183 <gen> is alive) Equal to True
            • Then - Actions
              • Quest - Change the description of fur_quest to The Neutral Furbolg...
              • Quest - Display to (All players) the Quest Completed message: Optional Quest Comp...
              • Quest - Mark fur_quest as Completed
              • Unit - Make Neutral Furbolg Hut (Den of Wonders) 0183 <gen> Invulnerable
              • Unit - Add Shop Purchase Item to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Sell Units to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Sell Items to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Select Hero to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Neutral Building - Turn special minimap icon On for Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Neutral Building - Change the special minimap icon to UI\MiniMap\MinimapIcon\MinimapIconNeutralBuilding.blp
            • Else - Actions
        • Else - Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in player_hero_unit_grp[(Integer A)] and do (Actions)
            • Loop - Actions
              • Hero - Add 300 experience to (Picked unit), Show level-up graphics
              • Floating Text - Create floating text that reads |cff00ff00+300 XP|r above (Picked unit) with Z offset 1.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
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
      • For each (Integer A) from 13 to 16, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in player_hero_unit_grp[(Integer A)] and do (Actions)
            • Loop - Actions
              • Hero - Add 300 experience to (Picked unit), Show level-up graphics
              • Floating Text - Create floating text that reads |cff00ff00+300 XP|r above (Picked unit) with Z offset 1.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
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
      • Countdown Timer - Pause furbolg_qst_atk_loop_timer
      • Trigger - Turn off furbolg quest attack loop <gen>
      • Trigger - Turn off furbolg quest fail <gen>
      • Trigger - Turn off furbolg quest acquire <gen>
      • Trigger - Turn off (This trigger)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,544
Everything is relatively normal here, the only thing that sticks out is these two Action:
  • Neutral Building - Turn special minimap icon On for Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
  • Neutral Building - Change the special minimap icon to UI\MiniMap\MinimapIcon\MinimapIconNeutralBuilding.blp
I'm just not familiar with them, so my gut tells me that one or both of them could be the issue. Everything else is very basic and used in many other triggers I imagine.

Also, remember that this Event is dangerous when not used carefully:
  • Unit - A unit Dies
It doesn't follow the standard rules and will run immediately in response to a unit dying, interjecting it's Actions into whatever trigger may have killed the unit (if one did). For example, you have a triggered spell that deals damage. If that damage were to kill murkgul then there could easily be issues, especially if that spell trigger uses some of the same variables as this one and wasn't finished yet.


Oh and just me being nitpicky again but the For Loops + Pick Every Unit is bad practice. I have a feeling each Player only has one Hero in player_hero_unit_grp, which begs the question as to why it even needs to exist. But if you can have more than one hero then that's perfectly fine. Also, I would rely on Pick Every Player and Player Groups rather than the For Loops here. Always running game logic for Players 1-4 and 13-16 is silly when we know that some of these Players may not even be in the game. A Player Groups job is to make sure you only run Actions for the Players contained inside, and the Players contained inside are easily controlled by you at all times.
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
Would setting the dying unit to a variable make this problem less likely? what about making the event player specifici "Unit owned by player... dies"?

Fixed the Loop to simply be pick every unit in udg_hero_grp. that was actually a change I meant to do before posting. side note, integer A is being used too much.

  • Neutral Building - Turn special minimap icon On for Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
  • Neutral Building - Change the special minimap icon to UI\MiniMap\MinimapIcon\MinimapIconNeutralBuilding.blp
this seem to work without desyncs. the desync that occurred was intermittent. i would assume it was bad net but happened to two simultaneously.

  • furbolg quest complete
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Dying unit) Equal to murkgul
    • Actions
      • Special Effect - Destroy fur_sfx
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Furbolg 0197 <gen> is alive) Equal to True
        • Then - Actions
          • Unit - Order Furbolg 0197 <gen> to Right-Click Felwood Tree Wall 2438 <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (fur_quest is discovered) Equal to True
              • (Neutral Furbolg Hut (Den of Wonders) 0183 <gen> is alive) Equal to True
            • Then - Actions
              • Quest - Change the description of fur_quest to The Neutral Furbolg...
              • Quest - Display to (All players) the Quest Completed message: Optional Quest Comp...
              • Quest - Mark fur_quest as Completed
              • Unit - Make Neutral Furbolg Hut (Den of Wonders) 0183 <gen> Invulnerable
              • Unit - Add Shop Purchase Item to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Sell Units to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Sell Items to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Unit - Add Select Hero to Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Neutral Building - Turn special minimap icon On for Neutral Furbolg Hut (Den of Wonders) 0183 <gen>
              • Neutral Building - Change the special minimap icon to UI\MiniMap\MinimapIcon\MinimapIconNeutralBuilding.blp
            • Else - Actions
        • Else - Actions
      • Unit Group - Pick every unit in hero_units and do (Actions)
        • Loop - Actions
          • Hero - Add 300 experience to (Picked unit), Show level-up graphics
          • Floating Text - Create floating text that reads |cff00ff00+300 XP|r above (Picked unit) with Z offset 1.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
          • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 45.00 degrees
      • Countdown Timer - Pause furbolg_qst_atk_loop_timer
      • Trigger - Turn off furbolg quest attack loop <gen>
      • Trigger - Turn off furbolg quest fail <gen>
      • Trigger - Turn off furbolg quest acquire <gen>
      • Trigger - Turn off (This trigger)
 
Last edited:
Top