Reks
Recruit
So I've struggled for the past few hours trying to figure out how to make a pommel bash attack, the idea is to have it work just like the shield bash attack but when you're using just a weapon (IE: two hander, polearm, or just a one hander with no shield) problem is I can't for the life of me get it to work, I have an animation that works fine the problem is the syntax in module_scripts, module_mission_templates and module_animations. I was trying to edit the shield bash code for my own purposes but to no success.
Here is my attempt, if someone could help me that would be great.
here's what I have in module_scripts:
here is what I have in module_mission_templates:
and finally what I have in module_animations:
If it seems like I have no idea what I'm doing, its because I don't. again, any help would be appreciated.
Here is my attempt, if someone could help me that would be great.
here's what I have in module_scripts:
#pommel Bash Script
("cf_pommel_bash",
[
(agent_get_animation, ":anim", "$fplayer_agent_no", 0),
(neq, ":anim", "anim_pommel_bash"),
(agent_get_horse, ":horse", "$fplayer_agent_no"),
(eq, ":horse", -1),
(agent_get_defend_action, ":action", "$fplayer_agent_no"),
(eq, ":action", 2), #Blocking.
(agent_get_wielded_item, ":sword_item", "$fplayer_agent_no", 1),
(gt, ":sword_item", itm_no_item),
(item_get_type, ":type", ":sword_item"),
(eq, ":type", itp_type_shield),
(item_get_slot, ":sword_width", ":sword_item", slot_item_length),
(ge, ":sword_width", 0), ##FLORIS, balance as needed
#(set_fixed_point_multiplier, 100),
##Fail above this point--don't allow fail after, so the failure/re-arm goes with the firing of the animation
(agent_set_animation, "$fplayer_agent_no","anim_pommel_bash"),
(agent_get_position, pos63, "$fplayer_agent_no"),
(position_move_y, pos63, 75),#75 cm directly ahead, so it's not a cuboid space around player center
(agent_get_troop_id, ":id", "$fplayer_agent_no"),
(troop_get_type, ":type", ":id"),
(try_begin),
(eq, ":type", tf_male),
(agent_play_sound, "$fplayer_agent_no", "snd_man_yell"),
(else_try),
(agent_play_sound, "$fplayer_agent_no", "snd_woman_yell"),
(try_end),
(assign, ":victim", -1),
(assign, ":closest_dist", 100),
(try_for_agents,":agent"),
(neq, ":agent", "$fplayer_agent_no"),
(neg|agent_is_ally,":agent"),#don't bash allies
(agent_is_human, ":agent"),#stop if not human
(agent_is_alive,":agent"),
(agent_get_horse, ":horse", ":agent"),
(eq, ":horse", -1),
(agent_get_position,pos62,":agent"),
(neg|position_is_behind_position, pos62, pos63),
(get_distance_between_positions,":dist",pos63,pos62),
(le, ":dist", ":closest_dist"),
(assign, ":victim", ":agent"),
(assign, ":closest_dist", ":dist"),
(try_end),
(try_begin),
(ge, ":victim", 0),
(agent_play_sound, "$fplayer_agent_no", "snd_wooden_hit_low_armor_high_damage"),
#(set_fixed_point_multiplier, 100),
#(position_move_y,pos62,-25),
#(agent_set_position, ":victim", pos62),
(agent_set_animation, ":victim", "anim_shield_strike"),
(try_end),
]),
#End pommel bash script
("cf_pommel_bash",
[
(agent_get_animation, ":anim", "$fplayer_agent_no", 0),
(neq, ":anim", "anim_pommel_bash"),
(agent_get_horse, ":horse", "$fplayer_agent_no"),
(eq, ":horse", -1),
(agent_get_defend_action, ":action", "$fplayer_agent_no"),
(eq, ":action", 2), #Blocking.
(agent_get_wielded_item, ":sword_item", "$fplayer_agent_no", 1),
(gt, ":sword_item", itm_no_item),
(item_get_type, ":type", ":sword_item"),
(eq, ":type", itp_type_shield),
(item_get_slot, ":sword_width", ":sword_item", slot_item_length),
(ge, ":sword_width", 0), ##FLORIS, balance as needed
#(set_fixed_point_multiplier, 100),
##Fail above this point--don't allow fail after, so the failure/re-arm goes with the firing of the animation
(agent_set_animation, "$fplayer_agent_no","anim_pommel_bash"),
(agent_get_position, pos63, "$fplayer_agent_no"),
(position_move_y, pos63, 75),#75 cm directly ahead, so it's not a cuboid space around player center
(agent_get_troop_id, ":id", "$fplayer_agent_no"),
(troop_get_type, ":type", ":id"),
(try_begin),
(eq, ":type", tf_male),
(agent_play_sound, "$fplayer_agent_no", "snd_man_yell"),
(else_try),
(agent_play_sound, "$fplayer_agent_no", "snd_woman_yell"),
(try_end),
(assign, ":victim", -1),
(assign, ":closest_dist", 100),
(try_for_agents,":agent"),
(neq, ":agent", "$fplayer_agent_no"),
(neg|agent_is_ally,":agent"),#don't bash allies
(agent_is_human, ":agent"),#stop if not human
(agent_is_alive,":agent"),
(agent_get_horse, ":horse", ":agent"),
(eq, ":horse", -1),
(agent_get_position,pos62,":agent"),
(neg|position_is_behind_position, pos62, pos63),
(get_distance_between_positions,":dist",pos63,pos62),
(le, ":dist", ":closest_dist"),
(assign, ":victim", ":agent"),
(assign, ":closest_dist", ":dist"),
(try_end),
(try_begin),
(ge, ":victim", 0),
(agent_play_sound, "$fplayer_agent_no", "snd_wooden_hit_low_armor_high_damage"),
#(set_fixed_point_multiplier, 100),
#(position_move_y,pos62,-25),
#(agent_set_position, ":victim", pos62),
(agent_set_animation, ":victim", "anim_shield_strike"),
(try_end),
]),
#End pommel bash script
here is what I have in module_mission_templates:
pommel_bash = ( #in pbod_common_triggers
0, 0, 1,
[
(game_key_is_down, gk_defend),
(key_clicked, "$key_special_3"),
(neg|main_hero_fallen),
(ge, "$fplayer_agent_no", 0),
(call_script, "script_cf_pommel_bash"),
],[])
common_pbod_triggers = [
init_player_global_variables,
#Fix for setting divisions, duplicated in formations code, so disabled in mst_lead_charge
(ti_on_agent_spawn, 0, 0, [(neq, "$g_next_menu", "mnu_simple_encounter"),(neq, "$g_next_menu", "mnu_join_battle")], [(store_trigger_param_1, ":agent"),(call_script, "script_prebattle_agent_fix_division", ":agent")]),
(0.5, 0, 0, [(neq, "$g_next_menu", "mnu_simple_encounter"), #not mst_lead_charge (or the various village raid templates...will be better with WSE)
(neq, "$g_next_menu", "mnu_join_battle"),
(store_mission_timer_a, reg0),(gt, reg0, 4)],
[
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_slot_ge, ":agent", slot_agent_new_division, 0),
(agent_get_division, ":division", ":agent"),
(neg|agent_slot_eq, ":agent", slot_agent_new_division, ":division"),
(agent_get_slot, ":division", ":agent", slot_agent_new_division),
(agent_set_division, ":agent", ":division"),
(try_end),
]),
pommel_bash,
]
0, 0, 1,
[
(game_key_is_down, gk_defend),
(key_clicked, "$key_special_3"),
(neg|main_hero_fallen),
(ge, "$fplayer_agent_no", 0),
(call_script, "script_cf_pommel_bash"),
],[])
common_pbod_triggers = [
init_player_global_variables,
#Fix for setting divisions, duplicated in formations code, so disabled in mst_lead_charge
(ti_on_agent_spawn, 0, 0, [(neq, "$g_next_menu", "mnu_simple_encounter"),(neq, "$g_next_menu", "mnu_join_battle")], [(store_trigger_param_1, ":agent"),(call_script, "script_prebattle_agent_fix_division", ":agent")]),
(0.5, 0, 0, [(neq, "$g_next_menu", "mnu_simple_encounter"), #not mst_lead_charge (or the various village raid templates...will be better with WSE)
(neq, "$g_next_menu", "mnu_join_battle"),
(store_mission_timer_a, reg0),(gt, reg0, 4)],
[
(try_for_agents, ":agent"),
(agent_is_alive, ":agent"),
(agent_slot_ge, ":agent", slot_agent_new_division, 0),
(agent_get_division, ":division", ":agent"),
(neg|agent_slot_eq, ":agent", slot_agent_new_division, ":division"),
(agent_get_slot, ":division", ":agent", slot_agent_new_division),
(agent_set_division, ":agent", ":division"),
(try_end),
]),
pommel_bash,
]
and finally what I have in module_animations:
##pommel bash
["pommel_bash", acf_enforce_all, amf_play|amf_priority_striked|amf_use_defend_speed|amf_client_owner_prediction,
[0.75, "pommel_bash", 0, 30, blend_in_defense],
# [0.75, "defend_onehanded_parry_all", 1, 50, blend_in_defense], #Adjust duration for balance. Currently at 0.75 seconds, fixed.
# [0.75, "defend_right_onehanded ", 1, 50, blend_in_defense],
# [0.75, "defend_left_onehanded", 1, 50, blend_in_defense],
# [0.75, "defend_right_onehanded ", 1, 50, blend_in_defense],
],
["shield_strike", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[2, "anim_human", blow+5000, blow+5010, arf_blend_in_3|arf_make_custom_sound],
[2.5, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound],
[2.5, "anim_human", blow+5400, blow+5445, arf_blend_in_2|arf_make_custom_sound],
],
##
]
["pommel_bash", acf_enforce_all, amf_play|amf_priority_striked|amf_use_defend_speed|amf_client_owner_prediction,
[0.75, "pommel_bash", 0, 30, blend_in_defense],
# [0.75, "defend_onehanded_parry_all", 1, 50, blend_in_defense], #Adjust duration for balance. Currently at 0.75 seconds, fixed.
# [0.75, "defend_right_onehanded ", 1, 50, blend_in_defense],
# [0.75, "defend_left_onehanded", 1, 50, blend_in_defense],
# [0.75, "defend_right_onehanded ", 1, 50, blend_in_defense],
],
["shield_strike", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[2, "anim_human", blow+5000, blow+5010, arf_blend_in_3|arf_make_custom_sound],
[2.5, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound],
[2.5, "anim_human", blow+5400, blow+5445, arf_blend_in_2|arf_make_custom_sound],
],
##
]
If it seems like I have no idea what I'm doing, its because I don't. again, any help would be appreciated.