Game Development Community

Where do scripts live, relative to

by Michael Rogers · in Torque Game Engine · 07/06/2005 (10:03 am) · 3 replies

Hi,

Sorry for such a basic question, but I'm trying to start scripting, and can't seem to load my script. If I have a script, say packageTest.cs, where exactly should I place it so I can then exec() it?

In the console, I keep trying variations on this:

exec("./client/packageTest.cs");

changing both the path and the location of packageTest.cs. I've put it in the example folder, the common folder, the starter.fps folder, etc.,

I keep getting

Missing file: ./client/packageTest.cs

Related to this, how can I find out the current working directory?

Finally, is there a succinct discussion of the bootup process -- what .cs files get read when?

Thanks for any help,

Michael

#1
07/06/2005 (10:07 am)
In the console you'll want to do something like

exec("starter.fps/client/packageTest.cs");

only use the "./" inside of script files and the "." represents your present folder... for example: say your adding an exec in game.cs under starter.fps/server/scripts

if you did
exec("./package/packageTest.cs");

the file would need to be in

starter.fps/server/scripts/package/
#2
07/06/2005 (10:40 am)
Thanks very much, Matthew, I now can start playing.

So, it looks like I can put packageTest.cs either in starter.fps directly or in a subfolder. Out of curiosity, do you know why I can't put it in the example folder directly? In other words, why, with packageTest.cs in the example directory, exec("packageTest.cs"); doesn't find it?

Thanks again for your help and time,

Michael
#3
07/06/2005 (10:50 am)
Mainly because of restrictions in file access... starter.fps and starter.racing are both mod directories. As you probably already know you can specify which mods in the main.cs under the example directory. Torque prevents file access from outside your mod directory, for security reasons :) You should be able to put it under "common" though, in case you want it to be accessible from multiple "mods"