Model frames not weapon frames.
Moderator: InsideQC Admins
11 posts
• Page 1 of 1
Model frames not weapon frames.
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:
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
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
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.
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
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?
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
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.
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
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]
[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
[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.
$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
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
