Player dies causes crash for fxSunlight.cc
by Andy Hawkins · in Torque Game Engine · 02/18/2007 (10:41 pm) · 3 replies
Now that I've got Skeletons with fireballs attacking the player who is a Skeleton with an Mp5 , the engine crashes and can be trace to the line below marked with an arrow, when then fireballs kill the player...
in fxSunlight.cc
There is a fix for this code by changing conn->getControlObject(); to conn->getCameraObject(); but that doesn't fix my problem.
If I make the player a Skeleton with Fireballs (like the enemy) rather than one with an MP5, it doesn't crash.
It's seem that because the Skeleton with Fireballs and Skeleton with MP5 both use PlayerData functions in separate scripts they may be conflicting but what does that have to do with fxSunlight?? Other than the eye vector?
Anyone know of a fix for this? I don't want an engine change because its for the content pack.
EDIT: Something else I noted was I know it's going to crash when the camera doesn't switch to 3rd person to show the player dying - it is stuck on 1st person, shakes the camera, the gun fades then the game crashes. If it switches to 3rd person as expected, shows the player dying, then it doesn't crash - the problem is intermitten.
in fxSunlight.cc
// Calculate screen point, on screen?
if (dglPointToScreen(ObjectPoint, ScreenPoint))
{
// Yes, so get Server Connection.
GameConnection* conn = GameConnection::getConnectionToServer();
// Problem?
if (conn)
{
// Get the Control Object.
ShapeBase* ControlObj = conn->getControlObject();
// Fetch Eye Position.
Point3F eyePos;
MatrixF eye;
ControlObj->getEyeTransform(&eye); <---- ControlObj is 0x00000000
eye.getColumn(3, &eyePos);There is a fix for this code by changing conn->getControlObject(); to conn->getCameraObject(); but that doesn't fix my problem.
If I make the player a Skeleton with Fireballs (like the enemy) rather than one with an MP5, it doesn't crash.
It's seem that because the Skeleton with Fireballs and Skeleton with MP5 both use PlayerData functions in separate scripts they may be conflicting but what does that have to do with fxSunlight?? Other than the eye vector?
Anyone know of a fix for this? I don't want an engine change because its for the content pack.
EDIT: Something else I noted was I know it's going to crash when the camera doesn't switch to 3rd person to show the player dying - it is stuck on 1st person, shakes the camera, the gun fades then the game crashes. If it switches to 3rd person as expected, shows the player dying, then it doesn't crash - the problem is intermitten.
Torque 3D Owner Jesse Liles