Lua functions inaccessible

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
What can make all lua tables inaccessible? I added some code to line 71 of InfoTooltipInclude.lua:

Code:
function GetHelpTextForBuilding(buildingID, bExcludeName, bExcludeHeader, bNoMaintenance, city, bExcludeWritten)    
    [B]if Game.GetActivePlayer() == 0 then print("Test") end[/B]

After meeting a major civ, this appears in the lua log if I open a city ProductionPanel:

Runtime Error: [string "D:\Thalassicus\Documents\My Games\Sid Meier..."]:71: attempt to call global 'Game' (a nil value)​

It's like lua is gone. Any table I attempt to access is nil (functions, data, etc). The only time I encountered this problem before was while games load or close. The problem appeared in G&K, and did not exist in vanilla. The error does not occur if I open the TechTree, only other interface elements which use GetHelpTextForBuilding.
 
Out of the blue, i would guess that a thread crashed, thus causing attempts to acces it's data to fail. With each Lua running in its own thread, the game can still run even if some (non critical i guess) scripts are completely crashed. I got something like this with an error in TopPanel.lua, i had nothing showing and all tables were nil but the game still ran.
I think it was when i edited the vanilla TopPanel.lua for a G&K mod :hammer2:
 
That's what I'm thinking too... I suspect something elsewhere caused the thread to crash. I'm looking in diplomacy stuff because this problem appears immediately after meeting a major civilization.
 
Back
Top Bottom