Bizzare bug when executing script
by Playware · in Torque Game Builder · 04/04/2007 (7:26 pm) · 5 replies
Hi,
apparently when I was adding a behavior script file (its name is "followObj.cs") into the behavior folder of my game, something bizzare happened. I launched my TGB and it hanged!! When i transferred the scripts into another script file and left "followObj.cs" empty, it still hanged. Eventually, i deleted the file and it worked again... I was just wondering, is it the file name or something else about the file that is hanging TGB??
thanks
apparently when I was adding a behavior script file (its name is "followObj.cs") into the behavior folder of my game, something bizzare happened. I launched my TGB and it hanged!! When i transferred the scripts into another script file and left "followObj.cs" empty, it still hanged. Eventually, i deleted the file and it worked again... I was just wondering, is it the file name or something else about the file that is hanging TGB??
thanks
About the author
#2
the console did not show any msg that suggested any problem with compiling and executing the behavior scripts, so i ruled out the possibility of loading problems. for the interested parties, i found that the script that loads all the behaviors resides in projectManagement.cs in the common folder.
i personally do not think that it is a problem but i just want to let everyone knows that it might happen. would be glad if anyone can provide more insights on it
04/04/2007 (8:06 pm)
The code is working fine. what i did before deleting the file was to cut and paste all the codes in the file to another script file. so when i deleted the supposingly problematic script file, the codes still exist in another script file. after i did that, the problem disappear. strangely enough, when i restored the empty script file from the recycle bin, the problem reoccurs which make me believe that it lies with the file. However, i just dun understand how could a script file (and it's empty) causes the whole tgb to hang? the console did not show any msg that suggested any problem with compiling and executing the behavior scripts, so i ruled out the possibility of loading problems. for the interested parties, i found that the script that loads all the behaviors resides in projectManagement.cs in the common folder.
i personally do not think that it is a problem but i just want to let everyone knows that it might happen. would be glad if anyone can provide more insights on it
#3
04/05/2007 (10:18 am)
I managed to replicate the problem today and realised that it may be due to the loading of TGB... when i load the project and last editted level at start up with a new behavior script file, it will hang, or take a lifetime to load up. i ended up deleting the dso and reload TGB again, which does not improve the situation. frustrated, i tried not loading project and last editted level, i.e. to have TGB show the startup screen at startup. and everything turns out fine. not sure why it is happening though. good to take note of it :-)
#4
04/05/2007 (12:21 pm)
Have you looked at the console.log file after the hang? It may give you some clue as to the issue. You can add an echo statement at the top of the file that's causing problems to see if it ends up in the console.log or if TGB is having problems before it even loads it.
#5
04/06/2007 (9:00 am)
Yah, i did, but does not help much actually.... coz it's the script compilation that i suspect is causing the problems. the files are alright, in fact, when i encountered the problem, the script file is empty...
Torque Owner Guy Lewis
On the totally impossible guess it sounds like you have a piece of code that is hanging in an infinite loop.