Forum

Animations in DarkPlaces

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Animations in DarkPlaces

Postby Boss429 » Sun Mar 01, 2009 7:20 am

I've been tearing my hair out trying to get quakec to use the correct frames for a different v_shotgun model.
I'm using that q3mdl mod as a base for my code.
The firing animation I want to use is from frame 14 to 17 but it keeps playing something like frame 2 instead.


Here's what the shotgun section of W_Attack
Code: Select all
   else if (self.weapon == IT_SHOTGUN)
   {

      player_shot1 ();
      W_FireShotgun ();

      self.attack_finished = time + 0.5;
   }

player_shot1:
Code: Select all
void() player_shot1 = {W_FireShotgun(); self.torso.animation = 1;};


here's the player eachframe:
Code: Select all
void() md3_player_eachframe =
{
   local   float   r;

   if (intermission_running)
      return;

   if (self.weapon == IT_AXE)
   {
      if (self.weaponframe > 0)
      {
         self.weaponframe = self.weaponframe + 1;
         if (self.weaponframe == 4 || self.weaponframe == 8)
            self.weaponframe = 0;
      }
      if (self.newattack)
      {
         r = random();
              if (r < 0.25)   {self.weaponframe = 1;}
         else if (r < 0.5)   {self.weaponframe = 5;}
         else if (r < 0.75)   {self.weaponframe = 1;}
         else         {self.weaponframe = 5;}
         self.newattack = FALSE;
      }
   }
   else if (self.weapon == IT_SHOTGUN)
   {
      if (self.weaponframe > 13)
      {
         self.weaponframe = self.weaponframe + 1;
         if (self.weaponframe == 17)
            self.weaponframe = 13;

      }
      if (self.newattack)
      {
         self.weaponframe = 14;
         self.newattack = FALSE;
      }
   }


what am I missing?
Boss429
 
Posts: 39
Joined: Sun Dec 03, 2006 7:29 pm

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest