Game Development Community

main.cs

by Bloodknight · in Torque 3D Professional · 05/20/2014 (2:02 pm) · 1 replies

Why is it deliberately excluded from the compilation process?

#1
05/20/2014 (3:04 pm)
The file is opened like a normal file inside StandardMainLoop::handleCommandLine() and then the contents are executed here:
Con::evaluate(script, false, useDefaultScript ? defaultScriptName : argv[1]);

This seems to be legacy code from what I can tell. Someone in IRC said it was from a time before scripts could be compiled. Regardless, the easiest solution is replacing it with something like:

Con::evaluate("exec(\"main.cs\");");

Of course some of the code above it would have to be reworked for this case, but that's the general idea. Once it's executed through normal means it can be swapped out for a compiled version.