Game Development Community

Beginner help with TGB

by steven ov · in Torque Game Builder · 06/08/2010 (12:24 am) · 2 replies

okay so im learning how to use the console, and im reading about torque scripting and the console/command prompt.

I am going through the tutorials and it says to type commands such as echo(1+1);

then i come up to a part that says to type

if("1.2" == 1.2)
{
echo("Same- TorqueScript is type-insensitive");
}
else
{
echo("different- what!?");
}


i am lost because i do not know how i am supposed to type that in with out pressing the enter button and so i can only run one line at a time.

am i supposed to read in a file that has this code in it? how do i do that if that is the case?

also it says that i am supposed to be using the "Torque demo application" but i am not sure where that is i googled it but did not find anything. So i am using TGB and running a blank game to use the console.

I would really appreciate the help. Thank You.

-ComboShotO

About the author

Student

Recent Threads

  • Size animated Sprite Help

  • #1
    06/08/2010 (1:55 am)
    The easiest way to run this as one line is like:
    if("1.2"==1.2){echo("Same- TorqueScript is type-insensitive");}else{echo("different- what?!");}

    but it's very easy to do this with the existing code.

    First, go into the blank project you've created.

    Next, there will be a directory called "game" with a file called "main.cs" in it. Open this.

    Next, put the code above into the initializeProject() function.

    Finally, when you run your game through TGB, open the console. You'll see the resulting output (which, hopefully, should be "Same- TorqueScript is type-insensitive").

    You may have to scroll up a little bit to see the result. While you are learning TorqueScript, you can easily put snippets of code here.
    #2
    06/08/2010 (10:20 am)
    Thank you William Lee Sims, this helped a lot.

    Hope to see you around the forums.

    -ComboShotO