Where do you put the files?
by Tully Saxerud · in Torque Game Engine · 11/28/2007 (11:13 am) · 4 replies
Well, I lost the companion CD to the book, and I downloaded the 1.4.2 demo and "Codeweaver". What I need to know, is where do I place the scripts to make them work? I know this seems like a totally newbie question, but I need a bit of help, since my Torque demo isn't installed in the C:\3DGPAi1 folder, and the Torque demo isn't named "tge"? It says to type in the command prompt "tge -ch2 HelloWorld.cs".
Any advice, or help?
Any advice, or help?
#2
In the first version it says..
function main()
{
print("Hello World!");
}
?
Is it actually 'echo' instead of 'print'?
Also, I downloaded the Torque Game Engine V1.4.2 demo here http://www.garagegames.com/products/1/, and I used tilde to open the console, but when I typed "exec( "./HelloWorld.cs");" (Actually I copy/pasted yours), it didn't do anything :(
Any suggestions? Do I need the full version of Torque, or the version that comes in the book with the companion CD?
11/28/2007 (7:30 pm)
Actually I have the first version of the book.In the first version it says..
function main()
{
print("Hello World!");
}
?
Is it actually 'echo' instead of 'print'?
Also, I downloaded the Torque Game Engine V1.4.2 demo here http://www.garagegames.com/products/1/, and I used tilde to open the console, but when I typed "exec( "./HelloWorld.cs");" (Actually I copy/pasted yours), it didn't do anything :(
Any suggestions? Do I need the full version of Torque, or the version that comes in the book with the companion CD?
#3
11/29/2007 (6:48 am)
I think in V1.4.2 it is echo instead. When you said copy/pasted, do you mean you copied my function into the HelloWorld.cs file? If you did it should work. You could test what your version supports (I bought Torque along with the book because it's for a class that's teaching Torque, so I'm just using the 1.5.2 version instead of the books anyway). Try just typing:echo("Hello World!);If you put that directly into the console, and it works, then the function should work. If it doesn't work, try the print command. Depending on which one works, put that in the helloWorld function, and then use that. If print() works instead of echo() then you're working in a version older than mine and I don't know what differences there are so I won't know what to tell you to compensate for that.
#4
11/29/2007 (9:44 am)
Oh, okay, thanks. I'll take a look around and see what the deal is.
Torque Owner Jeremy Pridemore
Go to the directory where you installed Torque and find the executable that brings up the menu where you can select the first-person shooter demo. I don't know what it's called, but I'll pretend it's called tge.exe (it might be torqueDemo.exe or something). In this directory with tge.exe create a directory called "Test Scripts". Within that create a file called HelloWorld.cs. You can do this by right clicking anywhere, going to New->Text Document and then naming it HelloWorld.cs, it'll make the conversion for you. Open it with notepad and put in the following.
function helloWorld() { echo("Hello World!"); }Then, go back and run tge.exe. The moment you can, press the tilde key (The one left of the 1). The console should come up. Type this in: and then type "helloWorld();" (Without the quotes around it). You should see the text Hello World! echo'd. You can keep putting scripts in here to test them until you get to chapter 5, in which there is a detailed section about the directory structure and what files go where.
Hope that helps, and best of luck as you learn Torque!