Instant D/C when using this trigger.

Fujiwari

Active Member
Reaction score
0
I have a cooldown window based revive - buy back trigger and it works fine in singleplayer. However, I hooked up a friend and we played together. The moment I died and typed -bb , I get instantly disconnected. I'm not sure if it is a server-splitting leak or whatsoever. Here are the triggers:

This just sets some boolean variables to true at the start of the map. True = Alive, False = Dead
Code:
Init Values for Player unit Status
    Events
        Map initialization
    Conditions
    Actions
        Set IsAliveBoolean_P1 = True
        Set IsAliveBoolean_P2 = True
        Set IsAliveBoolean_P3 = True
        Set IsAliveBoolean_P4 = True

When Blue's hero becomes revivable, this trigger fires off.
Code:
R Blue Becomes Revivable
    Events
        Unit - A unit Becomes revivable
    Conditions
        (Owner of (Revivable Hero)) Equal to Player 2 (Blue)
    Actions
        Set IsAliveBoolean_P2 = False
        Set RevivableUnit[1] = (Revivable Hero)
        Countdown Timer - Create a timer window for Timer[3] with title ((Name of (Owner of RevivableUnit[1])) + (Revive in..  + (String(((Level of RevivableUnit[1]) x 3)))))
        Set cd_timer_window[3] = (Last created timer window)
        Countdown Timer - Show cd_timer_window[3] for Player 2 (Blue)
        Set Real_Number[1] = (3.00 x (Real((Level of RevivableUnit[1]))))
        Countdown Timer - Start Timer[3] as a One-shot timer that will expire in Real_Number[1] seconds
        Trigger - Turn on Revive Blue <gen>
        Trigger - Turn on R Blue Buy Back <gen>
It also turns on these two triggers.
This trigger revives the hero at a region after the cooldown timer expires. It fires off with no issue.
Code:
Revive Blue
    Events
        Time - Timer[3] expires
    Conditions
        IsAliveBoolean_P2 Equal to False
    Actions
        Set IsAliveBoolean_P2 = True
        Countdown Timer - Hide cd_timer_window[3]
        Countdown Timer - Destroy cd_timer_window[3]
        Hero - Instantly revive RevivableUnit[1] at (Center of REVIVE <gen>), Show revival graphics
        Selection - Select RevivableUnit[1] for (Owner of RevivableUnit[1])
        Camera - Pan camera as necessary for (Owner of RevivableUnit[1]) to (Center of REVIVE <gen>) over 0.50 seconds
        Set RevivableUnit[1] = No unit
        Trigger - Turn off R Blue Buy Back <gen>
        Trigger - Turn off (This trigger)

and this trigger here is what disconnected me instantly. What this trigger does (or attempting to do) is when blue types -bb, I will destroy the cooldown windows instantly and revive the hero at the region. It works fine in Single Player, but online, disconnects me instantly.
Code:
R Blue Buy Back
    Events
        Player - Player 2 (Blue) types a chat message containing -bb as An exact match
    Conditions
    Actions
        -------- ------------- --------
        Set IsAliveBoolean_P2 = True
        Game - Display to Player Group - Player 2 (Blue) the text: (|c00FF7F00That Buy back costed you: |r + ((String((200 x (Level of RevivableUnit[1])))) + |c00FF7F00 Gold. Ouch!: |r))
        Countdown Timer - Hide cd_timer_window[3]
        Countdown Timer - Destroy cd_timer_window[3]
        Hero - Instantly revive RevivableUnit[1] at (Center of REVIVE <gen>), Show revival graphics
        Selection - Select RevivableUnit[1] for (Owner of RevivableUnit[1])
        Camera - Pan camera as necessary for (Owner of RevivableUnit[1]) to (Center of REVIVE <gen>) over 0.50 seconds
        Player - Add (-200 x (Level of RevivableUnit[1])) to (Owner of RevivableUnit[1]) Current gold
        Set RevivableUnit[1] = No unit
        Trigger - Turn off Revive Blue <gen>
        Trigger - Turn off (This trigger)

Any help will be great. Thanks!
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There are a few Camera and Timer functions that are known to cause disconnects. I am not entirely sure which ones it were, but I would try to remove any Camera code first and test again. If that doesnt help, remove the timers too and instead count the time yourself.
 

Fujiwari

Active Member
Reaction score
0
There are a few Camera and Timer functions that are known to cause disconnects. I am not entirely sure which ones it were, but I would try to remove any Camera code first and test again. If that doesnt help, remove the timers too and instead count the time yourself.
It seemed like the issue was the camera. Thanks for the response! I didn't know a camera movement could leak so badly.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
it has nothing to do with leaks. Just bad programming from blizzard.
There are certain functions that, when called, do some actions JUST for one player. The local player. Whenever an action is performed only for one player the game could desync. This happens, for example, when a new object is created for only one player. Since all the other players dont have this object but one of them does, the game will obviously desync.
Now, some of the GUI functions actually perform actions only for the local player. Why? We will never know...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top