Hello World Help
by Stacey Mickens · in Torque Game Engine · 09/27/2005 (1:20 pm) · 11 replies
Okay I am on week three and still stuck with the hello world program not compiling. I have posted and some people have replied saying that there is already a thread about that but when I went to the link once the person figured out what the problem was they never posted how they solved it. I make my hello.cs file and then go to compile it I check in the console.log to make sure it's not errorring but it show s no errors. And to be honest I am getting really really discouraged. I have emailed asking questions No reply, contacted support still waiting, called no answer. I'm starting to second guess my investment. I guess cause I am use to sitting down at something and I am able to figure it out after playing with it. It shouldn't take me three weeks trying to figure out why the code is right it isn't showing up. Mainly a simple 'hello world' type program. Nothing major. Sorry to ramble on just frustrated, upset just not a happy camper at the moment. So anyone that can help please.
About the author
#2
Here is the code:
///////////////////////////////////////////////////
//Helloworld.cs
//Stacey Y. Mickens
//////////////////////////////////////////////////
function main()
{
print("Hello World!! How are you doing?");
}
In the folder is shows that it have a .dso made but it doesn't show me my helloworld.cs code
Here is the console.log
//-------------------------- 9/27/2005 -- 19:03:48 -----
Processor Init:
Intel Pentium 4, ~2.00 Ghz
(timed at roughly 1.98 Ghz)
FPU detected
MMX detected
SSE detected
Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions
Input Init:
DirectInput not enabled.
--------- Loading MODS ---------
Loading compiled script starter.fps/main.cs.
Loading compiled script common/main.cs.
Missing file: common/defaults.cs!
Loading compiled script starter.fps/client/defaults.cs.
Loading compiled script starter.fps/server/defaults.cs.
Compiling starter.fps/client/prefs.cs...
Loading compiled script starter.fps/client/prefs.cs.
Compiling starter.fps/server/prefs.cs...
Loading compiled script starter.fps/server/prefs.cs.
--------- Parsing Arguments ---------
--------- Initializing MOD: Common ---------
Loading compiled script common/client/canvas.cs.
Loading compiled script common/client/audio.cs.
--------- Initializing MOD: FPS Starter Kit ---------
Loading compiled script starter.fps/client/init.cs.
Loading compiled script starter.fps/server/init.cs.
Loading compiled script starter.fps/data/init.cs.
Loading compiled script starter.fps/data/terrains/grassland/propertyMap.cs.
Missing file: starter.fps/data/terrains/scorched/propertyMap.cs!
09/27/2005 (4:12 pm)
The file is saved as Hello.csHere is the code:
///////////////////////////////////////////////////
//Helloworld.cs
//Stacey Y. Mickens
//////////////////////////////////////////////////
function main()
{
print("Hello World!! How are you doing?");
}
In the folder is shows that it have a .dso made but it doesn't show me my helloworld.cs code
Here is the console.log
//-------------------------- 9/27/2005 -- 19:03:48 -----
Processor Init:
Intel Pentium 4, ~2.00 Ghz
(timed at roughly 1.98 Ghz)
FPU detected
MMX detected
SSE detected
Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions
Input Init:
DirectInput not enabled.
--------- Loading MODS ---------
Loading compiled script starter.fps/main.cs.
Loading compiled script common/main.cs.
Missing file: common/defaults.cs!
Loading compiled script starter.fps/client/defaults.cs.
Loading compiled script starter.fps/server/defaults.cs.
Compiling starter.fps/client/prefs.cs...
Loading compiled script starter.fps/client/prefs.cs.
Compiling starter.fps/server/prefs.cs...
Loading compiled script starter.fps/server/prefs.cs.
--------- Parsing Arguments ---------
--------- Initializing MOD: Common ---------
Loading compiled script common/client/canvas.cs.
Loading compiled script common/client/audio.cs.
--------- Initializing MOD: FPS Starter Kit ---------
Loading compiled script starter.fps/client/init.cs.
Loading compiled script starter.fps/server/init.cs.
Loading compiled script starter.fps/data/init.cs.
Loading compiled script starter.fps/data/terrains/grassland/propertyMap.cs.
Missing file: starter.fps/data/terrains/scorched/propertyMap.cs!
#3
Loading compiled script common/server/audio.cs.
Loading compiled script common/server/server.cs.
Loading compiled script common/server/message.cs.
Loading compiled script common/server/commands.cs.
Loading compiled script common/server/missionInfo.cs.
Loading compiled script common/server/missionLoad.cs.
Loading compiled script common/server/missionDownload.cs.
Loading compiled script common/server/clientConnection.cs.
Loading compiled script common/server/kickban.cs.
Loading compiled script common/server/game.cs.
Loading compiled script starter.fps/server/scripts/commands.cs.
Loading compiled script starter.fps/server/scripts/centerPrint.cs.
Loading compiled script starter.fps/server/scripts/game.cs.
--------- Initializing MOD: FPS Starter Kit: Client ---------
Loading compiled script starter.fps/client/ui/customProfiles.cs.
Loading compiled script common/client/message.cs.
Loading compiled script common/client/mission.cs.
Loading compiled script common/client/missionDownload.cs.
Loading compiled script common/client/actionMap.cs.
Loading compiled script common/editor/editor.cs.
Loading compiled script common/editor/particleEditor.cs.
Loading compiled script common/client/scriptDoc.cs.
Video Init:
Accelerated OpenGL display device detected.
Accelerated D3D device detected.
Voodoo 2 display device not detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 800x600x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: Intel
Renderer: Intel 845G
Version: 1.3.0 - Build 4.14.10.4020
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 4)
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
3DFX_texture_compression_FXT1
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 2.000000)
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
WGL_EXT_swap_control
Loading compiled script common/ui/defaultProfiles.cs.
Loading compiled script common/ui/GuiEditorGui.gui.
Loading compiled script common/ui/ConsoleDlg.gui.
Loading compiled script common/ui/InspectDlg.gui.
Loading compiled script common/ui/InspectAddFieldDlg.gui.
Loading compiled script common/ui/LoadFileDlg.gui.
Loading compiled script common/ui/SaveFileDlg.gui.
Loading compiled script common/ui/MessageBoxOkDlg.gui.
Loading compiled script common/ui/MessageBoxYesNoDlg.gui.
Loading compiled script common/ui/MessageBoxOKCancelDlg.gui.
Loading compiled script common/ui/MessagePopupDlg.gui.
Loading compiled script common/ui/HelpDlg.gui.
Loading compiled script common/ui/RecordingsDlg.gui.
Loading compiled script common/ui/NetGraphGui.gui.
Loading compiled script common/client/metrics.cs.
Loading compiled script common/ui/FrameOverlayGui.gui.
Loading compiled script common/client/messageBox.cs.
Loading compiled script common/client/screenshot.cs.
Loading compiled script common/client/cursor.cs.
Loading compiled script common/client/help.cs.
Loading compiled script common/client/recordings.cs.
OpenAL Driver Init:
OpenAL
Vendor: Creative Labs Inc.
Version: OpenAL 1.0
Renderer: Software
Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3
09/27/2005 (4:13 pm)
--------- Initializing MOD: FPS Starter Kit: Server ---------Loading compiled script common/server/audio.cs.
Loading compiled script common/server/server.cs.
Loading compiled script common/server/message.cs.
Loading compiled script common/server/commands.cs.
Loading compiled script common/server/missionInfo.cs.
Loading compiled script common/server/missionLoad.cs.
Loading compiled script common/server/missionDownload.cs.
Loading compiled script common/server/clientConnection.cs.
Loading compiled script common/server/kickban.cs.
Loading compiled script common/server/game.cs.
Loading compiled script starter.fps/server/scripts/commands.cs.
Loading compiled script starter.fps/server/scripts/centerPrint.cs.
Loading compiled script starter.fps/server/scripts/game.cs.
--------- Initializing MOD: FPS Starter Kit: Client ---------
Loading compiled script starter.fps/client/ui/customProfiles.cs.
Loading compiled script common/client/message.cs.
Loading compiled script common/client/mission.cs.
Loading compiled script common/client/missionDownload.cs.
Loading compiled script common/client/actionMap.cs.
Loading compiled script common/editor/editor.cs.
Loading compiled script common/editor/particleEditor.cs.
Loading compiled script common/client/scriptDoc.cs.
Video Init:
Accelerated OpenGL display device detected.
Accelerated D3D device detected.
Voodoo 2 display device not detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 800x600x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: Intel
Renderer: Intel 845G
Version: 1.3.0 - Build 4.14.10.4020
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 4)
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
3DFX_texture_compression_FXT1
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 2.000000)
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
WGL_EXT_swap_control
Loading compiled script common/ui/defaultProfiles.cs.
Loading compiled script common/ui/GuiEditorGui.gui.
Loading compiled script common/ui/ConsoleDlg.gui.
Loading compiled script common/ui/InspectDlg.gui.
Loading compiled script common/ui/InspectAddFieldDlg.gui.
Loading compiled script common/ui/LoadFileDlg.gui.
Loading compiled script common/ui/SaveFileDlg.gui.
Loading compiled script common/ui/MessageBoxOkDlg.gui.
Loading compiled script common/ui/MessageBoxYesNoDlg.gui.
Loading compiled script common/ui/MessageBoxOKCancelDlg.gui.
Loading compiled script common/ui/MessagePopupDlg.gui.
Loading compiled script common/ui/HelpDlg.gui.
Loading compiled script common/ui/RecordingsDlg.gui.
Loading compiled script common/ui/NetGraphGui.gui.
Loading compiled script common/client/metrics.cs.
Loading compiled script common/ui/FrameOverlayGui.gui.
Loading compiled script common/client/messageBox.cs.
Loading compiled script common/client/screenshot.cs.
Loading compiled script common/client/cursor.cs.
Loading compiled script common/client/help.cs.
Loading compiled script common/client/recordings.cs.
OpenAL Driver Init:
OpenAL
Vendor: Creative Labs Inc.
Version: OpenAL 1.0
Renderer: Software
Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3
#4
Loading compiled script starter.fps/client/ui/defaultGameProfiles.cs.
Loading compiled script starter.fps/client/ui/PlayGui.gui.
Loading compiled script starter.fps/client/ui/ChatHud.gui.
Loading compiled script starter.fps/client/ui/playerList.gui.
Loading compiled script starter.fps/client/ui/mainMenuGui.gui.
Missing file: starter.fps/client/ui/QuitGui.gui!
Loading compiled script starter.fps/client/ui/aboutDlg.gui.
Loading compiled script starter.fps/client/ui/startMissionGui.gui.
Loading compiled script starter.fps/client/ui/joinServerGui.gui.
Loading compiled script starter.fps/client/ui/loadingGui.gui.
Loading compiled script starter.fps/client/ui/endGameGui.gui.
Loading compiled script starter.fps/client/ui/optionsDlg.gui.
Loading compiled script starter.fps/client/ui/remapDlg.gui.
Loading compiled script starter.fps/client/ui/StartupGui.gui.
Loading compiled script starter.fps/client/ui/HelloWorld.gui.
Loading compiled script starter.fps/client/ui/Credit.gui.
Loading compiled script starter.fps/client/scripts/client.cs.
Loading compiled script starter.fps/client/scripts/game.cs.
Loading compiled script starter.fps/client/scripts/missionDownload.cs.
Loading compiled script starter.fps/client/scripts/serverConnection.cs.
Loading compiled script starter.fps/client/scripts/playerList.cs.
Loading compiled script starter.fps/client/scripts/loadingGui.cs.
Loading compiled script starter.fps/client/scripts/optionsDlg.cs.
Loading compiled script starter.fps/client/scripts/chatHud.cs.
Loading compiled script starter.fps/client/scripts/messageHud.cs.
Loading compiled script starter.fps/client/scripts/playGui.cs.
Loading compiled script starter.fps/client/scripts/centerPrint.cs.
Loading compiled script starter.fps/client/scripts/Hello.cs.
Loading compiled script starter.fps/client/scripts/default.bind.cs.
Compiling starter.fps/client/config.cs...
Loading compiled script starter.fps/client/config.cs.
Binding server port to default IP
UDP initialized on port 0
Unable to locate audio profile 'AudioStartup'
Engine initialized...
*** Load Main Menu
Exporting client prefs
Exporting client config
Exporting server prefs
Exporting client prefs
Exporting server prefs
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context
09/27/2005 (4:13 pm)
Loading compiled script starter.fps/client/scripts/audioProfiles.cs.Loading compiled script starter.fps/client/ui/defaultGameProfiles.cs.
Loading compiled script starter.fps/client/ui/PlayGui.gui.
Loading compiled script starter.fps/client/ui/ChatHud.gui.
Loading compiled script starter.fps/client/ui/playerList.gui.
Loading compiled script starter.fps/client/ui/mainMenuGui.gui.
Missing file: starter.fps/client/ui/QuitGui.gui!
Loading compiled script starter.fps/client/ui/aboutDlg.gui.
Loading compiled script starter.fps/client/ui/startMissionGui.gui.
Loading compiled script starter.fps/client/ui/joinServerGui.gui.
Loading compiled script starter.fps/client/ui/loadingGui.gui.
Loading compiled script starter.fps/client/ui/endGameGui.gui.
Loading compiled script starter.fps/client/ui/optionsDlg.gui.
Loading compiled script starter.fps/client/ui/remapDlg.gui.
Loading compiled script starter.fps/client/ui/StartupGui.gui.
Loading compiled script starter.fps/client/ui/HelloWorld.gui.
Loading compiled script starter.fps/client/ui/Credit.gui.
Loading compiled script starter.fps/client/scripts/client.cs.
Loading compiled script starter.fps/client/scripts/game.cs.
Loading compiled script starter.fps/client/scripts/missionDownload.cs.
Loading compiled script starter.fps/client/scripts/serverConnection.cs.
Loading compiled script starter.fps/client/scripts/playerList.cs.
Loading compiled script starter.fps/client/scripts/loadingGui.cs.
Loading compiled script starter.fps/client/scripts/optionsDlg.cs.
Loading compiled script starter.fps/client/scripts/chatHud.cs.
Loading compiled script starter.fps/client/scripts/messageHud.cs.
Loading compiled script starter.fps/client/scripts/playGui.cs.
Loading compiled script starter.fps/client/scripts/centerPrint.cs.
Loading compiled script starter.fps/client/scripts/Hello.cs.
Loading compiled script starter.fps/client/scripts/default.bind.cs.
Compiling starter.fps/client/config.cs...
Loading compiled script starter.fps/client/config.cs.
Binding server port to default IP
UDP initialized on port 0
Unable to locate audio profile 'AudioStartup'
Engine initialized...
*** Load Main Menu
Exporting client prefs
Exporting client config
Exporting server prefs
Exporting client prefs
Exporting server prefs
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context
#5
Then I go into the command prompt and
type -> c:/torque/sdk/example/torqueDemo -stacey hello.cs
but all it do is load up starter.fps screen and i don't see hello anywhere on there.
Then I tried going into the main.cs that is in the example folder location and redirecting my default game to my folder (Stacey) rename Hello.cs to main.cs then run using command -> c:/torque/sdk/example/torquedemo -stacey main.cs then the cursor just sits there. After a moment I quit and this is what the console says
//-------------------------- 9/27/2005 -- 19:22:19 -----
Processor Init:
Intel Pentium 4, ~2.00 Ghz
(timed at roughly 1.99 Ghz)
FPU detected
MMX detected
SSE detected
Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions
Input Init:
DirectInput not enabled.
--------- Loading MODS ---------
Compiling stacey/main.cs...
Loading compiled script stacey/main.cs.
--------- Parsing Arguments ---------
and i see that a main.cs.dso is created but still I have nothing to show for my code.
09/27/2005 (4:24 pm)
That is one way that I tried it the other way was I made my own folder named it stacey and then place hello.cs into it. Then I go into the command prompt and
type -> c:/torque/sdk/example/torqueDemo -stacey hello.cs
but all it do is load up starter.fps screen and i don't see hello anywhere on there.
Then I tried going into the main.cs that is in the example folder location and redirecting my default game to my folder (Stacey) rename Hello.cs to main.cs then run using command -> c:/torque/sdk/example/torquedemo -stacey main.cs then the cursor just sits there. After a moment I quit and this is what the console says
//-------------------------- 9/27/2005 -- 19:22:19 -----
Processor Init:
Intel Pentium 4, ~2.00 Ghz
(timed at roughly 1.99 Ghz)
FPU detected
MMX detected
SSE detected
Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions
Input Init:
DirectInput not enabled.
--------- Loading MODS ---------
Compiling stacey/main.cs...
Loading compiled script stacey/main.cs.
--------- Parsing Arguments ---------
and i see that a main.cs.dso is created but still I have nothing to show for my code.
#6
or
or
I do recall print being used in the book "3D Game Programming All In One" though, but the code base it is using is TGE 1.2
The other thing is, that in order for a function to execute, it must be called - so after it is compiled, you need to execute (call) it by:
Edit: The reason you are not getting any errors is, that your code syntax is perfectly fine - the engine doesn't check if there actually is a function called "print" when it compiles your Hello.cs file but if you try to execute main(); as is (if you are using TGE 1.3 or above), you would find that an error does show up, saying that "print" is an unknown function.
09/27/2005 (5:12 pm)
One thing that comes to mind is, that the command print is not a script function in TGE 1.3 as far as I know. The command to send text to the console is:echo("Your text goes here");or
warn("Your text goes here");or
error("Your text goes here");I do recall print being used in the book "3D Game Programming All In One" though, but the code base it is using is TGE 1.2
The other thing is, that in order for a function to execute, it must be called - so after it is compiled, you need to execute (call) it by:
main();
Edit: The reason you are not getting any errors is, that your code syntax is perfectly fine - the engine doesn't check if there actually is a function called "print" when it compiles your Hello.cs file but if you try to execute main(); as is (if you are using TGE 1.3 or above), you would find that an error does show up, saying that "print" is an unknown function.
#7
You'll notice that it returns the error: "Unable to find function print." Print works in basic, but not in TorqueScript (unless you make a print print yourself).
Now go back to the console and try the following: echo("Hello World!! How are you doing?");
This time you'll see the results "printed" or echoed to the console log.
Now go to your mod and start up the game (the one where you made your own main.cs file). Go to the console again (~), and type: main();
You'll probably see it complant about the print error, like above. Your "main" function was probably never even called, even though it was defined...
If you were expecting a window to pop up with the text from the print command, you may need to start by learning about windowing systems. New windows programmers can often be confused by how complicated a "Hello World" example can get when you have to create the window first... Similarly, you will need to read more about how to make a GUI in the Torque documents before getting a window to pop up. (If you weren't expecting a window to pop up, ingore this and pretent I never said it, please...)
As a good starting point, I recommend the book 3D Game Programming All In One -- it will step you through making a game in TorqueScript. Read the threads and resources about it... Also, there are some excellent tutorials and resources listed at www.garagegames.com/mg/projects/tge/. There's an entire section of tutorials for modifying the starter kits -- the perfect place to start. When I first started, I found the Paladin tutorials particularly enlightening.
Hang in there -- it's worth working through the initial frustration if you're serious about making a game. You're in the right place to learn. We've all been there, and there is light at the end of the tunnel.
09/27/2005 (5:27 pm)
First of all, go into the unmodified starter.fps example, and during gameplay type the tilde key (~) to see the console. The console lets you play areound with commands in real-time and see the results -- a great debugging tool to see if what you're trying to do even works in TorqueScript... Anyway, In the console type this line and hit enter: print("Hello World!! How are you doing?"); You'll notice that it returns the error: "Unable to find function print." Print works in basic, but not in TorqueScript (unless you make a print print yourself).
Now go back to the console and try the following: echo("Hello World!! How are you doing?");
This time you'll see the results "printed" or echoed to the console log.
Now go to your mod and start up the game (the one where you made your own main.cs file). Go to the console again (~), and type: main();
You'll probably see it complant about the print error, like above. Your "main" function was probably never even called, even though it was defined...
If you were expecting a window to pop up with the text from the print command, you may need to start by learning about windowing systems. New windows programmers can often be confused by how complicated a "Hello World" example can get when you have to create the window first... Similarly, you will need to read more about how to make a GUI in the Torque documents before getting a window to pop up. (If you weren't expecting a window to pop up, ingore this and pretent I never said it, please...)
As a good starting point, I recommend the book 3D Game Programming All In One -- it will step you through making a game in TorqueScript. Read the threads and resources about it... Also, there are some excellent tutorials and resources listed at www.garagegames.com/mg/projects/tge/. There's an entire section of tutorials for modifying the starter kits -- the perfect place to start. When I first started, I found the Paladin tutorials particularly enlightening.
Hang in there -- it's worth working through the initial frustration if you're serious about making a game. You're in the right place to learn. We've all been there, and there is light at the end of the tunnel.
#8
The TorqueDemo.exe program will always look for a "main.cs" file to start from. So using a file "helloworld.cs" instead of "main.cs" won't work.
If you rename "helloworld.cs" to "main.cs" and then try to run the TorqueDemo.exe program from the same directory, it won't work either. The main reason is that there is nothing in the script to first create a visible window for the text to be displayed in. Also, there is no "print" function in Torque as far as I know. That might be something that was coded into the tge.exe program for the purposes of the book.
Instead of printing to a window, you can instead direct your output to the console using the echo command. You can view the output to the console by opening up the console.log file...assuming you've turned on logging.
A basic "hello, world" script that will work with the TorqueDemo.exe program is as follows (name it main.cs and put it in the same directory as the TorqueDemo.exe program):
The first line turns on logging, the second line outputs the text to the console, and the third line quits the program. The quit() function will look for a function called onExit(), but we didn't define one, so there will be an error in the console.log, but that's okay.
Hope that helps.
09/27/2005 (6:08 pm)
The problem, if I understand it correctly, stems from the fact that you're trying to run the example scripts in the Book using the TorqueDemo.exe program from the SDK. The executable that comes with the book (usually referred to as tge.exe) is different from the TorqueDemo.exe program created with the SDK.The TorqueDemo.exe program will always look for a "main.cs" file to start from. So using a file "helloworld.cs" instead of "main.cs" won't work.
If you rename "helloworld.cs" to "main.cs" and then try to run the TorqueDemo.exe program from the same directory, it won't work either. The main reason is that there is nothing in the script to first create a visible window for the text to be displayed in. Also, there is no "print" function in Torque as far as I know. That might be something that was coded into the tge.exe program for the purposes of the book.
Instead of printing to a window, you can instead direct your output to the console using the echo command. You can view the output to the console by opening up the console.log file...assuming you've turned on logging.
A basic "hello, world" script that will work with the TorqueDemo.exe program is as follows (name it main.cs and put it in the same directory as the TorqueDemo.exe program):
setLogMode(6);
echo("Hello, world!\n");
quit();The first line turns on logging, the second line outputs the text to the console, and the third line quits the program. The quit() function will look for a function called onExit(), but we didn't define one, so there will be an error in the console.log, but that's okay.
Hope that helps.
#9
The code you posted looks good.
The book's executable is a stock Torque 1.2 executable. It's the scripts that are diffferent. Jacob, Jasin & Rubes. As valid as your statements are (and they are) about echo, warn, etc., the point of the exercise the book is completely different from what you are assuming.
09/27/2005 (6:29 pm)
Stacey, you need to make sure that you've followed the chapter 2 instructions in the book correctly, and that you've correctly installed Torque from the book's CD using the installer. You cannot complete the Chapter 2 exercises using a standard Torque setup.The code you posted looks good.
The book's executable is a stock Torque 1.2 executable. It's the scripts that are diffferent. Jacob, Jasin & Rubes. As valid as your statements are (and they are) about echo, warn, etc., the point of the exercise the book is completely different from what you are assuming.
#10
09/27/2005 (10:14 pm)
@Ken: Interesting. I'm doing the book using a Mac, so I've had to work around the usual process using the console and a stock 1.3 executable. I thought you had modifed the tge executable, but I guess you have other scripts that are installed alongside the executable, is that right?
#11
09/28/2005 (7:29 am)
Thx everyone. I was so excited with getting the torque engine that I wasn't patient enough to wait for the book to get shipped to me so I got the ebook. But course technology have been quite nice in putting the resources that I needed up on a ftp server for me to get. So I can call and request for the version that you give with the book. Plus it's easier for me to read at work instead of lugging around a big heavy book.
Torque 3D Owner Matthew Langley
Torque