Page 1 of 1

Best way to animation models?

Posted: Thu Oct 18, 2018 2:13 pm
by Max_Salivan
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

void()Draw=
{
	if(self.weaponframe == 15)
	{
		W_SetCurrentAmmo();
		self.state = NONE;
		return;
	}
	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)

Re: Best way to animation models?

Posted: Sun Oct 21, 2018 9:34 pm
by Dr. Shadowborg
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.