OSP Animations [Code] Quick-fix: Crouch / Firearms Animation Fixes for Warband Mods

Users who are viewing this thread

xenoargh

Grandmaster Knight
Here's a quick-fix for people wanting to use the new Crouch feature with Warband mods, using a simple cyclic animation I built.  If you're familiar with Module System it won't take long.

It's not perfect; I really didn't have much time to make it and test it, and it probably needs another 30 frames and double the timing loop to feel a bit more natural along with some other touchup, but it's certainly better than nothing :smile:

First, download this BRF and install it as normal.

Second, import the new NW-patch animations into your mod's module_animations code. 

I'm not going to provide detailed instructions for that part at this time; basically, NW added new animations that used up some of the "unused human" slots, so if you have any custom animations, you need to move them down and get the new ones into your source.  But if you're a newbie to all this and you barely know your way around the Module System, don't panic:  if you haven't customized any animations at all, you just need the current 1
.151 module_animations.py in your source.

Third, you need to install Psiphoon's custom musket reload animations, if you want to follow all of this to the letter.  I don't think my version's significantly different than the original, so this should work.  This isn't actually required, but if you use the code I'm posting, bear in mind that I didn't write it for the stock Native reload animations, but it should work for "ready_musket" etc.'s animation references in anim_human.

Fourthly, convert the module_animations section concerning crouch behaviors with this code:

Code:
 ["crouch_unarmed", 0, amf_client_prediction,
   [4.0, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
 ],
 ["crouch_single", 0, amf_client_prediction,
   [4.5, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
 ],
 ["crouch_greatsword", 0, amf_client_prediction,
   [5.0, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],  
 ],
 ["crouch_staff", 0, amf_client_prediction,
   [4.25, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_crossbow", 0, amf_client_prediction,
   [4.15, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_ready_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2500, combat+2515, arf_blend_in_8],
 ],
 ["crouch_release_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2520, combat+2527, arf_blend_in_1],
 ],
 ["reload_musket_full", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 0, 320, arf_blend_in_8],
 ],
 ["reload_musket_two_third", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 110, 320, arf_blend_in_3],
 ],
 ["reload_musket_one_third", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 250, 320, arf_blend_in_3],
 ],
 ["crouch_pike", 0, amf_client_prediction,
   [3.3, "crouch_down", 0, 150, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_pike_recover", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
   [1.2, "crouch_standard_xeno", 0, 30, arf_blend_in_3, 0, (0, 0, 0), 0.0],  
 ],

That's pretty much it for now.  If anybody has some time to refine the animations a bit for each weapon state, that would be nice, but this one's generic enough to work with most weapons and shields that actually allow Agents to crouch atm.
 
I accidently fixed the issues with the crouching animations... I don't know how I did this exactly,
but now the animations for each sate (unwield, with different weapons) are running without any problems.
So this is what I did;

1. I just changed the animation name, priority, etc. of "stand_to_crouch" and "crouch_to_stand".
2. Then I built the module.
3. After this I reverted all values of the animations to the default values.
4. Built the module again and the animations were fixed.

I know this sound's idiotic, but this helped for me. :wink:

EDIT
My method worked, because I got all of these crouch animations in a .brf file... so sorry for this wrong solution.
But I posted a solution without adding new animations here.
 
Il tell you what I did cos me and specialist have no idea why xeno put that in op.

First, download this BRF and install it as normal.


Second, you need to install Psiphoon's custom musket reload animations

Download and install like you did with the above

Third,over write 12 of the unused human animations with this code (in module_animations)

Code:
 ["crouch_unarmed", 0, amf_client_prediction,
   [4.0, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
 ],
 ["crouch_single", 0, amf_client_prediction,
   [4.5, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
 ],
 ["crouch_greatsword", 0, amf_client_prediction,
   [5.0, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],  
 ],
 ["crouch_staff", 0, amf_client_prediction,
   [4.25, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_crossbow", 0, amf_client_prediction,
   [4.15, "crouch_standard_xeno", 0, 30, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_ready_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2500, combat+2515, arf_blend_in_8],
 ],
 ["crouch_release_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2520, combat+2527, arf_blend_in_1],
 ],
 ["reload_musket_full", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 0, 320, arf_blend_in_8],
 ],
 ["reload_musket_two_third", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 110, 320, arf_blend_in_3],
 ],
 ["reload_musket_one_third", 0, amf_priority_reload|amf_use_weapon_speed|amf_play,
   [2.0, "psiphoon_musket_reload_revised", 250, 320, arf_blend_in_3],
 ],
 ["crouch_pike", 0, amf_client_prediction,
   [3.3, "crouch_down", 0, 150, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_pike_recover", 0, amf_priority_parried|amf_use_weapon_speed|amf_play,
   [1.2, "crouch_standard_xeno", 0, 30, arf_blend_in_3, 0, (0, 0, 0), 0.0],  
 ],
 
I say it again...
No new animations are needed to fix the crouch-animation issues.

Just change the name of the animation "crouch_down" in "stand_to_crouch" and "crouch_to_stand"
(I renamed it to "crouch_down_new")
Then build the module...

After that change the animation name back to "crouch_down".
...build the module again and the animation will be fixed :!:

EDIT
My method worked, because I got all of these crouch animations in a .brf file... so sorry for this wrong solution.
But I posted a solution without adding new animations here.
 
I did all you said, and this happened

FC76E0070D38B5F400783614295D23BC5D1826F7

_Sebastian_ said:
I say it again...
No new animations are needed to fix the crouch-animation issues.

Just change the name of the animation "crouch_down" in "stand_to_crouch" and "crouch_to_stand"
(I renamed it to "crouch_down_new")
Then build the module...


EDIT: http://www.youtube.com/watch?v=ZBCmhH_RqIA&list=UUb-M8E1dP571jEUkQWK3UXw&index=1&feature=plcp

After that change the animation name back to "crouch_down".
...build the module again and the animation will be fixed :!:

When you say Just change the name of the animation "crouch_down" in "stand_to_crouch" and "crouch_to_stand are you talking about the animation name in OpenBrf?
 
Bravo2255 said:
I did all you said, and this happened

FC76E0070D38B5F400783614295D23BC5D1826F7

_Sebastian_ said:
I say it again...
No new animations are needed to fix the crouch-animation issues.

Just change the name of the animation "crouch_down" in "stand_to_crouch" and "crouch_to_stand"
(I renamed it to "crouch_down_new")
Then build the module...


EDIT: http://www.youtube.com/watch?v=ZBCmhH_RqIA&list=UUb-M8E1dP571jEUkQWK3UXw&index=1&feature=plcp

After that change the animation name back to "crouch_down".
...build the module again and the animation will be fixed :!:

When you say Just change the name of the animation "crouch_down" in "stand_to_crouch" and "crouch_to_stand are you talking about the animation name in OpenBrf?
No.
You have to do this in module_animations.py
 
So does this really work in MP? Have anyone managed to make this work ? Why not just upload the python code into a file so everyone can take a look at? (That will be alot easier?)
 
GK_Lungy said:
So does this really work in MP? Have anyone managed to make this work ? Why not just upload the python code into a file so everyone can take a look at? (That will be alot easier?)
Yes it works.

It makes no sence to upload the code, because there is absolutly no difference.

EDIT
My method worked, because I got all of these crouch animations in a .brf file... so sorry for this wrong solution.
But I posted a solution without adding new animations here.
 
Alternative way is to use default stance animations. Crouching method of 1.15x enforces lower body animation, so it is safe to use default stance animations for the crouching stance only enforces the lower body.
Code:
 ["crouch_unarmed", 0, amf_client_prediction,
   #[11.0, "crouch_stand_man", 0, 315, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
   [6.0, "crouch_down", 51, 150, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0],
 ],
 ["crouch_single", 0, amf_client_prediction,
   #[11.0, "crouch_stand_man", 0, 315, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
   [6.0, "stand_onhorse", 180, 195, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0],
 ],
 ["crouch_greatsword", 0, amf_client_prediction,
   #[6.0, "crouch_greatsword_cstance", 0, 170, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],  
     [6.0, "greatsword_cstance", 0, 91, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0],     
 ],
 ["crouch_staff", 0, amf_client_prediction,
   #[5.0, "crouch_staff_cstance", 0, 120, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
    [2.0, "staff_cstance", 0, 60, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],     
 ],
 ["crouch_crossbow", 0, amf_client_prediction,
   [2.0, "staff_cstance", 0, 60, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
 ["crouch_ready_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_keep|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2500, combat+2515, blend_in_ready],
 ],
 ["crouch_release_pistol", acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_client_owner_prediction|amf_rider_rot_pistol,
   [0.3, "anim_human", combat+2520, combat+2527, arf_blend_in_1],
 ],

The exception is for single hand weapons, as the default stance animations cause clipping for shields. Pistol and throwing weapons use single hand crouching stance too, using "crouch_down" (like I did for unarmed) will cause pistol clipping with head, so I use  "stand_onhorse". It still has a little clipping between left foot and shield.
 
Hey, Xenoargh, I was using your script and animations in my mod. However, when I'm crouching, enemies shooting at me can't aim at me, so all their shots go off to the side.
 
TheLordAidan said:
Hey, Xenoargh, I was using your script and animations in my mod. However, when I'm crouching, enemies shooting at me can't aim at me, so all their shots go off to the side.

Are you sure? Look at my men. They're alive still just because of their shields.
mb80.jpg
 
TheLordAidan said:
However, when I'm crouching, enemies shooting at me can't aim at me, so all their shots go off to the side.
They are allways aiming for the head position while standing, so they are still doing it if you crouch down... and miss.

I guess there is nothing what you can do to fix it.
Aiming seems to be completly hardcoded.
 
Back
Top Bottom