Where do you place .cs files in order to run them in TGEA?
by JamesOrlando · in Torque Game Engine · 11/04/2008 (12:38 pm) · 8 replies
I'm trying to run simple test scripts in order to learn about TGEA. Whenever I try to run a script in the console I get a message that says: Missing file; but the console indicates the exact directory where the file is placed!
For example I'm trying to run a test script in the Stronghold demo, which I guess is the FPS Starter Kit in TGEA 1.7. The path to the executable is: C:\Torque\TGEA_1_7_0\GameExamples\Stronghold\game. I've tried running script files from this directory, but again the console says the file is missing. I'm guessing I'm putting the file in the wrong place. If that's the case would someone please tell me where they go? Or do I perhaps need to modify a configuration file to change a setting?
For example I'm trying to run a test script in the Stronghold demo, which I guess is the FPS Starter Kit in TGEA 1.7. The path to the executable is: C:\Torque\TGEA_1_7_0\GameExamples\Stronghold\game. I've tried running script files from this directory, but again the console says the file is missing. I'm guessing I'm putting the file in the wrong place. If that's the case would someone please tell me where they go? Or do I perhaps need to modify a configuration file to change a setting?
#2
Here's the file:
And again, the .cs file is in the same directory with the Stronghold executable. The file itself is called HelloWorld.cs.
Do I need to modify anything in the main.cs file?
11/04/2008 (1:43 pm)
Sorry I wasn't more specific. Yes, I am using the exec(...) command...I'm attempting to run the script with the command: exec("HelloWorld.cs");.Here's the file:
function HelloWorld()
// ---------------------------
// Entry point for the program
// ----------------------------
{
echo("Hello World!");
}And again, the .cs file is in the same directory with the Stronghold executable. The file itself is called HelloWorld.cs.
Do I need to modify anything in the main.cs file?
#3
Also, I suggest you use: exec("./HelloWorld.cs");
11/04/2008 (2:35 pm)
Where are you calling the exec(...)?Also, I suggest you use: exec("./HelloWorld.cs");
#4
11/04/2008 (3:13 pm)
I launch the Stronghold demo, with the barebones mission. Then I press tilde ('~') character, in order to bring up the console. I enter the command in the text field at the bottom of the window. When I enter the command Torque tells me the file is missing and I guess it shows me the path to the directory the file is expected to be in. It always says the file is missing, but it's there. Is there a path variable I need to adjust?
#5
11/04/2008 (4:42 pm)
@James - Read my above posts carefully and check your syntax vs mine.
#6
*edit*
I was actually able to run a simple script with the Barricade demo by manually calling main(), right after calling exec(...) in the command line. Found that tip from a post in the 3D Game Programming All In One thread. What I still don't understand is why the TGEA FPS Starter Kit can't see my .cs files.
11/04/2008 (9:09 pm)
Hey, not sure if you're still around, but I tried running a few test scripts in the Barricade demo. I ran the same simple "HelloWorld" test file I tried earlier. I didn't get any output, but I also didn't get any errors from the console. Not sure what to make of it.*edit*
I was actually able to run a simple script with the Barricade demo by manually calling main(), right after calling exec(...) in the command line. Found that tip from a post in the 3D Game Programming All In One thread. What I still don't understand is why the TGEA FPS Starter Kit can't see my .cs files.
#7
1. You have written a script file called HelloWorld.cs, which is in the same directory as the binary (executable)
2. Within HelloWorld.cs, is a function called HelloWorld()
3. HelloWorld function contains an echo command
4. You are testing in the Stronghold demo project
5. Once Stronghold loads, you open the console (~)
6. You type exec("./HelloWorld.cs")
From there, you receive no errors or warnings? Right?
What happens when you call HelloWorld()?
11/04/2008 (9:55 pm)
So, let's see if I understand the situation:1. You have written a script file called HelloWorld.cs, which is in the same directory as the binary (executable)
2. Within HelloWorld.cs, is a function called HelloWorld()
3. HelloWorld function contains an echo command
4. You are testing in the Stronghold demo project
5. Once Stronghold loads, you open the console (~)
6. You type exec("./HelloWorld.cs")
From there, you receive no errors or warnings? Right?
What happens when you call HelloWorld()?
#8
#1 is correct.
#2 is incorrect
In order to get my little script to work in Barricade, I typed exec("./HelloWorld.cs");main().
From there I get the missing file error, and the console shows the directory where the file is expected, but for some reason can't be found. But the file is in that directory.
To summarize: the script and console work fine with the Barricade Demo, but not with any of the demos that came with the TGEA SDK.
Thanks, man!
11/04/2008 (10:16 pm)
I have to apologize once again for failing to be more specific.#1 is correct.
#2 is incorrect
// ========================================================================
// HelloWorld.cs
//
// This module is a program that prints a simple greeting on the screen.
//
// ========================================================================
function main()
// ----------------------------------------------------
// Entry point for the program.
// ----------------------------------------------------
{
echo("Hello World");
}#3, 4 and 5 are correct.In order to get my little script to work in Barricade, I typed exec("./HelloWorld.cs");main().
From there I get the missing file error, and the console shows the directory where the file is expected, but for some reason can't be found. But the file is in that directory.
To summarize: the script and console work fine with the Barricade Demo, but not with any of the demos that came with the TGEA SDK.
Thanks, man!
Employee Michael Perry
ZombieShortbus
If not, open the TGEA Documentation, and perform a search for exec.
That should help