Basic Tutorial error
by Tomas Dahle · in Torque Game Builder · 03/17/2005 (10:01 am) · 8 replies
Hi,
I'm sure someone has noticed this long ago (because the freshest fourteen pages of forum posts mentioned nothing of it), but with my zero knowledge of Torquescript and how this engine works it took me a couple of hours to figure out that
First, nothing happened, the game just acted like I never wrote any move-up code. Then after a while I realized that no matter what changes I made to the code nothing changed, so I figured some older precompiled thingamabobs were being used. Then it took me quite some time to figure out it was this one faulty line of code (which I had copied straight out of the tutorial mind you) that would make the engine silently bypass parsing of my script and use the last compiled version.
Now I know very well this is an early adopter release and maybe not targeted at people that has never touched TGE, so instead of vexing the hard working developers of T2D I'll just request that some sort of notice about this Tutorial-error is put up somewhere. Why not put an errata at the same page you wrote about how to not distribute unwanted parts of the engine? At least thats the first place I went to figure out what on earth was wrong with the code I pasted from the tutorial :)
Additionally, when a script has syntax errors like mine had, is it possible to make the engine give some feedback about this? Right now I have a batch-file that deletes all dso-files so that the engine crashes if something is wrong, but this seems a bit silly ;)
I'm sure someone has noticed this long ago (because the freshest fourteen pages of forum posts mentioned nothing of it), but with my zero knowledge of Torquescript and how this engine works it took me a couple of hours to figure out that
Quote:causes some rather unwanted behaviour. (It should be -10 not -$10)
// Set the player moving up.
$player.setLinearVelocityY( -$10 );
First, nothing happened, the game just acted like I never wrote any move-up code. Then after a while I realized that no matter what changes I made to the code nothing changed, so I figured some older precompiled thingamabobs were being used. Then it took me quite some time to figure out it was this one faulty line of code (which I had copied straight out of the tutorial mind you) that would make the engine silently bypass parsing of my script and use the last compiled version.
Now I know very well this is an early adopter release and maybe not targeted at people that has never touched TGE, so instead of vexing the hard working developers of T2D I'll just request that some sort of notice about this Tutorial-error is put up somewhere. Why not put an errata at the same page you wrote about how to not distribute unwanted parts of the engine? At least thats the first place I went to figure out what on earth was wrong with the code I pasted from the tutorial :)
Additionally, when a script has syntax errors like mine had, is it possible to make the engine give some feedback about this? Right now I have a batch-file that deletes all dso-files so that the engine crashes if something is wrong, but this seems a bit silly ;)
About the author
#2
03/17/2005 (12:06 pm)
Thingy = ~ tilde
#3
03/17/2005 (12:28 pm)
Tidle is on the other side of my kb i use
#4
03/17/2005 (1:05 pm)
Most gamers and developers are familiar with the good old console-button. I've always called it a 'thingy' as well :)
#5
03/17/2005 (2:05 pm)
Always seemed a fitting name :)
#6
Top of page 18
=====================================
%enemy.setPosition("40" SPC (-30 + (getRandom() * 60)));
----------
should be:
----------
%enemy.setPosition("40" SPC (-30 + (getRandom() * 60));
=====================================
Middle of page 19
======================================
"Next, we call the "setCollisionScale()" method. This is an advanced function,"
#### In the preceeding code block, there is no call to setCollisionScale() ####
#### Also, documentation does not mention
$player.setCollisionMaterial() and
$player.setCollisionPolyCustom() ######
======================================
...........
Okay, so hopefully this helps.. I realize it may seem like nitpicking, but just trying to help!
-Greg
03/23/2005 (5:57 pm)
Hey, since you posted the first error I found here, I'm going to go ahead and post the other "errors" I found in the Basic tutorial PDF:Top of page 18
=====================================
%enemy.setPosition("40" SPC (-30 + (getRandom() * 60)));
----------
should be:
----------
%enemy.setPosition("40" SPC (-30 + (getRandom() * 60));
=====================================
Middle of page 19
======================================
"Next, we call the "setCollisionScale()" method. This is an advanced function,"
#### In the preceeding code block, there is no call to setCollisionScale() ####
#### Also, documentation does not mention
$player.setCollisionMaterial() and
$player.setCollisionPolyCustom() ######
======================================
...........
Okay, so hopefully this helps.. I realize it may seem like nitpicking, but just trying to help!
-Greg
#7
Your first 'error' has 4 open brackets and only 3 closed ones. The original looks fine.
Added the missing collision scale.
The documentation for the materia/polycustom are in the reference guide. We really wanted to avoid starting discussion of these calls as a single paragraph would be able to explain them. There'll be seperate tutorials for collisions and physics later. :)
Lots of stuff to come.
- Melv.
03/24/2005 (6:25 am)
Gregory,Your first 'error' has 4 open brackets and only 3 closed ones. The original looks fine.
Added the missing collision scale.
The documentation for the materia/polycustom are in the reference guide. We really wanted to avoid starting discussion of these calls as a single paragraph would be able to explain them. There'll be seperate tutorials for collisions and physics later. :)
Lots of stuff to come.
- Melv.
#8
john
03/24/2005 (8:38 am)
You can also check the console.log (same directory where you execute T2D). It is same info you get with "~" but you since it is a file you can take your time and go through it and find where the errors occured. It will tell you any compiler errors and is pretty good at telling you where the error occurs. That should be much easier than deleting all your dso files everytime.john
Torque 3D Owner Gavin Beard
Byte Logic