Game Development Community

Noob needs help with exec from console

by Scott Kletzkin · in Torque Game Engine · 05/01/2005 (2:11 pm) · 2 replies

Hello all! I just started working with Torque a few days ago, and was wondering if anyone could help me out with a problem I'm having.

I've been running through the documentation and had some problems getting external scripts to run from the console. Chapter 5, Section two (http://www.garagegames.com/docs/torque/general/ch05s02.php) says the following:

Quote:
Save the code as a new file called "package_test.cs" and save it in the "test_scripts" sub-directory of the example directory we created previously *INSERT LINK*.
Once you've done that, load the script you just created by opening up the TGE Console and typing
exec(test_scripts/package_test.cs);

First, I'm assuming that the command was supposed to be

exec("test_scripts/package_test.cs");

Otherwise I get a weird error message "Missing file: -1/#IND!"

The documentation never said where to put the test_scripts directory, so I tried a few places but could not get it to work. I'm using a windows box and running the FPS starter kit (C:\Torque\SDK\example\torqueDemo.exe -game starter.fps). I ended up making a directory test_scripts in EVERY SINGLE DIRECTORY inside the examples directory and was still unable to get the script to run. It just says "Missing file: test_scripts/package_test.cs!"

This is driving me crazy. I've triple checked that I'm spelling everything correctly, but the darn thing just won't work. Is there another location I haven't tried that I'm supposed to put the file in? Am I doing something wrong? I'm really getting bugged that I can't get this to work and I'd appreciate any help anyone can give me.

Thanks!

About the author

Recent Threads


#1
05/01/2005 (3:04 pm)
Scott

The path to the script in the exec function has to be given relative to where the exe file is.

If your test_scripts folder is at c:\Torque\SDK\example\starter.fps\server\test_scripts and the exe is in the example folder then the exec command would be

exec("starter.fps/server/test_scripts/package_test.cs");

Have a look here www.garagegames.com/mg/forums/result.thread.php?qt=24643 for the same problem.
#2
05/15/2005 (4:35 pm)
Ahhh, that did the trick, thanks!