Weapon animation problem

Ask questions, discuss ideas, get answers
Post Reply
hipnox
Posts: 68
Joined: Tue Aug 09, 2011 10:34 pm

Weapon animation problem

Post by hipnox »

Hello,

I used the MDT Object Generator tool to create a copy of the k98 rifle.

Using the raw files without any modification, there's a problem with the animation where the reloading animation doesn't play after shooting, but the sound does.

I then added these lines to the AnimationStatesShoot.con file, taken from the k98 code:

Code: Select all

AnimationStateMachine.setActiveState Ub_FireAnatoRifle
AnimationStateMachine.addTransitionWhenDone Ub_StandReloadAnatoRifle
AnimationStateMachine.setActiveState Ub_LieFireAnatoRifle
AnimationStateMachine.addTransitionWhenDone Ub_LieReloadAnatoRifle
but with these codes, the reloading animation plays immediately after shooting (its starts playin as soon as i left click) instead of playing after the shooting animation. Its like the shooting animation isn't even there.

Any ideas?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Weapon animation problem

Post by Swaffy »

I made an 870 shotgun that uses my No4 animations, but at a faster speed.

By the way, you don't need the actual animation files, because you'll just be copying the No4's existing anims to your new gun using coding. I know that BF:MDT's Object Generator copies and renames the animation files to work with the new gun, but you shouldn't have to use those files.

(My recommendation is to not use the Object Generator, since I find my way to be easier and more organized. But that's my personal preference.)

This is the new animation coding/speeds for the AnatoRifle using No4 animations (Remember, this is the No4 coding, not K98 coding).

1pAnimationsTweaking.con

Code: Select all

AnimationStateMachine.set1pAnimationSpeed Ub_StandAnatoRifle 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_TurnAnatoRifle 0.70
AnimationStateMachine.set1pAnimationSpeed Ub_StandAimAnatoRifle 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_WalkForwardAnatoRifle 0.50
AnimationStateMachine.set1pAnimationSpeed Ub_WalkBackwardAnatoRifle 0.50
AnimationStateMachine.set1pAnimationSpeed Ub_RunForwardAnatoRifle 1.54
AnimationStateMachine.set1pAnimationSpeed Ub_RunBackwardAnatoRifle 1.54
AnimationStateMachine.set1pAnimationSpeed Ub_StrafeLeftAnatoRifle 1.54
AnimationStateMachine.set1pAnimationSpeed Ub_StrafeRightAnatoRifle 1.54
AnimationStateMachine.set1pAnimationSpeed Ub_StandJumpAnatoRifle 0.40
AnimationStateMachine.set1pAnimationSpeed Ub_RunJumpAnatoRifle 1.20
AnimationStateMachine.set1pAnimationSpeed Ub_FireAnatoRifle 3.00
AnimationStateMachine.set1pAnimationSpeed Ub_LieFireAnatoRifle 3.00
AnimationStateMachine.set1pAnimationSpeed Ub_IdleAnatoRifle1 0.48
AnimationStateMachine.set1pAnimationSpeed Ub_IdleAnatoRifle2 0.75
AnimationStateMachine.set1pAnimationSpeed Ub_IdleAnatoRifle3 0.76
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchIdleAnatoRifle1 0.48
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchIdleAnatoRifle2 0.75
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchIdleAnatoRifle3 0.76
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchAnatoRifle 0.36
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchTurnAnatoRifle 0.50
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchForwardAnatoRifle 0.83
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchBackwardAnatoRifle 0.83
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchStrafeLeftAnatoRifle 0.83
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchStrafeRightAnatoRifle 0.83
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchToLieAnatoRifle 0.60
AnimationStateMachine.set1pAnimationSpeed Ub_LieToCrouchAnatoRifle 0.60
AnimationStateMachine.set1pAnimationSpeed Ub_LieToStandAnatoRifle 0.60
AnimationStateMachine.set1pAnimationSpeed Ub_LieAnatoRifle 0.36
AnimationStateMachine.set1pAnimationSpeed Ub_LieForwardAnatoRifle 0.79
AnimationStateMachine.set1pAnimationSpeed Ub_LieBackwardAnatoRifle 0.79
AnimationStateMachine.set1pAnimationSpeed Ub_LieTurnLeftAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_LieTurnRightAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_LieStrafeLeftAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_LieStrafeRightAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_RunStandToLieAnatoRifle 1.50
AnimationStateMachine.set1pAnimationSpeed Ub_StandReloadAnatoRifle 0.60
AnimationStateMachine.set1pAnimationSpeed Ub_LieReloadAnatoRifle 0.60
AnimationStateMachine.set1pAnimationSpeed Ub_StandRaiseWeaponAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_CrouchRaiseWeaponAnatoRifle 1.00
AnimationStateMachine.set1pAnimationSpeed Ub_LieRaiseWeaponAnatoRifle 1.00
3pAnimationsTweaking.con

Code: Select all

AnimationStateMachine.set3pAnimationSpeed Ub_StandAnatoRifle 0.60
AnimationStateMachine.set3pAnimationSpeed Ub_TurnAnatoRifle 1.60
AnimationStateMachine.set3pAnimationSpeed Ub_StandAimAnatoRifle 0.80
AnimationStateMachine.set3pAnimationSpeed Ub_WalkForwardAnatoRifle 1.0
AnimationStateMachine.set3pAnimationSpeed Ub_WalkBackwardAnatoRifle -1.0
AnimationStateMachine.set3pAnimationSpeed Ub_RunForwardAnatoRifle 1.60
AnimationStateMachine.set3pAnimationSpeed Ub_RunBackwardAnatoRifle -1.60
AnimationStateMachine.set3pAnimationSpeed Ub_StrafeLeftAnatoRifle 1.30
AnimationStateMachine.set3pAnimationSpeed Ub_StrafeRightAnatoRifle 1.30
AnimationStateMachine.set3pAnimationSpeed Ub_StandJumpAnatoRifle 1.10
AnimationStateMachine.set3pAnimationSpeed Ub_RunJumpAnatoRifle 1.22
AnimationStateMachine.set3pAnimationSpeed Ub_FireAnatoRifle 3.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieFireAnatoRifle 3.00
AnimationStateMachine.set3pAnimationSpeed Ub_IdleAnatoRifle1 0.50
AnimationStateMachine.set3pAnimationSpeed Ub_IdleAnatoRifle2 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_IdleAnatoRifle3 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchIdleAnatoRifle1 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchIdleAnatoRifle2 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchIdleAnatoRifle3 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchAnatoRifle 0.80
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchTurnAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchForwardAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchBackwardAnatoRifle -1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchStrafeLeftAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchStrafeRightAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchToLieAnatoRifle 1.60
AnimationStateMachine.set3pAnimationSpeed Ub_LieToCrouchAnatoRifle -2.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieToStandAnatoRifle -3.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieForwardAnatoRifle 1.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieBackwardAnatoRifle -0.80
AnimationStateMachine.set3pAnimationSpeed Ub_LieTurnLeftAnatoRifle 2.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieTurnRightAnatoRifle 2.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieStrafeLeftAnatoRifle 2.00
AnimationStateMachine.set3pAnimationSpeed Ub_LieStrafeRightAnatoRifle 2.00
AnimationStateMachine.set3pAnimationSpeed Ub_RunStandToLieAnatoRifle 1.40
AnimationStateMachine.set3pAnimationSpeed Ub_StandReloadAnatoRifle 0.52
AnimationStateMachine.set3pAnimationSpeed Ub_LieReloadAnatoRifle 0.52
AnimationStateMachine.set3pAnimationSpeed Ub_StandRaiseWeaponAnatoRifle -1.60
AnimationStateMachine.set3pAnimationSpeed Ub_CrouchRaiseWeaponAnatoRifle -1.60
AnimationStateMachine.set3pAnimationSpeed Ub_LieRaiseWeaponAnatoRifle -1.60
AnimationStatesReload.con

Code: Select all

AnimationStateMachine.setActiveState WeaponReloadNo4
AnimationStateMachine.copyState2 AnatoRifle No4
AnimationStatesShoot.con

Code: Select all

AnimationStateMachine.setActiveState Ub_FireAnatoRifle
AnimationStateMachine.addTransitionWhenDone Ub_StandReloadAnatoRifle
AnimationStateMachine.setActiveState Ub_LieFireAnatoRifle
AnimationStateMachine.addTransitionWhenDone Ub_LieReloadAnatoRifle
MiscAnimationsTweaking.con

Code: Select all

AnimationStateMachine.set3pAnimationSpeed WeaponReloadAnatoRifle 0.60
SingleShotWeapons.con

Code: Select all

AnimationStateMachine.copyState AnatoRifle v_arg1 No4 1.0 No4 1.0
AnimationStateMachine.copyState2 AnatoRifle v_arg1 No4 1.0 No4 1.0
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
hipnox
Posts: 68
Joined: Tue Aug 09, 2011 10:34 pm

Re: Weapon animation problem

Post by hipnox »

Will try that

So, all you do is copy and rename the weapon in the Objects.rfa and then add these lines to the animations.rfa? no need to copy and rename any animation files?
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Weapon animation problem

Post by Swaffy »

Correct. But I forgot, you need to copy the "k98.skn" file and rename it to "anatorifle.skn" or whatever your gun's name is.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Post Reply