how to add animations to a new weapon???
- Dennis|8749236
- Posts: 239
- Joined: Sun Nov 29, 2009 6:02 am
- Location: Earth
- Contact:
how to add animations to a new weapon???
when i creat a new weapon with new name, the animation will not working anymore... how to give the new weapon animations?
What is the meaning of Life?? (Don't think about it!)
- Crimson_Raptor
- Posts: 18
- Joined: Fri Jun 25, 2010 3:17 am
- Location: Tulsa, Oklahoma
- Contact:
Re: how to add animations to a new weapon???
Well the best way, if you don't have your own custom animation made in Gmax, is to reuse an animation from an existing ingame weapon.
Here's what you're going to what to do (you didn't mention the weapon, so I'm just going to use the thompson as an example)
Say you weapon name is "bigassgun," and it is an AUTOMATIC weapon, right? The automatic is important, because if you have a singleshot weapon like the sniper rifles, then that is different.
So you use WinRFA 2.05 to unpack the original '42 "animations.rfa." Within that folder(wherever you unpack it too) there is a test document called "multiShotWeapons.inc" (inc format should open in notepad, if it doesn't then make sure it does by saying "always use this program") and open it up.
You will see a listing of all the weapons ingame and the basic formula is as follows:
So you would put a line in there that says:
I've forgotten why you have have to put the two weapon 1.0's in there, but I think it has something to do with the to copy the 3rd person animation. So now that you'd done that, and hopefully you have properly fixed your bigassgun's "Objects.con" and had something to the effect of:
So now that you've done that, your gun will work ingame without crashing due to an animation error. However, your weapon, because it's copying an existing animation.ske, it will animate rather fast, especially when reloading. It'll look like you are Flash Gordon, lol.
So, we'll need to fix that. Meaning, it gets a little more complicated, but don't be scared. 
Now you need to open up the text file within the animations folder called "1pAnimationsTweaking.con." Again, it is a .con format, and that is simply a fancy way to say .txt, so you needed to open it up with notepad as the default program always. I assume you know how to do this, but I'm just imprinting it again for anyone else that wasn't listening or wants to mod and will read this, lol. So you open it up and... well, crap! I forgot that '42 has all the weapons jumbled together except for the DP and the Type 99 machine guns. Basically you'll see something like this:
And it goes on like that for about 40 lines of code. So you need to copy each one of those animation speeds so that the game recognizes that the "bigassgun" needs to play those animations at that speed for the player ingame. So change them to...you guessed it:
And boom your animation, that copies itself from the thompson.ske, will work normally ingame. The last thing you need to do is make sure the 3rd person animations are just as slowed down. They are located in the "3pAnimationsTweaking.con" document.
And you change everything that says "thompson" to "bigassgun" and you're basically done.
One thing to note is that you can save a tremendous amount of work if you already have a properly scaled custom weapon, to take those .rs and .sm files and rename like thompson.rs and thompson.sm or whatever the weapon whose animations you want to use and put that in your mod's folder so that you can see what it'll look like ingame. That way if you don't like the way it looks or handles 1st person wise, then you've saved yourself all the trouble up above. I wish I had figured that out when I started out modding, but I tend to do things that hard way and the long way around, but it teaches me to understand how everything works down the road. But for newer blood, it helps to use the "easier way, lol! I hope this helps you out. Let me know if you have any problem.
Here's what you're going to what to do (you didn't mention the weapon, so I'm just going to use the thompson as an example)
Say you weapon name is "bigassgun," and it is an AUTOMATIC weapon, right? The automatic is important, because if you have a singleshot weapon like the sniper rifles, then that is different.
So you use WinRFA 2.05 to unpack the original '42 "animations.rfa." Within that folder(wherever you unpack it too) there is a test document called "multiShotWeapons.inc" (inc format should open in notepad, if it doesn't then make sure it does by saying "always use this program") and open it up.
You will see a listing of all the weapons ingame and the basic formula is as follows:
Code: Select all
yourcustomweapon v_arg1 animationtocopyanduse 1.0 animationtocopyanduse 1.0
Code: Select all
AnimationStateMachine.copyState2 bigassgun v_arg1 thompson 1.0 thompson 1.0
Code: Select all
ObjectTemplate.createSkeleton animations/thompson.ske
ObjectTemplate.useSkeletonPartAsMain Base
ObjectTemplate.create AnimatedBundle bigassgunComplex
ObjectTemplate.createSkeleton animations/thompson.ske


Now you need to open up the text file within the animations folder called "1pAnimationsTweaking.con." Again, it is a .con format, and that is simply a fancy way to say .txt, so you needed to open it up with notepad as the default program always. I assume you know how to do this, but I'm just imprinting it again for anyone else that wasn't listening or wants to mod and will read this, lol. So you open it up and... well, crap! I forgot that '42 has all the weapons jumbled together except for the DP and the Type 99 machine guns. Basically you'll see something like this:
Code: Select all
rem ---- Thompson
AnimationStateMachine.set1pAnimationSpeed Ub_StandThompson 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_TurnThompson 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_StandAimThompson 0.1
Code: Select all
rem ---- bigassgun
AnimationStateMachine.set1pAnimationSpeed Ub_Standbigassgun 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_Turnbigassgun 0.1
AnimationStateMachine.set1pAnimationSpeed Ub_StandAimbigassgun 0.1
Code: Select all
rem ---- thompson
AnimationStateMachine.set3pAnimationSpeed Ub_StandThompson 0.60
AnimationStateMachine.set3pAnimationSpeed Ub_TurnThompson 1.60
AnimationStateMachine.set3pAnimationSpeed Ub_StandAimThompson 0.80
One thing to note is that you can save a tremendous amount of work if you already have a properly scaled custom weapon, to take those .rs and .sm files and rename like thompson.rs and thompson.sm or whatever the weapon whose animations you want to use and put that in your mod's folder so that you can see what it'll look like ingame. That way if you don't like the way it looks or handles 1st person wise, then you've saved yourself all the trouble up above. I wish I had figured that out when I started out modding, but I tend to do things that hard way and the long way around, but it teaches me to understand how everything works down the road. But for newer blood, it helps to use the "easier way, lol! I hope this helps you out. Let me know if you have any problem.
"I want you to remember that no bastard ever won a war by dying for his country. He won it by making the other poor dumb bastard die for his country."
- Dennis|8749236
- Posts: 239
- Joined: Sun Nov 29, 2009 6:02 am
- Location: Earth
- Contact:
Re: how to add animations to a new weapon???
now i just make 3p animation working properly and 1p is not working 

What is the meaning of Life?? (Don't think about it!)
- Dennis|8749236
- Posts: 239
- Joined: Sun Nov 29, 2009 6:02 am
- Location: Earth
- Contact:
Re: how to add animations to a new weapon???
sorry... mine is single shot..
What is the meaning of Life?? (Don't think about it!)
- Crimson_Raptor
- Posts: 18
- Joined: Fri Jun 25, 2010 3:17 am
- Location: Tulsa, Oklahoma
- Contact:
Re: how to add animations to a new weapon???
Oh well in that case, instead of editing the multiShotWeapons.inc you just edit the singleShotWeapons.inc to the following formila, using the no4 rifle to replace the thompson gun:
It is important to have both copystate and copystate2 in that file. Not sure why, but it may crash.

Code: Select all
AnimationStateMachine.copyState bigassgun v_arg1 no4 1.0 no4 1.0
AnimationStateMachine.copyState2 bigassgun v_arg1 no4 1.0 no4 1.0

"I want you to remember that no bastard ever won a war by dying for his country. He won it by making the other poor dumb bastard die for his country."
- Dennis|8749236
- Posts: 239
- Joined: Sun Nov 29, 2009 6:02 am
- Location: Earth
- Contact:
Re: how to add animations to a new weapon???
Problem solved..
the problem is.... i wrote: AnimationStateMachine.copyState M1CGarand v_arg1 M1Garand 1.0 M1CGarand 1.0

the problem is.... i wrote: AnimationStateMachine.copyState M1CGarand v_arg1 M1Garand 1.0 M1CGarand 1.0

What is the meaning of Life?? (Don't think about it!)
- Dennis|8749236
- Posts: 239
- Joined: Sun Nov 29, 2009 6:02 am
- Location: Earth
- Contact:
Re: how to add animations to a new weapon???
copystate is 1st person animation
copystate2 is 2nd person animation
:D
copystate2 is 2nd person animation
:D
What is the meaning of Life?? (Don't think about it!)
- Crimson_Raptor
- Posts: 18
- Joined: Fri Jun 25, 2010 3:17 am
- Location: Tulsa, Oklahoma
- Contact:
Re: how to add animations to a new weapon???
That makes, since, lol. I haven't messed with the animations in a while. Glad I could help. 

"I want you to remember that no bastard ever won a war by dying for his country. He won it by making the other poor dumb bastard die for his country."