Forum

Model frame tags.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Model frame tags.

Postby Downsider » Thu Feb 18, 2010 8:30 pm

Are they necessary? I don't like them and think it was a severe fault of Quake's animation system. I think it would be better if you could simply set the frame as a number.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Orion » Thu Feb 18, 2010 8:44 pm

You mean using $frame run1 run2 etc?
Or the frame function like:

Code: Select all
void() run1 = [$run1, run2] {ai_run(10);};



If you want to set the frame as a number you'll need to open your model in a model editor and count all the frames and set the number to the frame you want to, starting at 0. The first frame is not 1.
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Postby Downsider » Thu Feb 18, 2010 9:39 pm

I'd rather just do something like self.frame = 5;
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby metlslime » Thu Feb 18, 2010 10:14 pm

you don't need them, they are just a convenience.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby Downsider » Thu Feb 18, 2010 10:15 pm

metlslime wrote:you don't need them, they are just a convenience.


So instead of putting a name, I can just chuck a number in there?
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Error » Thu Feb 18, 2010 10:41 pm

yes, just replaces the $run1 with a number or whatever frame you wanna use
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Downsider » Thu Feb 18, 2010 11:08 pm

Error wrote:yes, just replaces the $run1 with a number or whatever frame you wanna use


Awesome, thanks.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby frag.machine » Fri Feb 19, 2010 3:40 am

Downsider wrote:
metlslime wrote:you don't need them, they are just a convenience.


So instead of putting a name, I can just chuck a number in there?


Yup, just chunk a number and you're done. Of course this is OK for 4 or 5 frames long models, but quickly becomes a nightmare when you have elaborated animations and/or models that are being frequently edited (my current case). After manually renumbering all you code you'll then realize that frame constants are actually a bless :).
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Downsider » Fri Feb 19, 2010 3:54 am

frag.machine wrote:
Downsider wrote:
metlslime wrote:you don't need them, they are just a convenience.


So instead of putting a name, I can just chuck a number in there?


Yup, just chunk a number and you're done. Of course this is OK for 4 or 5 frames long models, but quickly becomes a nightmare when you have elaborated animations and/or models that are being frequently edited (my current case). After manually renumbering all you code you'll then realize that frame constants are actually a bless :).


Well I don't have to use numbers, right? I can use variables too?

I had a clever idea for an animation manager and would like to do it up.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby frag.machine » Fri Feb 19, 2010 1:55 pm

Of course you can use variables. There's a number of mods doing animation this way, actually. but instead doing something like:
Code: Select all
  local float i;

  i = 5;
  (...)
  if ((i >=5) && (i <= 10))
  {
    i = i + 1;
  }

  self.frame = i;

you can use:
Code: Select all
  local float i;

  i = $walk1;
  (...)
  if ((i >= $walk1 ) && (i <= $walk5 ))
  {
    i = i + 1;
  }

  self.frame = i;


It's a much clean and easy to understand code, both for you and to anyone else trying to learn by/modify your mod.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Downsider » Fri Feb 19, 2010 10:18 pm

Thanks! I always hated model frame naming :(
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest