Inside3D!
     

Model frame tags.

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Feb 18, 2010 8:30 pm    Post subject: Model frame tags. Reply with quote

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.
Back to top
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Thu Feb 18, 2010 8:44 pm    Post subject: Reply with quote

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

Code:

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.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Feb 18, 2010 9:39 pm    Post subject: Reply with quote

I'd rather just do something like self.frame = 5;
Back to top
View user's profile Send private message
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Thu Feb 18, 2010 10:14 pm    Post subject: Reply with quote

you don't need them, they are just a convenience.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Feb 18, 2010 10:15 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Thu Feb 18, 2010 10:41 pm    Post subject: Reply with quote

yes, just replaces the $run1 with a number or whatever frame you wanna use
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Feb 18, 2010 11:08 pm    Post subject: Reply with quote

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


Awesome, thanks.
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Fri Feb 19, 2010 3:40 am    Post subject: Reply with quote

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 Smile.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Feb 19, 2010 3:54 am    Post subject: Reply with quote

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 Smile.


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.
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Fri Feb 19, 2010 1:55 pm    Post subject: Reply with quote

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

  local float i;

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

  self.frame = i;

you can use:
Code:

  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.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Feb 19, 2010 10:18 pm    Post subject: Reply with quote

Thanks! I always hated model frame naming Sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group