Page 1 of 1

Research Window Crash to Desktop Bug...and how to fix it

Posted: Fri Aug 01, 2014 3:30 am
by axlevought
I have been modding the LUA files in C:TGW for my own fun and found a bug in the research window. If a faction has researched all the technologies that it can and you try to view the research window for that faction, the game will crash.

There is a null pointer in the LUA file ...\Commander The Great War\data\scripts\ui\research_panel.lua

-- How to Fix --
In that file "research_panel.lua"
Go to "function ResearchPanel:UpdateTechStats(techName, techLine, faction)"
Right below that line write in "if techName ~= nil then"
Go to "function ResearchPanel:GetTechCompletion(techId, faction)"
Right above that line write in "end"
------------------

This is a quick and dirty fix for the "techName" variable being null.

While researching this, I couldn't use the "print()" function so I had to write my own and put it in "utils.lua" to debug the crashing issue.

Code: Select all

function log(message)
	logFile = io.open("log_file.txt", "a")
	logFile:write(os.date("%c"), " ", message, "\n")	
	logFile:close()
end
What is the log method name (or logging process) that C:TGW uses by default?

edit:
Nevermind, I found it. It's LogUi(). i.e. LogUi("text to print in log file ctgw.log")

Re: Research Window Crash to Desktop Bug...and how to fix it

Posted: Tue Sep 30, 2014 5:49 am
by SAS
This should be in the tech support thread, nice find.