LSP Kit Combat [Anim] Spear "Two-Attack Direction" Solution Kit [Update]

Currently viewing this thread:

Sahran

Grandmaster Knight
Credits:

Papa Lazarou's great work (used for underhand thrust): http://forums.taleworlds.com/index.php/topic,134185.0.html

Moderation: The animations only allow for use by other modders in their (mod) projects. Code itself can be considered OSP

The folks in the topic who've offered some critiques and help!



What this does:

-Spears on foot are able to attack in two directions. Up (overhand) and Down (Underhand).
-Spears on horseback are only able to thrust underhand (Down)

-1h weaponry are now unaffected by this change.


Installation for players
http://www.sendspace.com/file/aoiqw7
http://www.mediafire.com/?i4r7g492z4rn7p1
Drop the text files (actions & items_kind) into your module's folder. Add animation_two_spear_strike to your load_module_item list in the module text file. All spears are adjusted to be able to attack up and down - lances are not touched. So unless I left a bug in there, it should work for you just to drop in and play. If you have an existing item file you want to adjust to:

1) Make Spears swing and thrust damage the same damage and damage type (pierce)
2) You have to make sure that spears are classified as 'itc_staff' in the python file. This'll let them attack up and low, so I am not sure how to do it just with text files.

=======================================================================================================================

Installation for Modders
http://www.sendspace.com/file/oe7p9x
http://www.mediafire.com/?uqbtpniq5rjwdlk

Use the included python files, make sure you add the animation_two_spear_strike to the load_module_items list.

In Text Files

Make all spears have the same swing damage + damage type (pierce) as their thrust + thrust damage type (pierce).

Highly suggest adding the itp_no_blur to spears, as otherwise their overhand thrust blurs really silly like.

In the python files, what you have to edit:

header_items: Replace itc_staff's line with this:

Code:
itc_staff      = itc_parry_polearm| itcf_thrust_onehanded_lance |itcf_thrust_onehanded_lance_horseback | itcf_overswing_musket | itcf_overswing_polearm |itcf_thrust_polearm|itcf_slashright_polearm|itcf_slashleft_polearm

module_animations: More complicated. You need to find and replace the following entries:
Code:
["ready_thrust_onehanded",   acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
##   [ready_durn, "anim_human", combat+8500, combat+8510, blend_in_ready],
   [ready_durn, "1h_low_thrust_30.9.10", 0, 5, blend_in_ready], 
  ],
 ["release_thrust_onehanded", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
##   [0.61, "anim_human", combat+8510, combat+8540, blend_in_release], 
   [0.62, "1h_low_thrust_30.9.10", 5, 34, blend_in_release],
 ],
 ["release_thrust_onehanded_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
   [0.35, "1h_low_thrust_30.9.10", 34, 39, blend_in_continue],
 ],
 ["blocked_thrust_onehanded", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_blocked_duration_thrust, "parry_single_lefttoright", 0, 75, blend_in_parry], 
 ],
 ["parried_thrust_onehanded", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_parried_duration_thrust, "parry_single_lefttoright", 0, 75, blend_in_parry],
Code:
 ["ready_thrust_onehanded_lance",   acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
##   [ready_durn, "anim_human", combat+8500, combat+8510, blend_in_ready],
   [ready_durn, "1h_low_thrust_30.9.10", 0, 5, blend_in_ready], 
  ],
 ["release_thrust_onehanded_lance", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
##   [0.61, "anim_human", combat+8510, combat+8540, blend_in_release], 
   [0.62, "1h_low_thrust_30.9.10", 5, 34, blend_in_release],
 ],
 ["release_thrust_onehanded_lance_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
   [0.35, "1h_low_thrust_30.9.10", 34, 39, blend_in_continue],
 ],
 ["blocked_thrust_onehanded_lance", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_blocked_duration_thrust, "anim_human", combat+9515, combat+9513, blend_in_parry], 
 ],
 ["parried_thrust_onehanded_lance", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_parried_duration_thrust, "anim_human", combat+9515, combat+9513, blend_in_parry],
Code:
["ready_overswing_musket",   acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction|amf_rider_rot_thrust,
##   [ready_durn, "anim_human", combat+8500, combat+8510, blend_in_ready], 
   [ready_durn, "attacks_thrust_onehanded", 5, 13, blend_in_ready], 
 ],
 ["release_overswing_musket", acf_thrust|acf_rot_vertical_sword|acf_anim_length(100)|acf_enforce_rightside, amf_priority_attack|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_continue_to_next,
##   [0.61, "anim_human", combat+8510, combat+8540, blend_in_release], 
   [0.62, "attacks_thrust_onehanded", 12, 32, blend_in_release], 
 ],
 ["release_overswing_musket_continue", 0, amf_priority_continue|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust|amf_client_owner_prediction,
   [0.3, "attacks_thrust_onehanded", 32, 54, blend_in_continue], 
 ],
 ["blocked_thrust_overswing_musket", acf_enforce_rightside, amf_priority_blocked|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_blocked_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry], 
 ],
 ["parried_thrust_overswing_musket", acf_enforce_rightside, amf_priority_parried|amf_use_weapon_speed|amf_play|amf_rider_rot_thrust,
   [attack_parried_duration_thrust, "anim_human", combat+8515, combat+8513, blend_in_parry],
 

Eagle114th

Sergeant Knight at Arms
M&BWBWF&SNWVC
This is something I have been waiting to see in warband for SOOO long time!  This have been HUGELY missing from warband itself and I am very blessed to see this mod released!  You are our hero!  It always seem not right when there is 'lower thrust blocking" that block thrusting weapon from anywhere from top to bottom and this mod solve that problem.

:smile:


Eagle out...
 

Somebody

Code Pope
Baron
WBWF&S
What about blocking directions? Play with the tutorial and see if the trainer bots will respond to the prompted direction.
 

Sahran

Grandmaster Knight
Appreciate the kind words, I hope other mods will make use of it as I'm really a fan of spear combat and hated how 'gimped' I felt. Of course for multiplayer mods like CRPG it is a bit less viable because it changes the expected block direction (Players used to blocking up to deflect a downward blow will not block it).

Somebody:

The AI blocks perfectly fine in tutorial. I attempt an 'up' attack with the sword (a thrust overhand) and he blocks it. I attempt a 'down' attack with the sword (a swing down) and he blocks it. The block animations aren't quite where I want them, since they are designed for the vanilla method (a high block for a overswing or up attack, a low block for a thrust or down attack), but I am not sure how I could go about changing it looking at the code myself.

Might give it a try in the near future, but not just yet.
 

Kazzan

Count
M&BWBNW
itcf_overswing_musket works with a shield, meaning you use it as a onehanded overhead thrust if you replace the animations so that you don't have to sacrifice the regular onehanded overhead.
You can also add itp_no_blur to the item in module_items to remove the blur of the weapons.
- Fredelios
 

Sahran

Grandmaster Knight
That's so? Well that's great and slightly bad (as it makes my work moot!  :mrgreen:). But since that would avoid having to change the attack directions it'd make the code much more viable for multiplayer-centric mods.

I am going to be giving my PC to tech people to upgrade for a day or so - I am not sure if I'll be able to/wanting to code on my laptop, but I will try that out soon Kazzan. I appreciate the heads up about that.

 

Sahran

Grandmaster Knight
Kazzan: That system works on foot. However when I am on horseback it seems to lock me into one attack direction - thrusting. Overswing musket doesn't seem to work on horseback. If people really don't like the switch in attack directions I could make a version where it just benefits the foot spearmen (thereby not requiring the mojo of changing up-down attacks). But for now I'll stick with the current system - I always hated how I'd be riding on horseback and thrust and some guy would easily block the spear strike since it's only one attack direction.

 

Cayetann

Sergeant
M&BWBNWVC
I tried all ways you mentioned and... it doesn't work.  ;/ Can you help me? :smile: I tried with .py files using a way for modders.
 

Wibbler

Regular
(Bit of a late response but...)


Could you describe what you did and what happens when you compile/create a game Tajulek? Works perfectly for me!  :smile:
 

Sahran

Grandmaster Knight
I just realized a potential problem. It may be that thrust damage is based on attack direction rather than animation. In which case this OSP will be redone (as it means your swing does thrust damage, your thrust does swing damage).

The good news is that Kazzan's technique will fix it. Spears would just have thrust and swing damage be the same. The bad news is when I tried kazzan's method it didn't work for cavalry, so they'll be stuck with one thrust attack but infantry wont. This'll be determined once I do some simple testing (make thrust damage 0, swing damage some insane amount. If the enemy dies instantly when I thrust then it means what I wrote above. If it uses animation to determine thrust damage, then we're good).


Used one of our Naue swords as a basis. Swing damage was 0, Thrust damage was 100. Unfortunately when I slashed down (up attack) it counted as a thrust, and I killed them instantly vs not doing any damage.

So I'll be switching to Kazzan's method in a day or so then upload the necessary files. My bad for not testing this before folks!
 

Sahran

Grandmaster Knight
Updated, and fixed! You really need to re-download this if you downloaded it before, as I left a glaring issue that was noted in a post or two above this one!
 

Somebody

Code Pope
Baron
WBWF&S
Are you sure about the last 2 animation for blocked/parried_thrust_overswing_musket? Did you need to remove 2 of the unused animation for that? Your code blocks for module_animation in the post are missing the last ],
 

Sahran

Grandmaster Knight
I just copied them over from the existing musket overswing animation, so "if it ain't broke, don't fix it" is my perspective. I will admit I haven't given this thorough testing but I don't think there should be any glaring problems. If there is, report it and if it's in my power I will try and fix it.

Also if any modders prefer overhand thrusting on horseback I set up the code to do so for SITD, so just message me and I'll send the python file over. Though this means overhand thrusting becomes down attack on spears (and up attack is underhand - a bit counter intuitive yet it was necessary and since vanilla 1h thrust is already down attack, it's kinda okay!)
 

Scuba Steve

Master Knight
M&BWBWF&SNWVC
I know this is an old thread and I'm not the kind of person who likes committing thread necromancy, but I figured I ought to try this out. Unfortunately I had some problems with the animation when I first tried putting this into Native.

Examples below:

Up Attack
2013-03-15_00004.jpg
Down Attack:
2013-03-15_00002.jpg

I wasn't entirely sure what was causing the issue with the down attack animation not showing up, and initially I was just going to post here and ask for help, but I did some troubleshooting on my own and while I don't know if it's the right fix, but it appears to work for me.

Noticing that Sahran used Papa Lazarou's Combat Animation Enhancement for the mod, I looked to see what ways this mod might have interacted with it which might not have been as apparent to me when first following the instructions. Then it dawned on me that it might be a skeleton issue, and so I copied the skeletons.brf from Papa Lazarou's mod like he says to do, and I put it in the resources and worked it with the ini with:

load_mod_resource = skeletons

And lo and behold the animations worked after doing this.

Up Attack:
2013-03-15_00009.jpg
Down Attack:
2013-03-15_00010.jpg

So a note to anyone who might be using this and has the same problem as I did in trying to insert this into Native, try using Papa Lazarou's skeletons.brf from the Combat Animation Enhancement mod, and follow his instructions in inserting it into another mod, make sure it's loaded in the module.ini, and if you did everything else right like Sahran instructed, it should work perfectly fine.

Thanks for making this Sahran, it works great now, and the problem I had was likely just from my own stupidity.

I might try to see if I can put it in another mod just to try it out, but as it is, it's a hell of a lot of fun just to play native as a spear and shield warrior who is capable of attacking in more than one direction. Spears have become infinitely better because of this.
 
Top Bottom