Game Development Community

Milkshape death animation problems

by Kurtis Seebaldt · in Torque Game Engine · 02/26/2003 (10:10 pm) · 4 replies

I'm having trouble getting death animations working from Milkshape. I make an animation and add a material:

seq: death1=1-1, fps=10

It plays fine through the show tool, but in game it causes Torque to crash. I traced through with the debugger and found that it calls TSThread::getGround(F32 t, MatrixF * pMat). It dies on line 137:

q2 = &mShapeInstance->mShape->groundRotations[sequence->firstGroundFrame + frame].getQuatF(&rot2);

mShape->groundRotations[whatever] is NULL.

#1
03/03/2003 (2:31 pm)
I'm still having trouble with this.

I can work around it by changing:

// similar to above, ground keyframe number 'frame+1' is actually offset by 'frame'
p2 = &mShapeInstance->mShape->groundTranslations[sequence->firstGroundFrame + frame];
q2 = &mShapeInstance->mShape->groundRotations[sequence->firstGroundFrame + frame].getQuatF(&rot2);

to:

if(sequence->firstGroundFrame + frame < sequence->numGroundFrames) {
// similar to above, ground keyframe number 'frame+1' is actually offset by 'frame'
p2 = &mShapeInstance->mShape->groundTranslations[sequence->firstGroundFrame + frame];
q2 = &mShapeInstance->mShape->groundRotations[sequence->firstGroundFrame + frame].getQuatF(&rot2);
} else {
p2 = &unitTranslation;
q2 = &unitRotation;
}

I don't know if the bug is in tsThread or in the Milkshape exporter. Any ideas??
#2
03/13/2003 (11:20 pm)
Here's something I picked up from the Milkshape exporter readme...

name=start-end This declares the name of the sequence followed by
the starting and ending key frames. This option must
exist for the sequence declaration to be valid.

I don't think it will work with just one keyframe... you need to have a sequence of keyframes. How did you get an animation sequence in just one keyframe anyway? Make sure you have the right number for the end there...

- Alan
#3
03/14/2003 (9:32 am)
One keyframe animations work just fine for root and running. I specified the material like this:

seq: death1=1-1, fps=10

Start frame is one, end frame is one. I traced through the code and it has something to do with ground transformations being saved. I posted above my workaround, but I was hoping someone could tell me if it was the exporter that was bugged or tsThread.
#4
03/27/2003 (12:29 pm)
For some reason in DTS files exported by MilkShape with versions > 23 no ground transforms are detected. This appears unimportant for animations sequences other than the death sequences which require the ground transforms. I employed a similar work around, but the result is that the death animation does not work consistently, the player soetimes ends up in a position normal to the ground surface. Will post a solution if I figure it out. Hope someone else finds it first.