Game Development Community

Where do I put my script files?

by Matthew Ruggiero · in Torque Game Engine · 09/08/2004 (6:32 am) · 7 replies

I am trying to write some example scripts to learn with and run them from the console of the starter.fps but it says it cannot find them when I exec the files.
Where do I need to put them or more specifically what is the root directory I am in when I run the demo?

Thanks.

#1
09/08/2004 (8:00 am)
The root directory is the game named directory. In your case, thats /starter.fps. For sanity, scripts really should be deeper than that, such as /starter.fps/server/scripts. To execute, you would use
exec("starter.fps/server/scripts/MyNewScript.cs");
#2
09/08/2004 (8:58 am)
OK thanks.

I was confused because it doesn't allow me to run scripts from the same directory as the TGE exe.
Wierd.
#3
09/09/2004 (3:24 am)
Does the engine only allow scripts to run from certain directories?
#4
09/09/2004 (3:54 am)
You can create a script file and place it in a different directory if you want. Just make sure you modify the path when you exec it:

exec("starter.fps/server/scripts/MyFolder/MyNewScript.cs");

Nick
#5
09/09/2004 (4:58 am)
Yes I understand that but when I do the following it doesn't find the file:

exec("test.cs");

So I am assuming you cannot run a script from the same directory as the torque exe. Am I correct in my assumption? If not then I am puzzled as to why the previous example didn't work.
#6
09/09/2004 (5:24 am)
I believe that the root game folder is starter.fps or whatever you call it. All script files need to be at or below the root game directory. Only the main.cs is allowed in the same directory as the TGE.exe.

Nick
#7
09/09/2004 (5:39 am)
OK that is what I thought.
Thanks for the clarification.