Stopping it from crashing
by Banshee · in Torque Game Engine · 12/06/2004 (7:21 am) · 7 replies
I have added a new datablock connected to the wheeled vehicle class, must like the spring datablock or tire datablock, it is used to read infomation about a certain attribute of the vehicle, in this case the engine, although now I have problems if I use my car, after I exit the mission sometimes, or start a new mission sometimes it crashs?
Obviousely I can't be that specific but what is the best way to debug such a problem, the Visual Studio debug tools kinda suck?
Obviousely I can't be that specific but what is the best way to debug such a problem, the Visual Studio debug tools kinda suck?
About the author
#2
12/06/2004 (7:58 am)
Hmm, it's difficult to say where the problem is w/o the specifics, but if you're trying to debug the script, you can add echo() statements to follow the process.
#3
Yes the vehicle does get removed with the MissionCleanUp.
The datablock itself is defined privately in the WheeledVehicle Class as:
WheeledVehicleEngine* engine;
And is defined by using %vehicle.setEngine(%engineDataBlock);
I have coded all the correct net coding and such for it and it works great in game, but when it comes to shutting down it crashs most of the time, so I am guess I haven't removed or cleared it correctly?
If so, where/how would I?
12/06/2004 (8:10 am)
The thing is its definately a C++ problem, most likely memory.Yes the vehicle does get removed with the MissionCleanUp.
The datablock itself is defined privately in the WheeledVehicle Class as:
WheeledVehicleEngine* engine;
And is defined by using %vehicle.setEngine(%engineDataBlock);
I have coded all the correct net coding and such for it and it works great in game, but when it comes to shutting down it crashs most of the time, so I am guess I haven't removed or cleared it correctly?
If so, where/how would I?
#4
there should be
wheeledvehicledata (the car it self)
springvehicleData( the car's springs)
wheeldata (the cars wheel)
now you can associate the engine throttle to each wheel, creating 2/4/x wheeled drive but add a unique engine, either you modified the code, the code has changed (which I haven't heard about), or you are doing something wrong. be sure you are creating the car, similar to the buggy demo.
12/06/2004 (9:06 am)
I don't recall having to make an engine for the wheeled vehiclethere should be
wheeledvehicledata (the car it self)
springvehicleData( the car's springs)
wheeldata (the cars wheel)
now you can associate the engine throttle to each wheel, creating 2/4/x wheeled drive but add a unique engine, either you modified the code, the code has changed (which I haven't heard about), or you are doing something wrong. be sure you are creating the car, similar to the buggy demo.
#5
I just don't know how to remove the datablock correctly when the object is removed/destroyed.
12/06/2004 (9:17 am)
Thats what I am saying, I have modified the code and it loads a set datablock called wheeledvehicleengine, which gives an accurate torque curve.I just don't know how to remove the datablock correctly when the object is removed/destroyed.
#6
Well that would go in the WheeledVehicle deconstructor, in C, I would presume look how wheels are removed and emulate it
12/06/2004 (9:31 am)
AhhhhhhhhhhhhhhhhhhhhhWell that would go in the WheeledVehicle deconstructor, in C, I would presume look how wheels are removed and emulate it
#7
12/07/2004 (9:02 pm)
You shouldn't need to remove the datablock when the object is removed...
Associate Anthony Rosenbaum