Game Development Community

Need help : Console in tutorial.base

by March · in General Discussion · 05/26/2008 (2:20 pm) · 3 replies

I am new for torque and also my english is not good but I can understand very well. I am studying how to script and My question is

In the console window in torque ( ~ button) , How do I expand the console window for scripting ? I want to put more than a single command then compile them. The way I'm doing now is copy my whole script from notepad and paste in the console. It's working but It 's really hard see what I paste.

For example

my notepad:
//I want to see something like this in the console
%a=5;
%b=5;
echo(%a+%b);

torque console :
//It's really hard to check it if I have like 10-20 lines
%a=5; %b=5; echo(%a+%b);

I hope you guys understand me. Thank you for helping me

#1
05/26/2008 (2:41 pm)
Well actually, the ';' are really what defines the line, so let's say in notepad you have a function like this:

function add ( %a, %b, %c, %d )
{
%a = 4;
%b = 6;
%c = %d + %a;
%d = 7;
echo("a + b + c + d = " %a + %b + %c + %d);
}

Now if you put it in the console it must be like:

function add ( %a, %b, %c, %d ){ %a = 4; %b = 6; %c = %d + %a; %d = 7; echo("a + b + c + d = " %a + %b + %c + %d);}

Now if you put that in notepad, it does the same thing. So don't worry about the console, I know it's hard, but as long as you know what your doing, then you should be able to do anything in it...
#2
05/26/2008 (6:17 pm)
Rather than copying and pasting your code into the console (which has also has a limited input length), it is easier to just save your code from within notepad to a file and then execute it from the file using the console.

For example, save your code to a file /mycode.cs and then from the console, execute

exec( "mycode.cs" );

The console isn't really meant to interactively develop code but rather to just execute (very) short commands. That's why it is hard to use it the way you intended to.

//EDIT
Just realized tutorial.base is TGE... my bad. Removed the "scriptsAndAssets" thing.
#3
05/26/2008 (6:24 pm)
Thank you so much guys. I am using Torsion now. it is far away better.