Game Development Community

Can I tell what made TGB break?

by Robert Carroll · in Torque Game Builder · 11/12/2009 (4:00 am) · 4 replies

Hi, somtimes my TGB crashes (the game) and its because of a script, but I don't know how to accsess the console while my games crashed. I really hate delteing every thing to see what the problem is. Also somtimes my projects don't save there still the same as they were before I started editing.

#1
11/12/2009 (5:57 am)
Do you mean TGB or your game? Either way, there is a file called "console.log" in both the TGB directory and your game's directory. This holds the exact same information as the in-app console.
#2
11/12/2009 (8:04 am)
TGB usually crashes in fallowing situations:
- when an object is missing and you try to delet it (or do some other "unsafe" method)
- when loading/unloading a new level (also because of missing-objects calls)

The safest way to load a level is maybe with schedule. Schedule loading of level with 0 object reference for 100ms later, and it should fix the problem.

If loading is not an issue, try to figure out in what situations the game crashes. Then try to echo those function at the beginning and at the end of a function. In console. log you should see what echo() call was not logged. That way you can slowly isolate problematic line of code.
#3
11/12/2009 (10:10 pm)
I don't get this now I copied my whole level with crt+c and pasting it in another and then it works? Is it because of that scene?
#4
11/13/2009 (5:46 am)
Yes. Its possible that you messed up with some graphic resources, and that some invisible object left on the stage.

Also, it may be bunch of other things, but this is a good tip how to solve this problem if somebody encounter this same error.

Like i said, usually TGB crashes because of some unreferenced or "forgotten" object.