Forum

Model frames not weapon frames.

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Model frames not weapon frames.

Postby Ghost_Fang » Thu Jun 24, 2010 7:41 am

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: Select all
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;};
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Spike » Thu Jun 24, 2010 8:30 am

you should probably consider updating the weaponframe field too.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Ghost_Fang » Thu Jun 24, 2010 4:14 pm

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.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Spike » Thu Jun 24, 2010 6:49 pm

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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Ghost_Fang » Thu Jun 24, 2010 7:22 pm

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?
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby ceriux » Thu Jun 24, 2010 10:07 pm

i believe it just plays in the order you defined it. i prefer the scratch code format when coding in animation.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Ghost_Fang » Thu Jun 24, 2010 10:18 pm

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.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby ceriux » Thu Jun 24, 2010 10:30 pm

have you looked at the base quake C code? im pretty sure the player animations dont line up perfectly with the v_wep stuff.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Ghost_Fang » Fri Jun 25, 2010 5:10 am

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]
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Postby Spike » Fri Jun 25, 2010 10:43 am

[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.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Ghost_Fang » Fri Jun 25, 2010 3:55 pm

Thanks, worked great.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest