Play animations in their entire length

Grab your favourite IDE and tinker with the innards of game engines

Play animations in their entire length

Postby dennisdc on Thu May 24, 2007 1:57 pm

How do I make my code play my the entire length of my animations ?

Currently they only play like half of the sequence or so, and then they revered to their idle animations or something. I have no idea why this is. It happends on my own actions and actions like MELEE_ATTACK1.
If I have short animations, it is almost not visible, but with longer anims, the problems becomes inherent.

In SetAnimation() in hl2player.cpp I have this code:

Code: Select all
   if (playerAnim == PLAYER_HEAL)
   {
      idealActivity = ACT_HEAL;
   }


and later this code:

Code: Select all
 if ( idealActivity == ACT_HEAL )
   {
      animDesired = LookupSequence("help");
      if ( animDesired == -1 )
         {
            animDesired = 0;
            DevMsg("HELP ANIMATION COULD NOT BE FOUND \n");
         }
      SetActivity(ACT_HEAL);
      //return;
   }
dennisdc
Member
Member
 
Joined: Thu May 17, 2007 10:44 am

Postby longshanks on Thu May 24, 2007 6:37 pm

Later on in SetAnimation you will find something applying to reload or the grenade, looks a bit like this (not exact):

Code: Select all
else if ( idealActivity == ACT_HL2MP_RELOAD)
   {
      RestartGesture( Weapon_TranslateActivity( idealActivity ) );
      return;
   }



Simply add your own else if for your custom activity IE:


Code: Select all
else if ( idealActivity == ACT_HEAL)
   {
      RestartGesture( Weapon_TranslateActivity( idealActivity ) );
      return;
   }



This works for me.
longshanks
Turbine Entertainment Software
 
Joined: Mon Nov 14, 2005 11:39 pm
Location: BOSTON!!!

Postby netserk on Thu May 24, 2007 7:31 pm

The RestartGesture-thing works for me too
netserk
Member
Member
 
Joined: Sun May 13, 2007 12:39 pm
Location: Aalborg, Denmark

Return to Programming

Who is online

Users browsing this forum: No registered users