Best way to animation models?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Best way to animation models?

Postby Max_Salivan » Thu Oct 18, 2018 2:13 pm

1)Quake style
__state [framenumber, functiontothink];
is very messy if you have many animation,you need to spend a lot of time to do this
2)Hexen 2 style
__state [++ firstframe .. lastframe];
idk how its works,but it seems better then quake style
3)by nexttink and think
Code: Select all
   if(self.weaponframe == 15)
      self.state = NONE;
   self.weaponframe += 1;
   self.think = Draw;
   self.nextthink = time + 0.1;

looks better,but when you use think function,its can kill another think(player animation for example)
4)maybe best(or not?) way,i found on this forum
Code: Select all
void() player_reload1 = [$reload1, player_reload2] {self.weaponframe = 10;};  //Replace 10 with your start frame.
void() player_reload2 = [$reload2, player_reload3] {self.weaponframe = (self.weaponframe + 1);};  //This advances the frame count by 1.
void() player_reload3 =
      if(self.weaponframe == 17)  //If the animation has reached its end....
            self.weaponframe = 0;  //Set the frame back to the idle frame.
            return;  //Exit this function.
      else  //If the animation still has some frames left to play...
            player_reload2();  //Continue the animation..
            return;  //Exit this function.

maybe there is another option?(not the animation group,because you cant attach sound on frame,its works in iqm)
Sorry for my english :)
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Best way to animation models?

Postby Dr. Shadowborg » Sun Oct 21, 2018 9:34 pm

Control weaponframe animation via PlayerPostThink or better, W_WeaponFrame (in weapons.qc).

Use an animation state control system, and make some functions to more easily set / cancel animations as needed.

That way, you can avoid interrupting player animations.
User avatar
Dr. Shadowborg
InsideQC Staff
Posts: 1114
Joined: Sat Oct 16, 2004 3:34 pm

Return to QuakeC Programming

Who is online

Users browsing this forum: Google [Bot] and 1 guest