Game Development Community

Creating an .EXE file ?

by Nicolas Schuele · in Torque Game Engine · 06/26/2006 (2:07 pm) · 16 replies

Hi,

Sorry in advance because I'm sure the question has been asked 1'032 times...

I just bought TGE and did read a bit about TorqueScript (getting the 3DGPAI1 book but not here yet).

I create a new file I name "hello.cs". Inside there are these four lines :

//*************
function Main()
{
print("Hello");
}
//*************


Now... what the hell am I supposed to do to get a "hello.exe" out of this ?

I don't know much about C++ (but I'm a C# coder so I have VS2003 & VS2005) and the fact I can learn an easy version of the C/C++ (aka TorqueScript) to make little 3D apps is quite appealing... ...I just can't figure out how to execute my script :-)

Thanks for your answers !

About the author

Recent Threads


#1
06/26/2006 (2:45 pm)
The script is executed by the engine.

so you would load the engine up, and you can issue a command to the console while in game
or you can have a different script execute your script for you.

I believe the command is :
exec("your crazy path to file");

your going to want to spend some time analyzing how the path is picked up so you can make sure you use the correct path to your script.

lots of fun stuff to learn here I'm sure you will have a blast with it.
#2
06/27/2006 (2:47 pm)
Thank you for your answer, will look into it.

I was especially wondering that the hypotetical day I release some valid piece of code I want to share... ...what's the best way to do it if you can't distribute executable files ?

If I'm not mistaken, all the games and demos featured on garagegames website are distributed as .exe files.
#3
06/27/2006 (2:51 pm)
The engine is distributed as an EXEcutable file. The script files are .cs or .dso (compiled). The engine is written in C++, the script files are written in TorqueScript.
#4
06/28/2006 (1:40 am)
Yep, that I figured out. My question is how do you compile and distribute a game made using TGE and written in TorqueScript ?

Let's take my example in the first post. Let's say I want to release my 'Hello World' to the public. What's the procedure ?
#5
06/28/2006 (4:39 am)
You use your TGE exe and dsitribute your .cs file with it.
#6
06/28/2006 (4:54 am)
Ok, I get it. So, I can create a .bat file with 'tge hello.cs' in it.

Now... ...where in the directory structure do I find tge.exe ? I can't seem to find it :-O
#7
06/28/2006 (6:24 am)
It's actually called torquedemo.exe, and it's under the examples folder. You can just rename it.
#8
08/09/2006 (11:24 pm)
EDIT: I don't know what I was talking about here, but it didn't fit. :/
#9
10/16/2006 (10:52 am)
@Martin de Richeliu:

hi, so you mean that I have to rename torquedemo.exe and change the icon to get my game exe?

Is there a place where I can get specific procedures to make an exe? I mean, if below cited is the case, how can I get rid of the TGE menu so player is limited to see and play the game?

Thanks
#10
10/16/2006 (11:14 am)
If you look in the main.cs file, it specifies which "mod" to load. It defaults to "demo" but can be changed using -game yourname; you can also edit main.cs to specify your game by default.

In general, I suggest starting with the early tutorials for using TorqueScript, such as the "tutorial.base" tutorial. It will gently guide you into how the control flow of Torque works. Or you can wait for the book.

Torque is not a programming language. Torque is an environment that you need to immerse your game in; it's a lifestyle choice, not a utility library.
#11
10/16/2006 (11:21 am)
Thanks! So I will wait for the Maurina book to try to understand this "lifestyle" choice ;) because the tutorial doesn't explain anything about exe files.
#12
10/16/2006 (11:39 am)
Part of that is because whenever you run a Torque game, you run the executable which then compiles and interprets the scripts. If you never need to change the core engine, then renaming the executable works. If you do, you will need to recompile the engine. The books currently out work with scripts and do not require such engine changes so you will use the same executable as before.
#13
10/16/2006 (12:27 pm)
Ok, I understand now: If I don't want to change the engine I don't need a compiler. I have to change the name of the torquedemo.exe and the icon. Is this right? Well, I have copy my game to a new folder, and I have copied common, creator and editor folders as well. Then I try to run the game and I get the following message:

"You do not have the correct version of the Torque Game Engine or the related art needed to connect to this server. Please contact the server operator to obtain the latest version of this game. (Invalid Packet)."

Can somebody tell what I'm missing?

Thanks in advance
#14
10/16/2006 (1:17 pm)
Make sure that your textures and your DIFs are in the same folder.
#15
10/24/2006 (9:18 am)
Thanks David,

I have discovered that if I open the console I can see the actual compiling errors.
#16
10/24/2006 (1:17 pm)
Issaac:
Quote:If I don't want to change the engine I don't need a compiler. I have to change the name of the torquedemo.exe and the icon. Is this right?

yes. the engine will compile your scripts when you launch the game. when you release your game you just delete the scripts and leave the compiled .dso files. also when developing its a good idea to delete the .dso's after making changes to your scripts. theres a .bat files that does this for you in the examples folder.