IPB

Welcome Guest ( Log In | Register )

Making weapons animations play faster/slower, just by editing a .inc file!
imtheheadhunter
post May 31 2009, 03:58 PM
Post #1


Debug assertion failed! Text:people == stupid!
Group Icon

Group: Mr. Admin
Posts: 1,005,138
Joined: 8-March 06
From: The freaking Twilight zone!
Member No.: 1,609



So, are your just like me, and don't like weapons taking half of forever to reload? Or you have a weapon who's firing animation is playing all wonky because it's too long? Well then,

Go to the animation system files for the weapon. They would be in the objects/weapons/handheld/(name-of-weapon)/AnimationSystem1p(/3p).inc file. If those files aren't there, open up the .tweak file for the weapon using notepad, and you'll see the lines, "ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/(name-of-weapon)/AnimationSystem1p.inc", and "ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/(name-of-weapon)/AnimationSystem3p.inc", those will show you where the files that weapon is using are.

Next, open them up, and you'll notice a list near the top of the file, this is where you can change the time it takes to play an animation. Find the anim you want to edit, then just add, or edit if it's there already, the "animationManager.length #" line under the anim you want to edit. You should end up with something like this,

....
animationSystem.createAnimation Objects/Weapons/Handheld/MP40/Animations/1p/1p_MP40_reload.baf
animationManager.looping 0
animationManager.length 3.5
....


And lastly, don't forget to edit any necessary sound(s) so it's length matches the animation's length, as well the reload time for the weapon in the weapon's .tweak file using notepad. Then put the edited files where they belong, and go play.

A note, I have noticed that animations won't play if your trying to make them play too fast, like, the firing animation for the FH2 MP40. Set it to a length of 0.2, it plays, set it to 0.1, and it doesn't.


--------------------
Go to the top of the page
 
+Quote Post
2 Pages V   1 2 >  
Start new topic
Replies (1 - 14)
clivewil
post May 31 2009, 07:46 PM
Post #2


meh.
Group Icon

Group: Mr. Admin
Posts: 2,008,269
Joined: 24-July 07
From: Perth, Western Australia
Member No.: 3,545



QUOTE
don't forget to edit any necessary sound/s so it's length matches the animation's length

QUOTE
Set it to a length of 0.2, it plays, set it to 0.1, and it doesn't.

i think there's a similar limitation for the sounds themselves - too short and the game engine can't handle them


--------------------
Go to the top of the page
 
+Quote Post
frank_beans
post May 31 2009, 08:50 PM
Post #3


Master Sergeant
****

Group: Soldiers
Posts: 602
Joined: 9-February 07
From: CA, USA
Member No.: 3,008



QUOTE (imtheheadhunter @ May 31 2009, 02:58 PM) *
And lastly, don't forget to edit any necessary sound/s so it's length matches the animation's length.


quick question: where exactly do you edit the sound length?


--------------------
Go to the top of the page
 
+Quote Post
imtheheadhunter
post May 31 2009, 08:58 PM
Post #4


Debug assertion failed! Text:people == stupid!
Group Icon

Group: Mr. Admin
Posts: 1,005,138
Joined: 8-March 06
From: The freaking Twilight zone!
Member No.: 1,609



QUOTE (frank_beans @ May 31 2009, 10:50 PM) *
quick question: where exactly do you edit the sound length?


You need to edit it in a sound editor(like, Audacity, Sound Forge, etc), to be able to make a sound shorter.


--------------------
Go to the top of the page
 
+Quote Post
k30dxedle
post Aug 7 2010, 06:38 PM
Post #5


Captain
***

Group: Soldiers
Posts: 78
Joined: 5-April 07
Member No.: 3,162



Sorry for reviving a very old thread, but I figured it was better than making a new one on the same topic. I've been using this technique on weapons from Project Reality with, for the most part, great success, but on certain animations it refuses to work. One's a deploy animation, and one's a reload animation, which I've both shortened to 75% of their original length. The animations stubbornly play at the original speed.

Also, would just like to point out to nubs like me that for not-incredibly-drastic speed changes like what I'm doing, changing the pitch of the corresponding sound works. For example, the pitches of the sounds corresponding to my animations playing at 75% (3/4) of their regular time are changed to 1.333 (roughly 4/3) to match.

Edit: Figured out the problem with animations refusing to speed up; they have to be in the same weapon folder, apparently (e.g. usrif_g3a3's AnimationSystem1p won't play one of rurif_ak47's animations faster, so copy it over). Also, another note about using pitch changes to speed up sounds, for weapons with multiple reload sounds (e.g. bolt-action sniper rifles cycling/reloading, pump-action shotguns cycling/the different reload animations), all of the corresponding animations have to be sped up by the same amount for it to line up.

This post has been edited by k30dxedle: Aug 10 2010, 07:45 AM
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Apr 17 2015, 11:04 AM
Post #6


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



Checking the List of Important Modding threads I noticed the following method missing from this thread, so I thought I would chime in...

To edit reload times using notepad...

Just edit the reload times and draw times in the weapons TWEAK file, and then go to the AnimationSystem1p.INC and AnimationSystem3p.INC and set the same times in the different reload and draw animations (some reload and draw animations have multiple ones for Prone, standing, etc). Also you'll need to tweak the pitch of the reload/draw sounds to match in the TWEAK file. I usually divide the animation time into quarters (divide the reload time by 4) so it's easy to tweak the pitch, so if you reduce reload time by one quarter you'd adjust the pitch for the sound from 1 to 1.25.


--------------------
Go to the top of the page
 
+Quote Post
SirPort
post Sep 12 2015, 03:13 AM
Post #7


Captain
***

Group: Soldiers
Posts: 79
Joined: 29-October 10
Member No.: 7,689



If I want to make this a server wide tweak then it would need to be made into a mod?
And if I joined a multiplayer server I would get kicked?

Thanks
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Sep 12 2015, 10:48 AM
Post #8


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE (SirPort @ Sep 12 2015, 05:13 AM) *
If I want to make this a server wide tweak then it would need to be made into a mod?
And if I joined a multiplayer server I would get kicked?

Thanks

Yes to both.


Any modifications made to the game have to be on every single PC involved or they will not be able to play together. All files have to match.


--------------------
Go to the top of the page
 
+Quote Post
John Foley
post Feb 11 2016, 10:30 AM
Post #9


Major
****

Group: Soldiers
Posts: 158
Joined: 11-February 15
Member No.: 10,511



Anyone else got problems with PR reload/deploy animations won't speed up even after being copied to the same folder as the weapon?


--------------------
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Feb 11 2016, 07:32 PM
Post #10


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE (John Foley @ Feb 11 2016, 11:30 AM) *
Anyone else got problems with PR reload/deploy animations won't speed up even after being copied to the same folder as the weapon?

You copied them over, but did you make any changes to the weapon tweak and animation files.inc? If you just copy them over unaltered they'll behave just as they did in the mod you took them from.


QUOTE
just edit the reload times and draw times in the weapons TWEAK file, and then go to the AnimationSystem1p.INC and AnimationSystem3p.INC and set the same times in the different reload and draw animations


--------------------
Go to the top of the page
 
+Quote Post
John Foley
post Feb 12 2016, 04:17 AM
Post #11


Major
****

Group: Soldiers
Posts: 158
Joined: 11-February 15
Member No.: 10,511



Yes, all of them
I've even succeeded with another weapon.
Of course, there are possibilities that all of this was just because I missed something, especially late at night
I'll just go over things again


--------------------
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Feb 12 2016, 04:04 PM
Post #12


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



Make sure filenames are original and not shared with other weapons.

I've had problems in the past with changes not taking effect because of that, as the game would take the settings from the other file paths of the same name.


--------------------
Go to the top of the page
 
+Quote Post
bobthedinosaur
post Feb 13 2016, 12:28 AM
Post #13


Dictator
******

Group: Soldiers
Posts: 2,229
Joined: 4-March 11
From: A Cold Place
Member No.: 7,896



many PR weapons use shared animations and sounds, so you could be editing the wrong animation, check the paths of the baf animation locations and the animation files themselves that store the animation as referenced from the tweak


--------------------
Not doing modding right now, so please don't ask.
Go to the top of the page
 
+Quote Post
John Foley
post Feb 13 2016, 04:38 AM
Post #14


Major
****

Group: Soldiers
Posts: 158
Joined: 11-February 15
Member No.: 10,511



Can you take a look at the files?
Attached File(s)
Attached File  Objects_extra_weapons.zip ( 669.93K ) Number of downloads: 3
 


--------------------
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Feb 13 2016, 11:46 AM
Post #15


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,440
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE (John Foley @ Feb 13 2016, 05:38 AM) *
Can you take a look at the files?

Instantly seen where you're using animations from another source in your weapons. This is what I was talking about in my above post...

QUOTE
Make sure filenames are original and not shared with other weapons.


Same thing I used to do and then realized I couldn't do it without this same problem that you're having.... Look here in your M16a4ugl...

QUOTE
animationSystem.createAnimation Objects/Weapons/Handheld/usrif_m4ugl/Animations/1p/1p_m4ugl_fire.baf
animationManager.looping 0
animationManager.length 0.5

Now the game has to make a decision. Does it take the above looping and length settings you've set from in the M16a4ugl, or does it take it from whatever settings there are in the usrif_m4ugl location?

You cannot share file locations and have separate settings. If you're using the exact same settings it won't matter, but trying to using the same code like this in different places in different ways just confuses the engine and causes you headaches. The game is going to pick one, not both. Since this animation is sourced from the usrif_m4ugl the settings that are in the usrif_m4ugl will probably be used.

Copy over the files you need, give them their own specific titles/filepath, and then you won't have this problem.


--------------------
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th November 2017 - 04:45 PM