Wednesday, September 19, 2012

More Animations and A Little Scripts

This week I worked more on trying to make my animations look a little better. Because our main character has custom bones for his skeleton, it's really hard to show the weight impact on the feet when the player is running. I tried to implement that sort of animation to the best that I could, but it's not looking that good. It gives him more of a skiing animation then an actual run.
Another adjustment I made was the reload animation for the revolver. The previous animation was a bit of a mystery to the player because from their view all they say was the hand moving to the front of the character's body. I changed this to make the character take his left hand and act as if he's reaching into his pocket each time and putting a bullet into the revolver. This animation looks much better and is definitely more obvious in a visual sense as to show what exactly the character is doing.
One issue I ran into while implementing the reload animation was that when the reload animation was called, the player could actually hit the fire button and cause the fire animation to occur which would break the reload animation before it finished. This issue was not too difficult to solve. It just took some digging around in the weapon and pawn class. What I did was create the bool variable bIsReloading in the base UTWeapon class, and I check that if it's true in the pawn class then prevent the firing animation from taking place. This will be helpful when the rifle is implemented because the same check will prevent the rifle reload animation from being broken as well. You can see the code snippetof the StartFire function below from the pawn class.

simulated function StartFire(byte FireModeNum)
{
    local UTWeapon Weap;

    Weap = UTWeapon(Weapon);
    // firing cancels feign death
    if (bFeigningDeath)
    {
        FeignDeath();
    }
    else
    {
        if(!Weap.bIsReloading)
        {
            super.StartFire(FireModeNum);
        }
    }
}

No comments:

Post a Comment