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

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
axlevought
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 3
Joined: Fri Aug 01, 2014 3:09 am

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

Post 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")
SAS
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 80
Joined: Tue Mar 29, 2011 8:21 am
Location: In a foxhole.

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

Post by SAS »

This should be in the tech support thread, nice find.
Post Reply

Return to “Commander the Great War : Mods & Scenario Design”