• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Desyncronization

Status
Not open for further replies.
Level 1
Joined
May 15, 2022
Messages
2
Hello, I'm newbie in map development, but trying to continue dev worked map. So players are facing desyncronization now when someone click on skill on the unit.
Possible the issue somewhere here:
JASS:
    registerPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_FINISH) ->
        let id = GetSpellAbilityId()
        if id == 'A969'
            println("A969 registerPlayerUnitEvent")
            let u=GetTriggerUnit()
            let x=GetUnitX(u)
            let y=GetUnitY(u)
            let d=CreateDestructable('B001',x,y,GetUnitFacing(u),.001,5)
            UnitAddAbility(u,'A917')
            IssueTargetOrderById(u,$D021F,d)
            doAfter(0.1) ->
                println("A917 registerPlayerUnitEvent")
                UnitRemoveAbility(u,'A917')
                RemoveDestructable(d)
                if u==H6
                    forNearestUnit(u.getPos(), 800, Filter(function enemyFilterWest)) (unit uu) ->
                        if uu != null  
                            IssueTargetOrderById(H6,$D000F,uu)
                            // print(uu.getName())
                            doAfter(0.5) -> 
                                IssueTargetOrderById(H6,851983,uu)
                if u==U6 
                    forNearestUnit(u.getPos(), 800, Filter(function enemyFilterEast)) (unit uu) ->
                        if uu != null 
                            IssueTargetOrderById(U6,$D000F,uu)
                            // print(uu.getName())
                            doAfter(0.5) ->
                                IssueTargetOrderById(U6,851983,uu) 
                UnitAddAbility(u,'A964')
                ForForce(bj_FORCE_ALL_PLAYERS,function VAX)
                doAfter(20) ->
                    println("A964 registerPlayerUnitEvent")
                    UnitRemoveAbility(u,'A964')
                    let d2=CreateDestructable('B001',x,y,GetUnitFacing(u),.001,5)
                    UnitAddAbility(u,'A916')
                    IssueTargetOrderById(u,$D021F,d2)
                    doAfter(0.1) ->      
                        UnitRemoveAbility(u,'A916')
                        RemoveDestructable(d2)
                        if u==H6 
                            forNearestUnit(u.getPos(), 800, Filter(function enemyFilterWest)) (unit uu) ->
                                if uu != null 
                                    IssueTargetOrderById(H6,$D000F,uu)
                                    // print(uu.getName())
                                    doAfter(0.5) -> 
                                        IssueTargetOrderById(H6,851983,uu)
                        if u==U6
                            forNearestUnit(u.getPos(), 800, Filter(function enemyFilterEast)) (unit uu) ->
                                if uu != null  
                                    IssueTargetOrderById(U6,$D000F,uu)
                                    // print(uu.getName())
                                    doAfter(0.5) ->
                                        IssueTargetOrderById(U6,851983,uu)
Could someone please suggest how to debug such issue?
Thanks
 
At first glance, there aren't a lot of functions to look out for which may be the culprit, so I'm grasping at straws here.

Maybe bj_FORCE_ALL_PLAYERS got messed up somehow and some clients have their own version of the player group which may not include other players. If not, perhaps there is a GetLocalPlayer() call somewhere in the callback function VAX.

Are U6 and H6 intended to be global variables? If so, maybe these variables are repointed to other units during that time, which may not cause the current issue, but may point to another issue beyond the scope of this thread.

With lack of given information, I can only suggest trying to comment out the chunks of code from the deepest nested level to the surface level code and seeing if the desync issue persists.
 
Level 1
Joined
May 15, 2022
Messages
2
Thanks for the asnwers!
@MyPad VAX is quiet simple and seems like doesn't contain GetLocalPlayer(), but I don't know how SetPlayerAbilityAvailableBJ() works internaly.
JASS:
function VAX takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(false,'A964',GetEnumPlayer())
endfunction

U6 and H6 are global variables, but the cannot be changed.
BTW I can also add that it's not 100% reproducable. I've added logs before each call and cannot reproduce now. Don't know if it could be related to some timeouts that was caused by "printTimedToPlayer" function. But maybe I just was unlucky and that's why caouldn't reproduce.
 
Status
Not open for further replies.
Top