T2D crashing on launch
by John Cabral · in Torque Game Builder · 08/04/2005 (8:32 pm) · 5 replies
I'm working my way through the first tutorial that came with the demo, when I was debugging. Torque started to crash upon launching.
I downloaded this a few nights ago.
I uninstalled it and then started over. I know that the install worked because I was able to get it to launch before I tried to recreate the demo.
I copied all of the contents of the spacescroller/client/images/ over to T2D/client/images.
I entered the text for the part of the tutorial up through the movement controls (that's where I hit a bug).
Now, Torque won't even launch.
Windows throws up the message:
T2D.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
The following is the complete log that was created when I last tried to launch Torque2D;
Thank you in advance for your help. I'm very excited about using Torque and was having a blast before this showed up.
I downloaded this a few nights ago.
I uninstalled it and then started over. I know that the install worked because I was able to get it to launch before I tried to recreate the demo.
I copied all of the contents of the spacescroller/client/images/ over to T2D/client/images.
I entered the text for the part of the tutorial up through the movement controls (that's where I hit a bug).
Now, Torque won't even launch.
Windows throws up the message:
T2D.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
The following is the complete log that was created when I last tried to launch Torque2D;
//-------------------------- 8/4/2005 -- 22:17:26 -----
Processor Init:
Intel Pentium 4, ~2.35 Ghz
(timed at roughly 2.37 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:
keyboard0 input device created.
mouse0 input device created.
DirectInput enabled.
--------- Loading MODS ---------
Loading compiled script T2D/main.cs.
Loading compiled script common/main.cs.
Loading compiled script T2D/defaults.cs.
Compiling T2D/client/prefs.cs...
Loading compiled script T2D/client/prefs.cs.
Loading compiled script tileeditor/main.cs.
Loading compiled script tileeditor/defaults.cs.
Compiling tileeditor/client/prefs.cs...
Loading compiled script tileeditor/client/prefs.cs.
Loading compiled script particleeditor/main.cs.
Loading compiled script particleeditor/defaults.cs.
Compiling particleeditor/client/prefs.cs...
Loading compiled script particleeditor/client/prefs.cs.
--------- Parsing Arguments ---------
--------- Initializing MOD: Common ---------
Loading compiled script common/client/canvas.cs.
Loading compiled script common/client/audio.cs.
--------- Initializing MOD: T2D ---------Thank you in advance for your help. I'm very excited about using Torque and was having a blast before this showed up.
About the author
#2
I tried again. Here Re the steps that I went through.
I uninstalled the Torque2DK sdk.
I re-installed. (This is one my D: drive, fwiw).
I copied the image files from the spacescroller/client/images to T2D/client/images folder.
I turned the /T2D/client/client.cs file into the file below.
I launched the T2D exe.
I am still getting the same error. The log looks exactly like it does above.
I was able to get this to work last night before I initially ran into trouble.
08/05/2005 (5:23 am)
Sorry for not posting the code last night, I guess I forgot to hit the send button.I tried again. Here Re the steps that I went through.
I uninstalled the Torque2DK sdk.
I re-installed. (This is one my D: drive, fwiw).
I copied the image files from the spacescroller/client/images to T2D/client/images folder.
I turned the /T2D/client/client.cs file into the file below.
I launched the T2D exe.
I am still getting the same error. The log looks exactly like it does above.
I was able to get this to work last night before I initially ran into trouble.
//-----------------------------------------------------------------------------
// Torque 2D.
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
// --------------------------------------------------------------------
// Initialise Client.
// --------------------------------------------------------------------
function initialiseClient()
{
// Initialise Base Client.
InitBaseClient();
// Key-Bindings.
GlobalActionMap.bind(keyboard, tilde, ToggleConsole);
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "toggleFullScreen();");
// Initialise Canvas.
InitCanvas("T2D");
// ************************************************************************
// Load-up Demo Datablocks.
// NOTE:- Remove this is you're not interested in running the demos
// or any or the default datablocks.
// ************************************************************************
exec("./demoDatablocks.cs");
// Load-up Datablocks.
exec("./datablocks.cs");
// Load-up GUIs.
exec("./mainScreenGui.gui");
// Set GUI.
Canvas.setContent(mainScreenGui);
// Set Cursor.
Canvas.setCursor(DefaultCursor);
// Setup Scene.
setupT2DScene();
}
// --------------------------------------------------------------------
// Destroy Client.
//
// Here we destroy the SceneGraph.
// --------------------------------------------------------------------
function destroyClient()
{
// Destroy fxSceneGraph2D.
if ( isObject(t2dSceneGraph) )
t2dSceneGraph.delete();
}
// --------------------------------------------------------------------
// Setup T2D Scene.
// --------------------------------------------------------------------
function setupT2DScene()
{
// Create fxSceneGraph2D.
new fxSceneGraph2D(t2dSceneGraph);
// Associate Scenegraph with Window.
sceneWindow2D.setSceneGraph( t2dSceneGraph );
// Set Camera Position to be centered on (0,0) with
// view width/height of (100/80).
sceneWindow2D.setCurrentCameraPosition( "0 0 100 75" );
// ************************************************************************
//
// Add your custom code here...
//
// ************************************************************************
}
datablock fxImageMapDatablock2D(playershipImageMap)
{
mode = full;
textureName = "~/client/images/playerShip";
};
$player = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
$player.setPosition("-35 0");
$player.setSize( "14 7" );
$player.setImageMap( playershipImageMap );
// set up the enemy
datablock fxImageMapDatablock2D(enemyship1ImageMap)
{
mode = full;
textureName = "~/client/images/enemyship1";
};
%enemy = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
%enemy.setSize( "14 7" );
%enemy.setPosition("40 0");
%enemy.setImageMap( enemyship1ImageMap );
// move the enemy towards us.
%enemy.setLinearVelocityX(-20);
#3
You cannot define datablocks before the canvas has been initialised. Your file above results in a few functions being defined (one of which has the code to initialise the canvas in initialiseClient ) but you also initialise a couple datablocks before this function is called via "main.cs".
You should put your code inside the function setupT2DScene as indicated by the big commented section Add your custom code here... and not outside it. This function is called after the initialiseClient function has been called and is therefore safe to initialise datablocks.
You should also try to initialise datablocks in their own file, perhaps in "datablocks.cs" that is also called from the initialiseClient function.
Hope this helps,
- Melv.
08/05/2005 (6:15 am)
John,You cannot define datablocks before the canvas has been initialised. Your file above results in a few functions being defined (one of which has the code to initialise the canvas in initialiseClient ) but you also initialise a couple datablocks before this function is called via "main.cs".
You should put your code inside the function setupT2DScene as indicated by the big commented section Add your custom code here... and not outside it. This function is called after the initialiseClient function has been called and is therefore safe to initialise datablocks.
You should also try to initialise datablocks in their own file, perhaps in "datablocks.cs" that is also called from the initialiseClient function.
Hope this helps,
- Melv.
#4
Thank you very much. That got it to work again. As I'm sure you knew.... I very much appreciate the explanation. Now I understand what was going wrong.
John C.
08/05/2005 (10:47 pm)
Melv,Thank you very much. That got it to work again. As I'm sure you knew.... I very much appreciate the explanation. Now I understand what was going wrong.
John C.
#5
Glad it's working for you.
- Melv.
08/16/2005 (10:41 am)
Oh man, trying to catch-up on the forums. Been very absent lately!!Glad it's working for you.
- Melv.
Torque Owner Jason Swearingen
i recomend you start over and pay attention to what you copy/paste from the .pdf