Inside3D!
     

Model frames not weapon frames.

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



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Jun 24, 2010 7:41 am    Post subject: Model frames not weapon frames. Reply with quote

What is the correct way to code in new animations for models without affecting the weapon frames? For example grenade throwing, I have the animation sequences in the view model, they worked perfect, and later when i coded in the frames for player model, the view frames freeze/stop. But the player models frames are fine.

This is what i got:

Code:
void() player_frag1 =       [$shotatt1,       player_frag2   ] {self.frame=70;};
void() player_frag2 =       [$shotatt2,       player_frag3   ] {self.frame=71;};
void() player_frag3 =       [$shotatt3,       player_frag4   ] {self.frame=72;};
void() player_frag4 =       [$shotatt4,       player_frag5   ] {self.frame=73;};
void() player_frag5 =       [$shotatt5,       player_frag6   ] {self.frame=74;};
void() player_frag6 =       [$shotatt6,       player_frag7   ] {self.frame=75;};
void() player_frag7 =       [$shotatt7,       player_run      ] {self.frame=76;};
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Jun 24, 2010 8:30 am    Post subject: Reply with quote

you should probably consider updating the weaponframe field too.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Jun 24, 2010 4:14 pm    Post subject: Reply with quote

wat exactly do you mean because, the grenade throwing function activates the player's animation frames and the view model frames. I just wanna know animate the player model without conflicting with the weapon frames.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Jun 24, 2010 6:49 pm    Post subject: Reply with quote

void() player_frag1 = [$shotatt1, player_frag2] {self.frame=70;};

is functionally equivelent to:
void() player_frag1 =
{
self.frame = $shotatt1;
self.think = player_frag2;
self.nextthink = time + 0.1;
self.frame=70;
};

(except it uses 3 vm instructions instead of 9)

Notice that you're setting frame twice.
If you put in self.weaponframe=4; instead, you'll animate the viewmodel too, as well as the player model.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Jun 24, 2010 7:22 pm    Post subject: Reply with quote

Oohhhh gotchya, thanks a lot.

EDIT: Wait, but how do I define the "$frame" to know what frame it is? if i say self.frame = $frag1 how does it know i want $frag to start at player frame 70? Or should i use the longer format, put self.frame = 70 and self.weaponframe = XX?
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Thu Jun 24, 2010 10:07 pm    Post subject: Reply with quote

i believe it just plays in the order you defined it. i prefer the scratch code format when coding in animation.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Thu Jun 24, 2010 10:18 pm    Post subject: Reply with quote

yea i wish i would have started from that.
I used extras_r4 as my base cause i liked all the goodies.

I need the player frames and the model frames to be separate because some of the weapon's grenade throwing frames are more or less than the player models frames.

How would I do that? I know its something simple but at the moment im stumped.
Back to top
View user's profile Send private message
ceriux



Joined: 06 Sep 2008
Posts: 968
Location: Florida, USA

PostPosted: Thu Jun 24, 2010 10:30 pm    Post subject: Reply with quote

have you looked at the base quake C code? im pretty sure the player animations dont line up perfectly with the v_wep stuff.
_________________
QuakeDB - Quake ModDB Group
Back to top
View user's profile Send private message Yahoo Messenger
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Fri Jun 25, 2010 5:10 am    Post subject: Reply with quote

Yea i looked, all it has for player animation is: $wtfframehere. But it doesn't define it anywhere.

[offtopic] What is the point of model.qc? it doesnt even get compiled. [/offtopic]
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Jun 25, 2010 10:43 am    Post subject: Reply with quote

[offtopic]id used to parse qc code to find out how to convert the models into mdls using the various $frame directives[/offtopic]

$frames are defined with

$frame frame1 frame2 frame3 at the top of a qc file define the frame numbers.
They're just float constants at compile time. You can switch them with just numbers if you really want, but it makes it harder to read, so its not advised.

void() player_frag1 = [70, player_frag2 ] {};

is fine.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Ghost_Fang



Joined: 12 Nov 2009
Posts: 162

PostPosted: Fri Jun 25, 2010 3:55 pm    Post subject: Reply with quote

Thanks, worked great.
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