T3D 1.1 Final - Dead Ai Call onMoveStuck w/Fix - RESOLVED (THREED-1976)
by Steve Acaster · in Torque 3D Professional · 06/06/2011 (10:54 am) · 3 replies
T3D 1.1 Final
win7 32bit
Target:
Ai scripts/code
Issue:
If an Ai is killed when moving they start to loop the "onMoveStuck" callback.
Repeat:
Make sure you have an echo in scripts/server/aiplayer.cs Funtion DemoPlayer::onMoveStuck. Spawn an Ai, have them run about and then kill them. Check the console for the onMoveStuck callback spamming the console until the Ai corpse is deleted.
Suggest:
In aiplayer.cpp, way down in getAiMove() add a check to see whether the Ai is enabled/alive before firing off callbacks saying that it's corpse can't move.
win7 32bit
Target:
Ai scripts/code
Issue:
If an Ai is killed when moving they start to loop the "onMoveStuck" callback.
Repeat:
Make sure you have an echo in scripts/server/aiplayer.cs Funtion DemoPlayer::onMoveStuck. Spawn an Ai, have them run about and then kill them. Check the console for the onMoveStuck callback spamming the console until the Ai corpse is deleted.
Suggest:
In aiplayer.cpp, way down in getAiMove() add a check to see whether the Ai is enabled/alive before firing off callbacks saying that it's corpse can't move.
bool AIPlayer::getAIMove(Move *movePtr)
{
//...
if (mMoveStuckTestCountdown > 0)
{
--mMoveStuckTestCountdown;
}
else
{
// We should check to see if we are stuck...
F32 locationDelta = (location - mLastLocation).len();
if (locationDelta < mMoveStuckTolerance && mDamageState == Enabled) {//yorks added damageState check
mMoveState = ModeStuck;
throwCallback("onMoveStuck");
}
//...
}About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
Torque 3D Owner Christopher Tauscher
Default Studio