Possible in-game workaround for black screen of death
FocusedWolf
Join Date: 2005-01-09 Member: 34258Members
<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.
<!--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
But thanks for the workaround.
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.
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
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).