GetLocalPlayer Disconnects

cleeezzz

The Undead Ranger.
Reaction score
268
Okay so my problem is that i tested my map and 3 people dc'ed all at one time, should i be worried that it is a getlocalplayer error? but that was 3 out of 12 people, do GetLocalPlayer disconnects D/C all players? or was 3 people at once a sign? (or just laggy internet)?
 

cleeezzz

The Undead Ranger.
Reaction score
268
i know how to use it, but i might have messed up somewhere, the 3 people disconnecting, is that a sign of getlocalplayer desyncs or just laggy internet??

remember that not ALL players disconnect only 3 out of 12
 

saw792

Is known to say things. That is all.
Reaction score
280
Can you narrow down what happens when they disconnect? Spell cast, event, anything?
 

cleeezzz

The Undead Ranger.
Reaction score
268
nope, completely random as far as i can tell.

Ok so ive experienced crashing twice in my game but i do not notice anything special as it happens which means, i do not know the cause of the error. is there a faster way to find out what happened other than going through all the code (which still cant guarantee finding it)
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
So you don't know what's causing it, but it's a flaw in one of your triggers. However, you want us to try to narrow it down for you?

Try looking in some of your triggers. Infinite loops are usually an easy place to start looking.
 

Joker(Div)

Always Here..
Reaction score
86
Crash? I thought you said Disconnect. It gets saved on your LastReplay doesn't it? Maybe the new autoreplay feature saves it.
 

cleeezzz

The Undead Ranger.
Reaction score
268
heh.. i get both. 1 game, 3 people disconnected, the next, it crashed.

>Maybe the new autoreplay feature saves it.
not crashed games
 

cleeezzz

The Undead Ranger.
Reaction score
268
heres my trigger with the most getlocalplayer

is there any problem with it?

JASS:
scope KD initializer Init

globals
    private integer c = 0
endglobals

struct KDS
    //! runtextmacro PUI()
    timer t
    player p
    method onDestroy takes nothing returns nothing
        set .p = null
        call ReleaseTimer(.t)
        set .t = null
    endmethod
endstruct

private function Conditions takes nothing returns boolean
    return GetUnitPointValue(GetTriggerUnit()) == 100
endfunction

private function Add takes nothing returns nothing
    set c = c + Kills[GetPlayerId(GetEnumPlayer())]
endfunction

private function End takes nothing returns nothing
    local KDS d = GetCSData(GetExpiredTimer())
    set MKCount[GetPlayerId(d.p)] = 0
    call d.release()
endfunction

private function Actions takes nothing returns nothing
    local multiboarditem mbi = null
    local integer kid = GetPlayerId(GetOwningPlayer(GetKillingUnit()))
    local integer did = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    local integer bounty = 0
    local integer i = 0
    local KDS d 
    if (GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) == PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) == PLAYER_SLOT_STATE_EMPTY) and IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) and GetUnitPointValue(GetTriggerUnit()) == 100 then
        if GetPlayerSlotState(GetOwningPlayer(GetKillingUnit())) == PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(GetOwningPlayer(GetKillingUnit())) == PLAYER_SLOT_STATE_EMPTY then   
            set Deaths[did] = ( Deaths[did] + 1 )
            set TDeaths[did] = ( TDeaths[did] + 1 )
            set mbi = MultiboardGetItem(Norm_MB, spots[did], 2)
            call MultiboardSetItemValue(mbi, I2S(Deaths[did]) )
            call MultiboardReleaseItem(mbi)
            set mbi = MultiboardGetItem(Stat_MB[did], 5, 1)
            call MultiboardSetItemValue(mbi, I2S(Deaths[did]) )
            call MultiboardReleaseItem(mbi)
            set mbi = MultiboardGetItem(Stat_MB[did], 7, 1)
            call MultiboardSetItemValue(mbi, I2S(TDeaths[did]) )
            call MultiboardReleaseItem(mbi)
            set Kills[kid] = Kills[kid] + 1
            set TKills[kid] = TKills[kid] + 1
            set mbi = MultiboardGetItem(Norm_MB, spots[kid], 1)
            call MultiboardSetItemValue( mbi, I2S(Kills[kid]) )
            call MultiboardReleaseItem(mbi)
            set mbi = MultiboardGetItem(Stat_MB[kid], 4, 1)
            call MultiboardSetItemValue( mbi, I2S(Kills[kid]) )
            call MultiboardReleaseItem(mbi)
            set mbi = MultiboardGetItem(Stat_MB[kid], 6, 1)
            call MultiboardSetItemValue( mbi, I2S(TKills[kid]) )
            call MultiboardReleaseItem(mbi)
            
            if GameMode1[1] == false then
                if GameMode1[2] == true then
                    set i = 1
                    loop
                        exitwhen i == 7
                        set c = 0
                        call ForForce(Teams<i>, function Add)
                        set mbi = MultiboardGetItem(Team_MB, i, 1)
                        call MultiboardSetItemValue( mbi, I2S(c))
                        call MultiboardReleaseItem(mbi)
                        set mbi = null
                        set i = i + 1
                    endloop
                elseif GameMode1[3] == true then
                    set i = 1
                    loop
                        exitwhen i == 5
                        set c = 0
                        call ForForce(Teams<i>, function Add)
                        set mbi = MultiboardGetItem(Team_MB, i, 1)
                        call MultiboardSetItemValue( mbi, I2S(c))
                        call MultiboardReleaseItem(mbi)
                        set mbi = null
                        set i = i + 1
                    endloop
                elseif GameMode1[4] == true then
                    set i = 1
                    loop
                        exitwhen i == 4
                        set c = 0
                        call ForForce(Teams<i>, function Add)
                        set mbi = MultiboardGetItem(Team_MB, i, 1)
                        call MultiboardSetItemValue( mbi, I2S(c))
                        call MultiboardReleaseItem(mbi)
                        set mbi = null
                        set i = i + 1
                    endloop
                elseif GameMode1[5] == true then
                    set i = 1
                    loop
                        exitwhen i == 3
                        set c = 0
                        call ForForce(Teams<i>, function Add)
                        set mbi = MultiboardGetItem(Team_MB, i, 1)
                        call MultiboardSetItemValue( mbi, I2S(c))
                        call MultiboardReleaseItem(mbi)
                        set mbi = null
                        set i = i + 1
                    endloop
                endif
            endif
            set GameKills = GameKills + 1
            if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
                call DisplayTextToPlayer(GetLocalPlayer(), 0, 0,  PlayerColors[GetPlayerId(GetOwningPlayer(GetDyingUnit()))] + GetPlayerName(GetOwningPlayer(GetDyingUnit())) + &quot;|r&quot; + &quot; has been pwned by &quot; + PlayerColors[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + GetPlayerName(GetOwningPlayer(GetKillingUnit())) + &quot;|r&quot; + &quot; for &quot; + &quot;|cffffcc00&quot; + &quot;5&quot; + &quot; gold!&quot; + &quot;|r&quot;)
            endif
            call SetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD) + 5 )
            if GameKills == 1 then
                call StartSound( gg_snd_FirstBlood )
                if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
                    call DisplayTextToPlayer(GetLocalPlayer(), 0, 0,  PlayerColors[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + GetPlayerName(GetOwningPlayer(GetKillingUnit())) + &quot;|r&quot; + &quot; has received |c00FF0000FIRST BLOOD!!|r |cffffcc00+5 gold!|r&quot;)                
                endif
                call SetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD) + 5 )
            endif     
            if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
                call MultiboardSetTitleText(Norm_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[kid]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[kid]) + &quot;|r&quot;)
            endif
            if Team_MB != null then
                if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
                    call MultiboardSetTitleText(Team_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[kid]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[kid]) + &quot;|r&quot;)
                endif
            endif
            set i = 0
            loop
                exitwhen i == 12
                if Stat_MB<i> != null then
                    if GetLocalPlayer() == GetOwningPlayer(GetKillingUnit()) then
                        call MultiboardSetTitleText(Stat_MB<i>, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[kid]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[kid]) + &quot;|r&quot;)
                    endif
                endif
                set i = i + 1
            endloop        
            if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
                call MultiboardSetTitleText(Norm_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
            endif
            if Team_MB != null then
                if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
                    call MultiboardSetTitleText(Team_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
                endif
            endif
            set i = 0
            loop
                exitwhen i == 12
                if Stat_MB<i> != null then
                    if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
                        call MultiboardSetTitleText(Stat_MB<i>,&quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
                    endif
                endif
                set i = i + 1
            endloop 
            if SpreeCount[did] &gt; 3 then
                if SpreeCount[did] &gt; 10 then
                    set SpreeCount[did] = 10
                endif
                if GodlikeCount[did] &gt; 0 then
                    set bounty = SpreeEndGold[SpreeCount[did]] + (7 * (GodlikeCount[did] - 1))
                else
                    set bounty = SpreeEndGold[SpreeCount[did]]
                endif
                if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
                    call DisplayTextToPlayer( GetLocalPlayer(),0,0, PlayerColors[did] + GetPlayerName(GetOwningPlayer(GetDyingUnit())) + &quot;|r&quot; + &quot;&#039;s &quot; + SpreeEndAnnounce[SpreeCount[did]] + &quot; has been ended by &quot; + PlayerColors[kid] + GetPlayerName(GetOwningPlayer(GetKillingUnit())) + &quot;|r&quot; + &quot; |cffffcc00+&quot; + I2S(bounty) + &quot; gold!|r&quot; )
                endif
                call SetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD) + bounty )
                call DestroyEffect(SpreeSFX[did])
            endif
            set SpreeCount[did] = 0
            set GodlikeCount[did] = 0
            set MKCount[did] = 0
            set SpreeCount[kid] = SpreeCount[kid] + 1
            if SpreeCount[kid] &gt; 10 then
                set SpreeCount[kid] = 10    
            endif
            if SpreeCount[kid] &gt; 3 then
                call StartSound(SpreeSound[SpreeCount[kid]] )
                call SetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD) + SpreeGold[SpreeCount[kid]] )
                if SpreeCount[kid] == 4 then
                    set SpreeSFX[kid] = AddSpecialEffectTarget( &quot;Abilities\\Spells\\Items\\HealingSalve\\HealingSalveTarget.mdl&quot;, Hero[kid], &quot;origin&quot;  )
                endif
                if SpreeCount[kid] == 10 then
                    set GodlikeCount[kid] = GodlikeCount[kid] + 1 
                endif
                if GodlikeCount[kid] &gt; 0 then
                    set bounty = SpreeEndGold[SpreeCount[kid]] + (7 * (GodlikeCount[kid] - 1))
                else
                    set bounty = SpreeEndGold[SpreeCount[kid]]
                endif
                if IsPlayerInForce(GetLocalPlayer(),bj_FORCE_ALL_PLAYERS) then
                    call DisplayTimedTextToPlayer( GetLocalPlayer(), 0,0,10.00, PlayerColors[kid] + GetPlayerName(GetOwningPlayer(GetKillingUnit())) + &quot;|r&quot;  + SpreeAnnounce[SpreeCount[kid]] + &quot; |cffffcc00(&quot; + I2S(bounty) + &quot; Bounty)|r&quot;)
                endif
            endif
            set d = KDS[Hero[kid]]
            set MKCount[kid] = MKCount[kid] + 1
            if d == 0 then
                call d.create()
                set KDS[Hero[kid]] = d
                set d.t = NewTimer()
                set d.p = GetOwningPlayer(GetKillingUnit())
            else
                call PauseTimer(d.t)
            endif
            call TimerStart(d.t,1,false,function End)
            call SetCSData(d.t,d)
            if MKCount[kid] &gt; 3 then
                set MKCount[kid] = 3
            endif
            if MKCount[kid] &gt; 1 then
                call StartSound(MKSound[MKCount[kid]] )
                call SetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD) + MKGold[MKCount[kid]] )
                if IsPlayerInForce(GetLocalPlayer(),bj_FORCE_ALL_PLAYERS) then
                    call DisplayTimedTextToPlayer( GetLocalPlayer(), 0,0,10.00, PlayerColors[kid] + GetPlayerName(GetOwningPlayer(GetKillingUnit())) + &quot;|r&quot;  + MKAnnounce[MKCount[kid]])
                endif
            endif
            set i = 0
            loop
                exitwhen i == 12
                if TKills[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] == RankKills<i> then
                    call SetPlayerName( GetOwningPlayer(GetKillingUnit()), ( PlayerName[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + Rank<i> ) )
                    if IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS) then
                        call DisplayTextToPlayer( GetLocalPlayer(),0,0, PlayerColors[GetPlayerId(GetOwningPlayer(GetKillingUnit()))] + PlayerName[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]  + &quot;|r has ranked up to a(n)&quot; + &quot;|cffffcc00&quot; + Rank<i> + &quot;|r&quot; )
                    endif
                    set mbi = MultiboardGetItem(Stat_MB[GetPlayerId(GetOwningPlayer(GetKillingUnit()))], 1, 1)
                    call MultiboardSetItemValue(mbi, Rank<i>)
                    call MultiboardReleaseItem(mbi)
                    set mbi = null
                endif
                set i = i + 1
            endloop
        endif
    else
        set Deaths[did] = ( Deaths[did] + 1 )
        set TDeaths[did] = ( TDeaths[did] + 1 )
        set mbi = MultiboardGetItem(Norm_MB, spots[did], 2)
        call MultiboardSetItemValue(mbi, I2S(Deaths[did]) )
        call MultiboardReleaseItem(mbi)
        set mbi = null
        if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
            call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, PlayerColors[did] + GetPlayerName(GetOwningPlayer(GetDyingUnit())) + &quot;|r&quot;  + &quot; has died.&quot; )
        endif
        if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
            call MultiboardSetTitleText(Norm_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
        endif
        if Team_MB != null then
            if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
                call MultiboardSetTitleText(Team_MB, &quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
            endif
        endif
        set i = 0
        loop
            exitwhen i == 12
            if Stat_MB<i> != null then
                if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
                    call MultiboardSetTitleText(Stat_MB<i>,&quot;|cffffcc00Archer Wars|r &quot; + &quot;|c0000FF00&quot; + I2S(Kills[did]) + &quot;|r&quot; + &quot;|cffffcc00/|r&quot; + &quot;|c00FF0000&quot; + I2S(Deaths[did]) + &quot;|r&quot;)
                endif
            endif
            set i = i + 1
        endloop 
    endif
     
    if DM == true then
        call TriggerExecute(DM_Trig[Mode])
    endif
    set mbi = null
endfunction

//===========================================================================
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( trig, Condition( function Conditions))
    call TriggerAddAction( trig, function Actions )
endfunction

endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i>
 

Joker(Div)

Always Here..
Reaction score
86

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
The only two things is with displaying text and the multiboard. I'm just wondering is multiboard will desync on GetLocalPlayer().
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
If the multiboard doesn't, I'm pretty sure that won't.
 

cleeezzz

The Undead Ranger.
Reaction score
268
well thats mostly all my get local players.

i need more beta testers.. 6-7 more
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
General chit-chat
Help Users

      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