Missing Behaviors
by James Lindsey · in Torque Game Builder · 05/05/2010 (11:23 pm) · 7 replies
I've scanned a few forum posts and haven't found a solution to the "missing behavior" situation that suits my particular case, so I wanted to toss this one out there and see if I could get a little help with it. There's also a little bit of a Torsion problem involved, but that's not critical. As you can assume, I've recently worked on a tutorial, in particular the asteroids one for TGB. I was primarily interested in the high score section and the behavior for that one wouldn't show up. After checking the forums, I realized it needed a .dso file. I went into Torsion to see if I could recompile it and found that Torsion was giving a "Precompile failed." error on every single file in the entire game individually and also as a collective whole. Console.log remains blank, the only breakpoint that appears is in a .cs file that not only should have nothing to do with the games ability to compile properly, but when I tell Torsion to go to the offending file, it says it doesn't exist even when I'm looking right at it in Torsion. At this point I got a little miffed and had Torsion delete all the .dso files and then ran the game in TGB. Afterward, I found that highScore.cs had its own .dso file like all the others, but still wouldn't show up in the behavior drop down list. I've tried assigning the behavior directly to a scene object, but I'm not quite up to snuff on scripting to be able to pull that off just yet. Any suggestions would be great, I've tried everything I can come up with to get around what really should have been an easy high score screen.
#2
05/06/2010 (10:07 am)
I now have the file executing from game.cs, still not showing up in the behavior drop down box though. Is there a way to manually force the behavior onto an object? Also, I've made several changes to the code in Torsion since it started acting funny and while the game won't start from Torsion, it will from TGB and the changes I made registered there. I'm starting to think an evil intergalactic sandwich is eating my code from the inside.
#3
http://www.torquepowered.com/community/forums/viewthread/76329
05/06/2010 (10:46 am)
The search box works well for problems like this one. :)http://www.torquepowered.com/community/forums/viewthread/76329
Quote:Nice!
I'm starting to think an evil intergalactic sandwich is eating my code from the inside.
#4
05/07/2010 (5:33 am)
Tried coding the behavior directly and it compiled without errors, but still isn't doing anything. I have a few things to check on in that regard, for example a fellow student got the high score table working for their groups game, but it loads on top of everything else that's going on and won't go away... so I guess they have problems of their own :P. I'm loading a different screen before it loads, but I've checked the code and that doesn't seem to be an issue. I'll have to keep messing with it, but I'm sure I'm on the right track. I do appreciate the help by the way, some very good suggestions. My TGB is just being stubborn, because I have no doubt this stuff would work on a different computer. Still not as bad as the version we have at the college. Just flat out breaks games.
#5
05/07/2010 (8:14 am)
Make sure the file is in the behavior folder of your project. You shouldn't have to exec see as it should be loaded automatically.
#6
05/07/2010 (10:46 pm)
Double checked that one, even put a copy in the behavior folder AND the gui folder underneath it. This one's really just being way more stubborn than it should be. I know the code is right, I've seen it work in another game, I know the file structure is right... luckily this has been incredibly rare for me and I think this is the only one I haven't been able to fix with the above suggestions. I'm starting to think there might be something wrong with some of the files themselves or the flash drive they're on. Maybe a folder permissions issue or some outlandish thing that's preventing the files from doing what they should be doing. Grasping at straws, I know, but it can't hurt to experiment a little. If I manage to get it working without any suggestions posted here, I'll be sure to post everything I can figure out about it as to how and why and yadda yadda. Of course, if an idea here works, I'll buy you a beer.
#7
05/14/2010 (6:42 am)
Ok, figured out part of my problem and I technically know how to fix the other part, I just haven't had time to yet. Started working through the TSIT 1.5 lessons last night and when I hit the File IO lesson I had a fun thought. I figured it was possible that since I didn't do the Asteroids tutorial step by steb and went only for the bits and pieces I wanted, it was highly likely that I either skipped one very important step, or said step had simply been hidden in with an earlier step and taken for granted and I still missed it anyway. Either way it happened, I didn't have the setCompanyandProduct function set up. I also think that with the way the tutorial is set up, the high scores possibly weren't meant to be displayed on a seperate scene, which is what I'm doing, meaning I'll need to see about maybe changing some local variables to global ones as long as it doesn't break the code. Either way, I think this could work.
Torque Owner RollerJesus
Dream. Build. Repeat.
So you created a file called highScore.cs and copied the contents of the behavior into that file from here?
If so, make sure the file is executed in main.cs or game.cs and if you run the game and don't get any errors, then you will be able to add it to objects in the editor.
Note that if there are errors when you try to compile, TGB runs that last good build and doesn't include your latest changes.