Game Development Community

Why dose TGB keep breaking???

by Robert Carroll · in Torque Game Builder · 10/28/2009 (12:17 am) · 18 replies

Hi, I made a platformer, you can go around a city looking for missions. If you come to a miision and you click on it you get droped to a new scene. When I get to the scene everything works fine then, I take a step and it somtimes says RunTime Error most of the time though it goes TGB has stopped working and I goes white (Vista). The behavior works on my other scene why not on this one? I copied the player directly from the other scene too.

#1
10/28/2009 (12:19 am)
Without knowing exactly what you're doing, we won't really be able to help you beyond telling you to debug your program properly.

Maybe you could give us a better description of what you are doing when you receive an error, and what the error is.
#2
10/28/2009 (12:54 am)
Ok, I have a player (Not The Same for each scene) and have that be my main person. I have him on PlatformerControlsBehavior camra mount, and some others. I click on a link to a new level. It goes there ok, then when I press any button on the movement controls it somtimes comes up with a runtime error or it just stops working, the Runtime is somthing like "The Program has requested to terminate in an unusual way please contact the owners for info, (or somthing:?)
#3
10/28/2009 (12:55 am)
Oh ya im new how do I "DeBug" it I think this is a n00bish questtion :)
#4
10/28/2009 (1:24 am)
Do you own Torsion? You can use that to debug your program. If you don't, then all you can do is throw in a few echo statements to see which aspect of your program is causing the crash. Since it happens when you press a movement key, try seeing if it is the "action" or "reaction" to the event.

For example, lets assume you bind "keyboard left" to the function "moveLeft", try something like this:
function moveLeft()
{
    echo( "PRE-MOVE" );
    // Your code is in here, it reacts to the event.
    echo( "POST-MOVE" );
}
This will at least indicate whether or not the movement code you have is causing the problem. Debugging app this way can be very painful, so I would recommend either getting Torsion or TorqueDev.
#5
10/28/2009 (1:33 am)
Well How would that work though? I don't think I can open the console while its not working. have it open before?
#6
10/28/2009 (1:36 am)
Ya it won't work... I can't have the console on and move my person at the same time.
#7
10/28/2009 (2:02 am)
No, but the console.log file should still spit the echo's out for you. After it has crashed, just open the log file.
#8
10/28/2009 (2:04 am)
Wheres that (Im such a n00b :P)
#9
10/28/2009 (2:29 am)
You can find the file named "console.log" in your project directory (the place you keep all of the scripts and data for your project).
#10
10/28/2009 (2:33 am)
Ok, thanks... Y are you up so late?
#11
10/28/2009 (2:42 am)
Heres the bottom of my console
t2dSceneGraph::addToScene() - Object '1790' is already in a SceneGraph!.
t2dParticleEmitter::setImageMap() - Invalid Frame #1 for t2dImageMapDatablock Datablock! (particles3ImageMap)
t2dSceneGraph::addToScene() - Object '1793' is already in a SceneGraph!.
t2dSceneGraph::addToScene() - Object '1798' is already in a SceneGraph!.
Unable to locate audio profile 'grenadethrow'
t2dSceneGraph::addToScene() - Object '1801' is already in a SceneGraph!.
game/gameScripts/game.cs (45): Unable to find function pauseWindow
DirectInput deactivated.
game/gameScripts/game.cs (49): Unable to find function pauseWindow

Heres my movment behavior

function platformerControlsBehavior::moveRight(%this, %val)
{
   %this.right = %val;
echo ( "Pre-Move" );
}

I know it says pre-move
#12
10/28/2009 (8:19 pm)
I found this its kinda what I have but how do I add this to my game?

www.garagegames.com/community/forums/viewthread/89627
#13
10/29/2009 (2:17 am)
WTS is DOSE? You have already used it in 2 posts.
#14
10/29/2009 (2:26 am)
@ Justin What do you mean I used it in 2 other posts? srry im a n00b
#15
10/29/2009 (4:39 am)
He's talking about you misspelling the word "does" as "dose."

Justin, I tend to look past that stuff because my 15-yo is a poor speller. He can spell the word "watch" if you ask him, but I've received *dozens* of IM's from him, "Dad, can I wach a movie?" And on and on. Good kid, bad speller.

Jay Jennings
#16
10/29/2009 (9:53 am)
@Justin & everyone else that thinks spelling is a prio 1 issue in these forums.

This is something I'm really tired of. This is a forum for TGB and programming related issues.

Everyone is not blessed with native English, but at least we have TRIED to learn a second language (English) and is doing our best to make us understood.

I bet that you all prefer bad spelled English instead of:

"Dåligt stavad Svenska eller vilket språk vi nu har som förstaspråk. Om vi alla enbart använde våra egna språk så skulle inte detta forumet fungera över huvud taget."

Your choice...
As long you understand what we mean there shouldn't be a problem.
So please focus on the issues instead of the spelling...


@Robert
We have all been beginners at some point, never excuse yourself for it.
;)
#17
10/29/2009 (12:55 pm)
@ Justin oh sorry wish this had spell check.
#18
10/29/2009 (11:04 pm)
kk, I found out why this is doing that. This happens when I link to a level that has a player from a level that has a player (both move) what I need to do I think is delete the player from scene A so that way its not still trying to move it. Or create a new player each time the scene is loaded but IDK how to do either of those :(