Just wanted to say that I redid the entire AI system.
Previously, the function AIPlayer::zombieDetectRoute would return a string, like "crouch" or "jump" or "crouchjump" - this would be cased in a switch$ and acted upon appropriately.
With my new-founded wisdom, granted by Supreme Glorious Scripter Space Guy, I've changed the system to a bitwise comparison system.
For instance:
else if((!%hHit && %stuck) || (%zDist <= -1 && !%fHit))
{
// If no float hit and we can see them...
if(!%fHit && %canSee)
{
%result = "jump";
}
else
{
%result = "crouchjump";
}
}
is this
// If we're below them...
if(%zDist < -1)
{
// If we can climb, are below them, have no float hit, and have something infront of us = climb.
if(%armor.zombieClimb && %zDist < -3 && %hHit)
return $ZAPT::PF::Climb;
// If no float hit and we can see them or we're directly below them = jump.
if(%canSee || (%dist + %zDist < 1))
return $ZAPT::PF::Jump;
}
// If we have no head hit and we have a leg hit = crouchjump.
if(!%hHit && %lHit)
return ($ZAPT::PF::Jump | $ZAPT::PF::Crouch);
There's also been a reorganizing of logic which should help with speed, along with the removal of strings (which are pretty clumsy).