Reference Datablocks
by Sabrecyd · in Torque Game Engine · 08/06/2003 (12:36 pm) · 13 replies
Not sure if this is a bug but it is annoying. Something like the code below used to work and now causes the engine to crash. Seems to have started with the last large change with the console methods (Either July or August 2003).
Is there a different method or syntax to reference other datablocks? It was very useful.
datablock PlayerData(Warrior : LightMaleHumanArmor){
mass = 110;
maxDamage = 150;
maxForwardSpeed = 12;
};Is there a different method or syntax to reference other datablocks? It was very useful.
About the author
#2
The only part that actually causes the crash seems to be
If it's just
The engine crashes when trying to start a mission, when trying to create the player.
Thanks for looking into it. This could be a big problem for people with a lot of similar datablocks. It works if the entire datablock is defined instead of referencing another one but that's kind of a waste.
08/07/2003 (1:39 pm)
I added just the above datablock in player.cs in a fresh engine along with setting "Warrior" as the datablock when creating a player instead of the default LightMaleHumanArmor in game.cs as a test.The only part that actually causes the crash seems to be
datablock PlayerData(Warrior : LightMaleHumanArmor){If it's just
datablock PlayerData(Warrior){even with just the 3 lines it works. Just uses the defaults for everything not defined.The engine crashes when trying to start a mission, when trying to create the player.
Thanks for looking into it. This could be a big problem for people with a lot of similar datablocks. It works if the entire datablock is defined instead of referencing another one but that's kind of a waste.
#3
*goes off to tinker*
You're sure you have a fresh clean copy of HEAD, btw?
08/07/2003 (4:44 pm)
Yes; it's a useful area of engine functionality that should definitely not be bugging out on you; ergo, there is a problem. I fix!*goes off to tinker*
You're sure you have a fresh clean copy of HEAD, btw?
#4
08/07/2003 (4:49 pm)
Well, I added such a datablock, and nothing much broke. Can you give me more details about the error generated or where in the source it breaks?
#5
I'll have to try it on the HEAD from today and check again. I'll have to do that tomorrow when I can get to the machine I have with CVS setup.
Here's what MSVC++ gives as an error when the engine crashes along with the initial "Access Violation":
this CXX0017: Error: symbol "this" not found
Edit: Just tried it with a projectile datablock and had the same problem.
Edit2: I compiled the debug version. The error is in console.cc @ line 946. "Error, null setData fn"
08/07/2003 (6:17 pm)
I tried it on the HEAD from 8-05-03 with no other modifications. It seems to crash as soon as I start a mission just having that datablock in the player.cs file without even calling it from anywhere. If I comment out that datablock or don't use the : symbol it works fine. It also worked on the HEAD and all modifications I made to it from about 6-24-03 or so and every version I've had of the engine until now. Strange it was fine for you tho.I'll have to try it on the HEAD from today and check again. I'll have to do that tomorrow when I can get to the machine I have with CVS setup.
Here's what MSVC++ gives as an error when the engine crashes along with the initial "Access Violation":
this CXX0017: Error: symbol "this" not found
Edit: Just tried it with a projectile datablock and had the same problem.
Edit2: I compiled the debug version. The error is in console.cc @ line 946. "Error, null setData fn"
#6
A zipped up example game directory that does the crash would be very helpful.
08/07/2003 (9:03 pm)
Can you send me something that reproduces this problem? I'm running VC7; perhaps you're using VC6?A zipped up example game directory that does the crash would be very helpful.
#7
08/07/2003 (9:10 pm)
Will do. I'll have to send it tomorrow morning tho when I can get to that "fresh" copy. I am using VC6 with SP5.
#8
I noticed sometime in June (I think) when there was a lot of changes made at once VC6 started giving 13 warnings instead of 1 like I usually get but the crash didn't start happening until August. I copied those warnings into a rtf file and placed it in the example folder I just zipped. Should I send that zipped file to your public email? It's about 16MB.
Edit: I sent the zip file so I hope it makes it :)
08/08/2003 (4:47 am)
Ok, just tried it on a totally clean HEAD and added just the datablock in the first post in player.cs and had the same crash. I noticed sometime in June (I think) when there was a lot of changes made at once VC6 started giving 13 warnings instead of 1 like I usually get but the crash didn't start happening until August. I copied those warnings into a rtf file and placed it in the example folder I just zipped. Should I send that zipped file to your public email? It's about 16MB.
Edit: I sent the zip file so I hope it makes it :)
#9
08/08/2003 (10:47 am)
Doesn't look like it did. Can you mail me just the binary? I'm bgarney AT pblabs DOT com
#10
Very odd. I'll see if I can get someone with VC6 to debug this.
08/08/2003 (11:11 am)
Nm, I got it.Very odd. I'll see if I can get someone with VC6 to debug this.
#11
All better now.
08/08/2003 (12:01 pm)
Ok. I borrowed Rick's computer and commited a fix. It turned out that VC6 fails to initialize a few variables in subtle ways... Not only was it accessing invalid data, but it wanted to do it several million times :)All better now.
#12
Edit: Just recompiled with the updated files and it works now. Thanks again.
08/08/2003 (1:27 pm)
Sweet! I see the updated file checked in. Thanks very much. This is just one of the reasons I like working with this engine. People actually fix things :)Edit: Just recompiled with the updated files and it works now. Thanks again.
Associate Kyle Carter
Will that snippet alone in the scripts somewhere make the engine crash?
I can take a look sometime soonish and try to fix the problem.