Game Development Community

Missing File Error

by delinkx · in Technical Issues · 08/07/2008 (2:53 am) · 8 replies

I am running the Torque Tutorial Base. and the console,

my single commands are working. when i try this:

exec(mygame/helloworld.cs);

it gives me this error:

Missing File: -1.#IND!

in the example folder where am running the Torque Demo, i have created a folder named mygame and put the file helloworld.cs there.

but i donno y its not running.

plz help.. am new to torque.

#1
08/07/2008 (3:07 am)
The only thing you forgot to do was add your double quotes (") around your mygame/helloworld.cs ... they are required as the exec command takes a string parameter to the file you want to exec.

==>exec("mygame/helloworld.cs");
Hello World!

Without it you get your error:
==>exec(mygame/helloworld.cs);
Missing file: D:/Development/Garage Games/TGEA - Demos/src/TGEA 1.7.1/GameExamples/Stronghold/game/-1.#IND!
#2
08/07/2008 (3:13 am)
Ok.. i did tat..

first i did the compile

compile("mygame/helloworld.cd");

it gets stuck there only .. writing "Compiling mygame/helloworld.cs.... " in the console window. and remains like this.

and when i try exec(mygame/helloworld.cs);

it gives:Loading compiled script mygame/helloworld.cs.

and do nothing abt it.
#3
08/07/2008 (3:19 am)
What exactly do you have in your "helloworld.cs" file?
#4
08/07/2008 (3:25 am)
Function main()

{
print("Hello World");
}


this is wat i have in the file. tats all.
#5
08/07/2008 (3:35 am)
That is never going to work.

1). You should change the keyword "Function" to "function".

2). There is no built in function in Torque called print. You need to use echo to output stuff to the console.

3). Torque does not automatically execute functions ... you have to actually call the function.

Your code should look like this:
function main() {
  echo("Hello World");
}

To automatically execute your function add the following under neath the function:
main();

Or you could just run the following sequence from your console:
==>exec("mygame/helloworld.cs");
==>main();
Hello World
#6
08/07/2008 (3:44 am)
Kool..

i was following an example from the book 3D game programming all-in-one.. but i guess he is using a mod of Torque in tat.. tats y his code are like this.

i am using the Full Torque Engine.

Thnx.

i think i need go through other tutorials as this book's code are different and will run only on its engine.

can u give me a startup on some tutorials for using TorqueScript to get started.

I want to create a plain terrain. And load the players and objects through script. Can u tell me some good tutorial for me to get started on the Torque.

Thnx
#7
08/07/2008 (4:06 am)
I can't recall the names of the simple tutorials off hand, but if you search through the resources you should find what you are looking for.

I learnt TorqueScript and the Torque Engine but taking original Demos and modifying them to meet my needs. I also implemented numerous resources from this site in my game Soul Wars. The best way to learn is by taking stuff and modifiying them.

One of my side projects that I am busy with now (in conjunction with the above-mentioned one) is to build a Demo from scratch with only the base fundamentals.
#8
08/07/2008 (5:07 am)
From what I understand, the engine that comes with that book is modified, but it's not to have a print function; his runHelloWorld function uses echo.