Announcement

Collapse
No announcement yet.

UT2004: Run Animation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UT2004: Run Animation

    For the life of me, cannot find where in the UT2004 script code the Player Pawn run animation is told to play/loop.

    name MovementAnims[4] seems to be the name of them but no where in .uc code do they appear to be used in that way. In fact many of the xPawn animations are define but don't seem to be used in anywhere in the script code. I assume they are being played in C++ code?

    I'm trying to use PlayMoving(), PlayWaiting() that their examples show how: http://udnbeta.epicgames.com/Technical/MyFirstPawn

    All I'm trying to do it tell myPawn to start playing it's running animation loops and it idle animation when it stops running. I've tried many different way but nothing seems to get the correct behavior.

    #2
    I think it is native. I tried to find it but aswell but I couldn't.

    Comment


      #3
      It's all done natively. Thankfully Epic saw fit to supply some useful bits of native code when they released the UT2004 source. It's in UnPawn.cpp in the UpdateMovementAnimation function.

      Comment


        #4
        Originally posted by Mr Evil
        It's all done natively. Thankfully Epic saw fit to supply some useful bits of native code when they released the UT2004 source. It's in UnPawn.cpp in the UpdateMovementAnimation function.
        Where would I find UnPawn.cpp?

        Comment


          #5
          It's included in the UT2004 source that Epic released a while ago. You can find it here.

          Comment


            #6
            Sweet. Thank you.

            Comment


              #7
              I looked over UnPawn.cpp. Very nice piece of code to have for reference.

              Assuming the player is on the ground running the following should occur:
              APawn::UpdateMovementAnimation() calls: APawn::UpdateOnGround() which calls: APawn::PlayRunning()

              PlayRunning contains the lines:

              Code:
              NewAnim = MovementAnims[NewAnimDir];
              PlayAnim(0, NewAnim, Velocity.Size() / AnimSpeed, 0.1f, true);
              Thes two lines appear to play the running animations

              I have in my MyPawn.uc's

              Code:
              defaultproperties
              {
              ...
                MovementAnims(0)="RunF1"
                MovementAnims(1)="RunF1"
                MovementAnims(2)="RunF1"
                MovementAnims(3)="RunF1"
                IdleRestAnim="Idle1"
              ...
              }
              I know the animations work because I have tested them by hard coding them into MyPawn's PostBeginPlay() using the script call LoopAnim().

              However my new character model's animations does not play at all if I move him around my test map.

              Anyone have an idea what is going wrong? Thanks.

              Comment


                #8
                Hi Castaa

                I did the same, but instead of defaultproperties I did it on the fly (on a BeginState) and it worked fine.
                Try deleting the commands from defaultproperties and putting it in some function with the following syntaxis

                MovementAnims[0] = 'RunS';

                Hope it helps

                Regards

                Comment


                  #9
                  Originally posted by AkerbeltZ
                  Hi Castaa

                  I did the same, but instead of defaultproperties I did it on the fly (on a BeginState) and it worked fine.
                  Try deleting the commands from defaultproperties and putting it in some function with the following syntaxis

                  MovementAnims[0] = 'RunS';

                  Hope it helps

                  Regards
                  Thanks for the tip. I tried moving the animation assignments to mypawn's postbeginplay() but still no animation.

                  I ended up coding my own animation playing system in mypawncontroller's PlayerMove() (defined in state PlayerWalking).

                  Probably it isn't the right way to go but I needed to get it working.

                  Comment

                  Working...
                  X