Some problems with T2D examples
by Bruno · in Torque Game Builder · 09/12/2005 (3:27 pm) · 5 replies
Hi,
Let me start by saying, this is the first time i see a Torque product in front of me, so, i'm pretty sure i'm doing something wrong, i just don't see what.
Anyways, i started with the basic tutorial.pdf , and i'm stuck in the first lines of the script.
In the tutorial, they say to copy the contents of the "images" folder from spaceshoother to the T2d equivante, which i did.
The playerShip.png doesn't exist, so i use ship.png
In the script, client.cs i do this :
// ************************************************************************
//
// Add your custom code here...
//
// ************************************************************************
datablock fxImageMapDatablock2D(playershipImageMap)
{
mode = full;
textureName ="~/client/images/ship";
};
$player = new fxStaticSprite2D() { scenegraph = t2SceneGraph; };
$player.setPosition("-30 10");
$player.setSize("14 7");
$player.setImageMap(playershipImageMap);
}
But nothing happens, no ship, no nothing.
If i place the datablock fxImageMapDatablock2D as if it was a function, t2d.exe just crashes..
Can anyone please enlight me on what am i doing wrong here ?
thanks,
Bruno
Let me start by saying, this is the first time i see a Torque product in front of me, so, i'm pretty sure i'm doing something wrong, i just don't see what.
Anyways, i started with the basic tutorial.pdf , and i'm stuck in the first lines of the script.
In the tutorial, they say to copy the contents of the "images" folder from spaceshoother to the T2d equivante, which i did.
The playerShip.png doesn't exist, so i use ship.png
In the script, client.cs i do this :
// ************************************************************************
//
// Add your custom code here...
//
// ************************************************************************
datablock fxImageMapDatablock2D(playershipImageMap)
{
mode = full;
textureName ="~/client/images/ship";
};
$player = new fxStaticSprite2D() { scenegraph = t2SceneGraph; };
$player.setPosition("-30 10");
$player.setSize("14 7");
$player.setImageMap(playershipImageMap);
}
But nothing happens, no ship, no nothing.
If i place the datablock fxImageMapDatablock2D as if it was a function, t2d.exe just crashes..
Can anyone please enlight me on what am i doing wrong here ?
thanks,
Bruno
About the author
#2
out side of the method and it makes T2D.exe have a runtime error, should I report this as a bug? It definitly should NOT have this kind of error but a script compile error.
The tutorial just wasn't specific enough, it talks about "custom code here" but me being a non C++, and other languages dev, I assumed that the datablock line was more like a declaration of a method of sorts so my brain told me to put it outside and the other code below that. I've since fixed it.
09/12/2005 (7:15 pm)
I followed the tutorial also. I though placed all the code: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);out side of the method and it makes T2D.exe have a runtime error, should I report this as a bug? It definitly should NOT have this kind of error but a script compile error.
The tutorial just wasn't specific enough, it talks about "custom code here" but me being a non C++, and other languages dev, I assumed that the datablock line was more like a declaration of a method of sorts so my brain told me to put it outside and the other code below that. I've since fixed it.
#3
09/12/2005 (8:11 pm)
Just a tip to help in the future, if you have problems with T2D grab the text from the console.log file (in the same place as the exe file) and paste it on the boards, that will pinpoint your error and others will know better to explain the issue :)
#4
Steve De George : I had the same problem and i'm a C++ guy, i assumed that the datablock was a function definition of some kind, and initially used it outside too, and also makes t2d.exe crash.
Matthew "King Tut" Langley : Thanks, i wasn't aware of the console.log , it will be a great help to track down errors.
09/13/2005 (2:01 am)
Aaron Wieland : Thanks, that was indeed the problem :)Steve De George : I had the same problem and i'm a C++ guy, i assumed that the datablock was a function definition of some kind, and initially used it outside too, and also makes t2d.exe crash.
Matthew "King Tut" Langley : Thanks, i wasn't aware of the console.log , it will be a great help to track down errors.
#5
09/13/2005 (9:25 am)
I did check that file but all it had was the "Compile client.cs" (or the equivelent) and nothing else.. :)
Torque Owner Aaron Wieland
There's a typo in this line:
$player = new fxStaticSprite2D() { scenegraph = t2SceneGraph; };Replace "t2SceneGraph" with "t2dSceneGraph". There's probably an error message to that effect in the console.