Emaga4 main.cs no compile fix
by Matthew Beyer · in Torque Game Engine · 07/03/2007 (9:36 pm) · 1 replies
I was having the darnedest time getting Emaga4 to run. I typed in all the modules as outlined in the chapter and ran tge but nothing happened. All I got was the blank console window which hung indefinitely. Being a fairly experienced programmer in other languages I was fully prepared to fix typos or other problems with my code by looking at the console.log, but the app didn't generate one. The script wouldn't compile and left me with no clue as to why.
So i searched the forums, and I see a fair amount of other people have had/are having this same problem. If there is a solution to it here, it's not on the first few pages and it's not coming up in the search. All I found were suggestions to check the console.log (of which there is none) and rumors that the code in the book is buggy.
Well I found the solution, and the rumors were right, one of the modules in the book is missing a function- whether this is an actual bug or just a version compatibility issue I don't know; but I'm posting the missing function here for future troubleshooting.
If this is a repeat of common knowledge and I just missed it somewhere, I apologize. The solution is as follows:
The missing function is OnStart, to fix this simply insert a stub into your root main.cs script. I put it after the OnExit stub, and it looks exactly identical save for the function name. To clarify, just cut and paste the following:
function OnStart()
{
}
That should solve the problem. The tge.exe may still hang, but it should at least generate a log now to assist you in finding any other errors.
So i searched the forums, and I see a fair amount of other people have had/are having this same problem. If there is a solution to it here, it's not on the first few pages and it's not coming up in the search. All I found were suggestions to check the console.log (of which there is none) and rumors that the code in the book is buggy.
Well I found the solution, and the rumors were right, one of the modules in the book is missing a function- whether this is an actual bug or just a version compatibility issue I don't know; but I'm posting the missing function here for future troubleshooting.
If this is a repeat of common knowledge and I just missed it somewhere, I apologize. The solution is as follows:
The missing function is OnStart, to fix this simply insert a stub into your root main.cs script. I put it after the OnExit stub, and it looks exactly identical save for the function name. To clarify, just cut and paste the following:
function OnStart()
{
}
That should solve the problem. The tge.exe may still hang, but it should at least generate a log now to assist you in finding any other errors.
Jeff