Wuan
Regular

With the help of WSE2 and his author K700, I soon realized the animations of twohanded four-dir attack and twohand lance thrust on horseback, like Bannerlord.
This can only allow twohanded swing left and right, If you want to realize the animations of twohanded overswing and thrust, you need to
Now you will find sometimes you can't attack to the left or right on horseback, so you should
Add to any required scene in module_mission_templates.py
Code:
##Wuan Add two hand animations on horseback Optimized by SupaNinjaMan
twh_anim_horseback_replace_triggers= [
(ti_on_item_wielded, 0, 0, [],
[
# Store trigger parameters (check header_triggers.py for detailed information)
(store_trigger_param_1, ":agent_no"),
(store_trigger_param_2, ":item"),
# Check that this character is valid
# This should be redundant because only living human agents can equip, but just to be sure.
(agent_is_active, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
# Set up variables to be used later. This is for clarity
(agent_get_horse, ":horse", ":agent_no"), # The agent's horse (or not)
(item_get_type, ":wp_type", ":item"), # The item type of the equipped item that triggered
(try_begin),
(eq, ":wp_type", itp_type_shield), ##If the item type is shield
(agent_set_slot, ":agent_no", slot_has_shield, 1),
(agent_get_wielded_item, ":item", ":agent_no", 0), # Get the right hand weapon
(gt, ":item", -1),
(item_get_type, ":wp_type", ":item"), # The item type of the right hand weapon
(try_end),
## In order to deal with the situation where the shield is automatically equipped or removed when changing weapons
(try_begin),
(agent_slot_eq, ":agent_no", slot_has_shield, 1),
(gt, ":item", -1),
(item_has_property, ":item", itp_two_handed),
(agent_set_slot, ":agent_no", slot_has_shield, 2),
(else_try),
(agent_slot_eq, ":agent_no", slot_has_shield, 2),
(gt, ":item", -1),
(neg|item_has_property, ":item", itp_two_handed),
(agent_set_slot, ":agent_no", slot_has_shield, 1),
(try_end),
(try_begin),
(ge, ":horse", 0), # Agent is mounted
(neg|agent_slot_eq, ":agent_no", slot_has_shield, 1), # Ensures there is no off-hand item
(this_or_next|eq, ":wp_type", itp_type_two_handed_wpn), # Item equipped is two-handed or,
(eq, ":wp_type", itp_type_polearm), # Item equipped is a polearm
(call_script, "script_cf_agent_set_personal_animation", ":agent_no"),
(else_try),
#restore default animation ##WSE
(agent_slot_eq, ":agent_no", slot_agent_personal_animation, 1), # Is currently using a modified animation set while they shouldn't
(agent_set_default_animations, ":agent_no"), # Revert the animations to default
(agent_set_slot, ":agent_no", slot_agent_personal_animation, 0), # And update this slot so we know their animations are at default
(try_end),
]),
(ti_on_item_unwielded, 0, 0, [],
[
# Store trigger parameters (check header_triggers.py for detailed information)
(store_trigger_param_1, ":agent_no"),
(store_trigger_param_2, ":item"),
# Check that this character is valid
# This should be redundant because only living human agents can equip, but just to be sure.
(agent_is_active, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
# Set up variables to be used later. This is for clarity
(agent_get_horse, ":horse", ":agent_no"), # The agent's horse (or not)
(item_get_type, ":wp_type", ":item"), # The item type of the equipped item that triggered
(try_begin),
(eq, ":wp_type", itp_type_shield), #If the item type is shield
(agent_set_slot, ":agent_no", slot_has_shield, 0), # Clean the slot
(agent_get_wielded_item, ":item", ":agent_no", 0), # Get the right hand weapon
(gt, ":item", -1), # Something is equipped?
(item_get_type, ":wp_type", ":item"), # Get the weapon type
(try_end),
(try_begin),
(ge, ":horse", 0), # Agent is mounted
(this_or_next|eq, ":wp_type", itp_type_two_handed_wpn), # Item equipped is two-handed or,
(eq, ":wp_type", itp_type_polearm), # Item equipped is a polearm
(call_script, "script_cf_agent_set_personal_animation", ":agent_no"),
(else_try),
(agent_slot_eq, ":agent_no", slot_agent_personal_animation, 1), # Is currently using a modified animation set while they shouldn't
#restore default animation ##WSE
(agent_set_default_animations, ":agent_no"), # Revert the animations to default
(agent_set_slot, ":agent_no", slot_agent_personal_animation, 0), # And update this slot so we know their animations are at default
(try_end),
]),
(ti_on_agent_mount, 0, 0, [],
[
# Store trigger parameters (check header_triggers.py for detailed information)
(store_trigger_param_1, ":agent_no"),
(agent_is_active, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_wielded_item, ":shield", ":agent_no", 1), # Get the off-hand weapon
(agent_get_wielded_item, ":item", ":agent_no", 0), # Get the right hand weapon
(gt, ":item", -1),
(item_get_type, ":wp_type", ":item"), # The item type of the right hand weapon
(try_begin),
(eq, ":shield", -1), # Ensures there is no off-hand item
(this_or_next|eq, ":wp_type", itp_type_two_handed_wpn), # Item equipped is two-handed or,
(eq, ":wp_type", itp_type_polearm), # Item equipped is a polearm
(call_script, "script_cf_agent_set_personal_animation", ":agent_no"),
(else_try),
#restore default animation ##WSE
(agent_slot_eq, ":agent_no", slot_agent_personal_animation, 1), # Is currently using a modified animation set while they shouldn't
(agent_set_default_animations, ":agent_no"), # Revert the animations to default
(agent_set_slot, ":agent_no", slot_agent_personal_animation, 0), # And update this slot so we know their animations are at default
(try_end),
]),
(ti_on_agent_dismount, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
#restore default animation ##WSE
(agent_slot_eq, ":agent_no", slot_agent_personal_animation, 1), # Is currently using a modified animation set while they shouldn't
(agent_set_default_animations, ":agent_no"), # Revert the animations to default
(agent_set_slot, ":agent_no", slot_agent_personal_animation, 0), # And update this slot so we know their animations are at default
]),
(ti_on_item_dropped, 0, 0, [],
[
(store_trigger_param_1, ":agent_no"),
(store_trigger_param_2, ":item"),
(item_get_type, ":wp_type", ":item", ":item"),
(eq, ":wp_type", itp_type_shield),
(agent_set_slot, ":agent_no", slot_has_shield, 0),
]),
]
##Wuan
Code:
##Wuan
("cf_agent_set_personal_animation",
[
(store_script_param, ":agent_no", 1),
(try_begin),
(agent_slot_eq, ":agent_no", slot_agent_personal_animation, 0), # Is currently using a default animation set while they should use a modified set
#set new animation ##WSE
(agent_set_personal_animation, ":agent_no", "anim_ready_thrust_onehanded_lance", "anim_ready_thrust_staff"),
(agent_set_personal_animation, ":agent_no", "anim_release_thrust_onehanded_lance", "anim_release_thrust_staff"),
(agent_set_personal_animation, ":agent_no", "anim_release_thrust_onehanded_lance_continue", "anim_release_thrust_staff_continue"),
(agent_set_personal_animation, ":agent_no", "anim_blocked_thrust_onehanded_lance", "anim_blocked_thrust_staff"),
(agent_set_personal_animation, ":agent_no", "anim_parried_thrust_onehanded_lance", "anim_parried_thrust_staff"),
(agent_set_personal_animation, ":agent_no", "anim_ready_slash_horseback_right", "anim_ready_slashright_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_slash_horseback_right", "anim_release_slashright_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_slash_horseback_right_continue", "anim_release_slashright_twohanded_continue"),
(agent_set_personal_animation, ":agent_no", "anim_blocked_slash_horseback_right", "anim_blocked_slashright_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_parried_slash_horseback_right", "anim_parried_slashright_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_ready_slash_horseback_left", "anim_ready_slashleft_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_slash_horseback_left", "anim_release_slashleft_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_slash_horseback_left_continue", "anim_release_slashleft_twohanded_continue"),
(agent_set_personal_animation, ":agent_no", "anim_blocked_slash_horseback_left", "anim_blocked_slashleft_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_parried_slash_horseback_left", "anim_parried_slashleft_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_ready_overswing_onehanded", "anim_ready_overswing_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_overswing_onehanded", "anim_release_overswing_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_overswing_onehanded_continue", "anim_release_overswing_twohanded_continue"),
(agent_set_personal_animation, ":agent_no", "anim_blocked_overswing_onehanded", "anim_blocked_overswing_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_parried_overswing_onehanded", "anim_parried_overswing_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_ready_thrust_onehanded_horseback", "anim_ready_thrust_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_thrust_onehanded_horseback", "anim_release_thrust_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_release_thrust_onehanded_horseback_continue", "anim_release_thrust_twohanded_continue"),
(agent_set_personal_animation, ":agent_no", "anim_blocked_thrust_onehanded_horseback", "anim_blocked_thrust_twohanded"),
(agent_set_personal_animation, ":agent_no", "anim_parried_thrust_onehanded_horseback", "anim_parried_thrust_twohanded"),
(agent_set_slot, ":agent_no", slot_agent_personal_animation, 1), # Stores that this agent is using a modified animation set
(try_end),
]),
##Wuan
find these codes in header_items.py
itc_cut_two_handed = itcf_force_64_bits | (itcf_slashright_twohanded | itcf_slashleft_twohanded | itcf_overswing_twohanded |
itcf_horseback_slashright_onehanded|itcf_horseback_slashleft_onehanded)
and replace them with
itc_cut_two_handed = itcf_force_64_bits | (itcf_slashright_twohanded | itcf_slashleft_twohanded | itcf_overswing_twohanded |
itcf_horseback_slashright_onehanded|itcf_horseback_slashleft_onehanded|itcf_overswing_onehanded)
To use two-handed sword to thrusting on horseback, modify Next Line to:
itc_greatsword = itc_cut_two_handed | itcf_thrust_twohanded | itc_parry_two_handed | itcf_thrust_onehanded
itc_cut_two_handed = itcf_force_64_bits | (itcf_slashright_twohanded | itcf_slashleft_twohanded | itcf_overswing_twohanded |
itcf_horseback_slashright_onehanded|itcf_horseback_slashleft_onehanded)
and replace them with
itc_cut_two_handed = itcf_force_64_bits | (itcf_slashright_twohanded | itcf_slashleft_twohanded | itcf_overswing_twohanded |
itcf_horseback_slashright_onehanded|itcf_horseback_slashleft_onehanded|itcf_overswing_onehanded)
To use two-handed sword to thrusting on horseback, modify Next Line to:
itc_greatsword = itc_cut_two_handed | itcf_thrust_twohanded | itc_parry_two_handed | itcf_thrust_onehanded
Now you will find sometimes you can't attack to the left or right on horseback, so you should
insert "amf_rider_rot_swing_right" in "ready_slashright_twohanded", "release_slashright_twohanded", "release_slashright_twohanded_continue", "anim_blocked_slashright_twohanded" and "parried_slashright_twohanded" these five animations;
insert "amf_rider_rot_swing_left" in "ready_slashleft_twohanded", "release_slashleft_twohanded", "release_slashleft_twohanded_continue", "anim_blocked_slashleft_twohanded" and "parried_slashleft_twohanded" these five animations;
insert "amf_rider_rot_overswing" in "ready_overswing_twohanded", "release_overswing_twohanded", "release_overswing_twohanded_continue", "anim_blocked_overswing_twohanded" and "parried_overswing_twohanded" these five animations;
insert "amf_rider_rot_thrust" in "ready_thrust_twohanded", "release_thrust_twohanded", "release_thrust_twohanded_continue", "anim_blocked_thrust_twohanded", "parried_thrust_twohanded", "ready_thrust_staff", "release_thrust_staff", "release_thrust_staff_continue", "anim_blocked_thrust_staff" and "parried_thrust_staff" these ten animations.
insert "amf_rider_rot_swing_left" in "ready_slashleft_twohanded", "release_slashleft_twohanded", "release_slashleft_twohanded_continue", "anim_blocked_slashleft_twohanded" and "parried_slashleft_twohanded" these five animations;
insert "amf_rider_rot_overswing" in "ready_overswing_twohanded", "release_overswing_twohanded", "release_overswing_twohanded_continue", "anim_blocked_overswing_twohanded" and "parried_overswing_twohanded" these five animations;
insert "amf_rider_rot_thrust" in "ready_thrust_twohanded", "release_thrust_twohanded", "release_thrust_twohanded_continue", "anim_blocked_thrust_twohanded", "parried_thrust_twohanded", "ready_thrust_staff", "release_thrust_staff", "release_thrust_staff_continue", "anim_blocked_thrust_staff" and "parried_thrust_staff" these ten animations.
Last edited: