Compile Error (Chapter 2)
by Tim Mendenhall · in Torque Game Engine · 05/13/2008 (4:20 pm) · 3 replies
Hi,
I got the book and bought TGE. I am having problems trying to compile the helloworld.cs script I made. The console gets hung at "Compiling helloworld.cs..." and doesn't ever load the function in return.
I got the book and bought TGE. I am having problems trying to compile the helloworld.cs script I made. The console gets hung at "Compiling helloworld.cs..." and doesn't ever load the function in return.
#2
function main() {
print("Hello world");
}
into helloworld.cs, and then exec("./helloworld.cs"); from the tge console.
There are two problems with this for me, 1 it doesn't execute the main function. and 2, print doesn't exist.
My solution to this is that right after exec("./helloworld.cs");, you can manually call main by typing main(); in the console and hitting enter.
And for print not existing, you replace the word print with echo.
This is working for me.
05/13/2008 (6:28 pm)
Ok I figured it out. The book says to put:function main() {
print("Hello world");
}
into helloworld.cs, and then exec("./helloworld.cs"); from the tge console.
There are two problems with this for me, 1 it doesn't execute the main function. and 2, print doesn't exist.
My solution to this is that right after exec("./helloworld.cs");, you can manually call main by typing main(); in the console and hitting enter.
And for print not existing, you replace the word print with echo.
This is working for me.
#3
05/13/2008 (9:24 pm)
I think I just didn't understand the file system for making a new torque game. I followed the .pdf tutorial that came with the engine today and I should be able to get this to work now. Do you have the second edition of the book Freddie? I have the second edition and it says to use echo etc.
Torque Owner Freddie Gutierrez
my script has this in it:
function main() {
print("Hello World");
}
It compiles it and does nothing. I'm going to keep looking around for a solution to this...