Version 1.1 to 1.1.1
by PeterB · in Torque Game Builder · 08/14/2006 (6:45 pm) · 3 replies
Trying my game with version 1.1.1. It's working fine in the previous version. I started with the platformer tutorial and it works like a charm:
http://tdn.garagegames.com/wiki/Torque_2D/GenreTutorials/PlatformerOverview
Now my character won't jump unless he's running (sometimes). I know a lot of you haven't looked at the above tutorial, but I wondered if anyone had quick thoughts about what's changed that might cause this.
He has a constant force (gravity) and jump gives in a linearvelocity the other direction.
Are tilemaps obsolete now? And tilelayers are the only way to go? My only guess is that my tilemap from and older version deals with collisions differently.
I've tried everything multiple times- upgrading, deleting dso's. Since none of my code has changed, I'm very surprised to have such a problem.....
p
http://tdn.garagegames.com/wiki/Torque_2D/GenreTutorials/PlatformerOverview
Now my character won't jump unless he's running (sometimes). I know a lot of you haven't looked at the above tutorial, but I wondered if anyone had quick thoughts about what's changed that might cause this.
He has a constant force (gravity) and jump gives in a linearvelocity the other direction.
Are tilemaps obsolete now? And tilelayers are the only way to go? My only guess is that my tilemap from and older version deals with collisions differently.
I've tried everything multiple times- upgrading, deleting dso's. Since none of my code has changed, I'm very surprised to have such a problem.....
p
About the author
#2
It is hard to guess at what section of script functionality might have changed since the last build. =P
Personally I would narrow it down by getting into the sections of script that call the 'jump' functionality.
It could simply be that one of the 'if()' comparisons are failing and are not handled properly. If this is so it would look like the jump is not working properly but it is actually simply failing to jump because the script doesn't include a handler for this case.
Go through each of the statements where an if() comparison needs to succeed in order for the player to jump. Include an else() statement below each one:
Another simple trick is when the if() statement for a valid jump succeeds, add a echo message printing 1) The values you expect to passed in/returned 2) The actual result of what is passed in/returned.
These are really simple debugging tools but they will show you where your script is failing and help you narrow down the problem.
-Unk
08/15/2006 (8:54 am)
I looked at the tutorial a bit... It is hard to guess at what section of script functionality might have changed since the last build. =P
Personally I would narrow it down by getting into the sections of script that call the 'jump' functionality.
It could simply be that one of the 'if()' comparisons are failing and are not handled properly. If this is so it would look like the jump is not working properly but it is actually simply failing to jump because the script doesn't include a handler for this case.
Go through each of the statements where an if() comparison needs to succeed in order for the player to jump. Include an else() statement below each one:
if(%something == %somethingelse)
{
}[b]
else
{
echo ("WHY THE HECK DID THIS HAPPEN??");
}
[/b]Another simple trick is when the if() statement for a valid jump succeeds, add a echo message printing 1) The values you expect to passed in/returned 2) The actual result of what is passed in/returned.
function doIt()
{
if(%something == %somethingelse)
{
%int = 1;
[b]echo("doIt() - Calling doItTwo(", %int, ")");[/b]
%newint = doItTwo(%int);
[b]echo("doIt() - doItTwo() Returned: ", %int);[/b]
if (%newint == %int)
{
[b]echo("%newint == %int");[/b]
}
else
{
[b]echo("%newint != %int");[/b]
}
}
}
fuction doItTwo(%int)
{
[b]echo("doItTwo() - Was Passed Int: ", %int);[/b]
if(%int == 1)
{
[b]echo("doItTwo() - Returning: 1");[/b]
return 1;
}
else
{
[b]echo("doItTwo() - Returning: -1");[/b]
return -1;
}
}These are really simple debugging tools but they will show you where your script is failing and help you narrow down the problem.
-Unk
#3
The function that actually applies the jump (setlinearvelocity) is being called, so I tried translating the character up a few units upon jump, (before applying linear velocity) and that worked.
I think the tilemaps that I made in an older version don't convert to 1.1.1 perfectly. Also, because when I run into an impassable wall the world vibrates horizontally (this is the best word to describe how it looks) as if every other fraction of a second he's entering and then exiting the wall a hair.
Will try separating maps into layers and using the 'loadLevel' function in general, as I am loading elements the very old fashion way. Piece by piece in 'startGame'.
-p
08/15/2006 (10:14 am)
Thanks.The function that actually applies the jump (setlinearvelocity) is being called, so I tried translating the character up a few units upon jump, (before applying linear velocity) and that worked.
I think the tilemaps that I made in an older version don't convert to 1.1.1 perfectly. Also, because when I run into an impassable wall the world vibrates horizontally (this is the best word to describe how it looks) as if every other fraction of a second he's entering and then exiting the wall a hair.
Will try separating maps into layers and using the 'loadLevel' function in general, as I am loading elements the very old fashion way. Piece by piece in 'startGame'.
-p
Torque Owner Nir Ziso
Default Studio Name