I am having troubles with animating my weapons... sorta. Animating is nto where I am havign problems, more or less getting these animations played.
What I want:
- Vertex animations in my weapon files to be played
What I know:
- Head animations using vertex animation within the head.md3 files work correctly.
- MD3 files support vertex animation
- My weapons seem to be only animated as static meshes using tags
- I can animate using tags within my weapons and everythign works as normal, the problem is more or less I want fingers to move via vertex animation
What I would really love someone to fill me in on if possible:
- What does the barrel anim bits, animated weap. and barrel draw bits inside the weapon.cfg files mean? I have tried setting animated weapon inside this file to 1 to get vertex animations played, but nothing makes a difference.
- Am I overlooking a feature within the code that is already implemented/partially implemeted to get vertex animations played for weapons, or am I looking at some coding? I can code, that's easy, but I don't want to replicate what's allready there, and considering vertex animations for heads work correctly I am almost positive that it would work for weapons as well.
- Example. TCE skips the handsmodel entirely and just uses the weapon view models and vertex animation to make the hands move... this is what I want as well.
I looked through the code and it "looks" as though vertex animations should be played for weapons, as all the frames are still being drawn, I just don't understand why they won't be played. Basically it appears as the model parts only play one base frame even though they have many frames, and the tags that normally drag these parts on the screen is what "animates" weapons.
Thanks in advance if anyone can give me a hand on the any above. I think my problems are more or less I am thinking in large chucks, but if anyone can give me a pointer in the direction I need to head (I don't need code/tutorials, I just would like to know where the right direction is to get these vertex animations played) I would be very thankful.
Thanks,
=>ETK<= Elite
==========
EDIT:
Sometimes when I read what I post I think I help myself a tad... possibly. ANyhow, are these animations only read in the handsmodel files only? I think earlier I was thinking it would just grab the entire model data from all weapon files supplied if it was there and just play it if it existed (basically one frame would normally be in part models and just repeat). If so, is there a way I can "toggle" the drawing of the meshes inside the handsmodel files?
Weapon Animations (Vertex)
Moderators: Forum moderators, developers
-
- Posts: 126
- Joined: Sat Sep 25, 2004 7:12 am
- Contact:
you have to use those unfilled fields in weapon animations cfg file
though main part animating does not work, and needs to allowed in game, or just don't try to animate main weapon
you can always attach barrels to tag_weapon anyway
though main part animating does not work, and needs to allowed in game, or just don't try to animate main weapon
you can always attach barrels to tag_weapon anyway
Hi! I'm a .signature *virus*! Copy me into your ~/.signature to help me spread!
I am using the tags to animate the weapons, and it is moving the parts properly. However, I want vertex animation for the hands as well along with the tag animation (so I can move the fingers on the hands).The Necromancer wrote:you have to use those unfilled fields in weapon animations cfg file
though main part animating does not work, and needs to allowed in game, or just don't try to animate main weapon
you can always attach barrels to tag_weapon anyway
What do these fields mean? What are the values I use in them more specifically, or how can I get/determine the values I need to use for these fields.
The bottom line is it can be done. Either it is allready supported or not. All I need to know if it is possible without any code modifications, or is it something I am looking at coding in. I am more or less confused because I don't know what these unfilled values in the weapon.cfg files represent or how I go about getting the values I need to enter in them, and what changes will be made to the weapon models (that do have vertex animation contained within them) during in game animations.
Thanks Necromancer, but I am still somewhat confused.
-
- Posts: 126
- Joined: Sat Sep 25, 2004 7:12 am
- Contact:
why don't you just have a look self?I can code, that's easy
well, if you want to animate barrel1 and barrel2 you will add their bits to barrel anim bits, in this case 3, animated weapon will just add bit for the last part (main part ), however code is preventing it's usage
draw bits will set barrels invisible
Hi! I'm a .signature *virus*! Copy me into your ~/.signature to help me spread!
Code: Select all
if( partid == W_MAX_PARTS ) {
return qtrue; // primary weap model drawn for all frames right now
}
// check draw bit
if( anim->moveSpeed & (1<<(partid+8)) ) { // hide bits are in high byte
return qfalse; // not drawn for current sequence
}
// find part's start frame for this animation sequence
// rain - & out ANIM_TOGGLEBIT or we'll go way out of bounds
for( i = 0; i < (cent->pe.weap.animationNumber & ~ANIM_TOGGLEBIT); i++ ) {
if( wi->weapAnimations[i].moveSpeed & (1<<partid) ) { // this part has animation for this sequence
frameoffset += wi->weapAnimations[i].numFrames;
}
}
// now set the correct frame into the part
if( anim->moveSpeed & (1<<partid) ) {
part->backlerp = parent->backlerp;
part->oldframe = frameoffset + ( parent->oldframe - anim->firstFrame);
part->frame = frameoffset + ( parent->frame - anim->firstFrame);
}
So basically, I can either:
- Slightly adjust some of that code above and any necessary relations to ".movespeed" if they affect the drawing
- Just add a dummy main weapon file and my normal main view model will just be a barrel part
-
- Posts: 126
- Joined: Sat Sep 25, 2004 7:12 am
- Contact:
just weld this condition
with the one bellow
Code: Select all
if( partid == W_MAX_PARTS ) {
return qtrue; // primary weap model drawn for all frames right now
}
Code: Select all
// check draw bit
if( partid != W_MAX_PARTS && anim->moveSpeed & (1<<(partid+8)) ) { // hide bits are in high byte
return qfalse; // not drawn for current sequence
}
Hi! I'm a .signature *virus*! Copy me into your ~/.signature to help me spread!