Possible in-game workaround for black screen of death

FocusedWolfFocusedWolf Join Date: 2005-01-09 Member: 34258Members
edited January 2011 in NS2 General Discussion
<div class="IPBDescription">lua/GUIScroreboard.lua:206</div>If you've been playing the beta then you probably had an instance while playing where the screen goes black (possibly caused by hydra spam/lag), and if you press the console key then you see this error message getting spammed continuously:

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Lua call stack:
Error: lua/GUIScroreboard.lua:206:No matching overload found, candidates:
void SetIsVisible(GUIItem&,bool)
...<!--QuoteEnd--></div><!--QuoteEEnd-->

So here's the fix to the black-screen-O-death that i'm going to be rolling with and also see post #3 and #4 because those will work to (and inspired this version of the fix):

Steps:

1. In your NS2 folder (somewhere in steam folder), Find the file "Scoreboard.lua" (best to make a backup)

2. Find the function which begins on line 168 and contains the text "function ScoreboardUI_GetVisible()"

3. Comment out the code of this function by typing "//" in front of those 4 lines, and it should look like this when your done:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//function ScoreboardUI_GetVisible()
//    local player = Client.GetLocalPlayer()
//    return player and player.showScoreboard
//end<!--c2--></div><!--ec2-->

4. paste the following new code underneath the old code:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function ScoreboardUI_GetVisible()
    local player = Client.GetLocalPlayer()
    local ret = player and player.showScoreboard

    //hmm not sure about this one... i had a bsod, but no console spam... just black
    //if ret == nil then
    //    return false
    //end

    //hopefully this gets it
    if type(ret) ~= "boolean" then
        return false
    end

    return ret
end<!--c2--></div><!--ec2-->

EDIT: so to report in on how its been, this, and other peoples lua patches do <strike>fix</strike> prevent the scoreboard problem but you may encounter alternate forms of the BSOD. It seems that after the lag clears (or a stacks worth of ###### data is processed), that those BSOD's stop and the game returns (sometimes intermittently going to BSOD and back to game [the game will appear to flicker in and out based on the presence of console spam]).

Also here's some of the other bsod's i've seen (that went away after a minute or so):
Error: lua/Table.lua:56: bad argument #1 to 'ipairs' (table expected, got nil)
Error: lua/Commander_Client.lua:812: bad argument #1 to 'ipairs' (table expected, got nil)

So ya all bsod share the same trait of nil values where they shouldn't be.

Comments

  • FrontlinerDeltaFrontlinerDelta Join Date: 2010-12-24 Member: 75924Members
    edited January 2011
    Oh, so I'm not the only one getting that. Seems to be pretty random so no idea what's causing it. Once happened while in the ready room right after the game ended, lol.

    But thanks for the workaround.
  • noisywalrusnoisywalrus Join Date: 2010-12-15 Member: 75694Members
    Had this happen to me to so here's a one-line LUA patch for it. It'll still flash a black screen but the client won't crash. This is only a band-aid until the underlying problem is fixed!

    Open GUIScoreboard.lua and go to line 200 or so. You should find this method. Insert a line as indicated.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function GUIScoreboard:Update(deltaTime)

        local teamsVisible = ScoreboardUI_GetVisible()
        
        // INSERT THIS LINE
        if (teamsVisible == nil) then
            teamsVisible = false
        end<!--c2--></div><!--ec2-->


    Technical blather (feel free to skip): For some reason (which I didn't bother to investigate beyond trying to do a simple text search) in "scoreboardUI_GetVisible", the Client object returns nil under high load, which propagates on downward through a number of processes. Most of these processes fail only in console and the game remains playable. Some of the "big hitches" seem to be the result of the LUA engine doing a little hiccup and coughing up an "invalid argument"-type exception while allowing gameplay to resume a few hundred ms later.
  • fsfodfsfod uk Join Date: 2004-04-09 Member: 27810Members, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    A different fix would be changing the last line of
    ScoreboardUI_GetVisible
    from
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->return player and player.showScoreboard<!--c2--></div><!--ec2-->
    to
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->return (player and player.showScoreboard and true) or false<!--c2--></div><!--ec2-->

    Really this error is from how the LuaBind parameter scoring system works it should really treat a nil/no parameter passed to a function that takes just a single bool as a bool set to false instead of a missing parameter because thats how it would be treated in a normal lua function
  • MOOtantMOOtant Join Date: 2010-06-25 Member: 72158Members
    Black scoreboard empties server in no time when it happens.
  • NurEinMenschNurEinMensch Join Date: 2003-02-26 Member: 14056Members, Constellation
    I think it leaves behind ghosts on the score board as well. Or else I can't explain how right after the end of a round the score board shows 13 players in the ready room, when I can only see 1.
  • FocusedWolfFocusedWolf Join Date: 2005-01-09 Member: 34258Members
    edited January 2011
    <!--quoteo(post=1820979:date=Jan 2 2011, 02:49 PM:name=noisywalrus)--><div class='quotetop'>QUOTE (noisywalrus @ Jan 2 2011, 02:49 PM) <a href="index.php?act=findpost&pid=1820979"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Had this happen to me to so here's a one-line LUA patch for it. It'll still flash a black screen but the client won't crash. This is only a band-aid until the underlying problem is fixed!

    Open GUIScoreboard.lua and go to line 200 or so. You should find this method. Insert a line as indicated.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function GUIScoreboard:Update(deltaTime)

        local teamsVisible = ScoreboardUI_GetVisible()
        
        // INSERT THIS LINE
        if (teamsVisible == nil) then
            teamsVisible = false
        end<!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd-->

    You beat me to it! lol yes that does work. I had just finished finding out the cause of the problem is ScoreboardUI_GetVisible() is returning nil.

    My inelegant experimental "just fix the damn thing" code that got me through yesterdays games with no scoreboard BSOD's:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if unexpected_condition or (type(teamsVisible) ~= "boolean") then
        teamsVisible = false
    end<!--c2--></div><!--ec2-->

    I like fsfod's approach though because that appears to <strike>fix</strike> stop the problem at its source (not really the "real" source, but through a bit of defensive programming we can prevent the corrupted value from reaching a place that will force you to restart the game).
Sign In or Register to comment.