Ramaraunt
*begin edits*
If you want to get the latest version of this osp, its in my version of the overhaul mod. It contains fixes, and is much less annoying (no shield bash and kicking spam by ai).
https://forums.taleworlds.com/index.php/topic,361245.0.html
To find the code, just use notepad ++ and press ctrl+f, then search all files in the ms for the text "combat osp" or "ramaraunt". Note there are other features in here that are commented out with Ramaraunt. You can use anything you want from this code, but make sure you give credit.
*end edits*
Ever got bored of warband combat? Ever thought there wasn't enough kicking? Not enough shield bashing? Ever wanted to see a looter's head fly? If so, this is an OSP for you!
NO NEW ANIMATIONS ARE REQUIRED! Thanks to the work of Xenoargh, you can use a blend of animations we already have instead.
If you want to however, you can pick up a nice shield bash animation by Papa Lazarou.
https://forums.taleworlds.com/index.php/topic,177824.0.html
Before I begin, I must say, I couldn't have made this OSP without the code provided by Theoris, Xenoargh and Zarthas! Also, the head model used for decapitations is from historic lords OSP by Thick1988 (with some bloody retexturing done by yours truly)! Shoutout to these excellent gentlemen. You must credit them as well as me if you want to use this in your mod!
https://forums.taleworlds.com/index.php?threads/ai-kicking.349959/
https://forums.taleworlds.com/index.php?threads/shield-bash-osp.134163/
https://forums.taleworlds.com/index.php?threads/fancy-damage-systems.152057/
https://forums.taleworlds.com/index.php?threads/the-historic-lords-project-volume-2-released.261656/
This OSP is basically a combination of these OSP packs, with lots of extra code and work by me, that adds the following to native singleplayer:
**NEW!!**
AI kicking is rather simple, and is a direct take from Zarthas's OSP. No changes made, so all credit goes to him.
Add this to the top of module_mission_templates.py:
Then, for each mission you want ai to kick, add this to the list of triggers:
Now for player shield bashing. This is mostly based off of Xenoargh's OSP, with a tweak that adds a timer that changes based on the player's shield skill level.
Add this to module_animations.py. This isn't a new animation, its a bunch of native ones mixed together to look like what you want.
Now this part goes into module_scripts.py:
Add this to module_mission_templates.py
Add this to every mission you want shield bashing to be possible: (I recommend searching for common_battle_tab_press)
Now add this to module_constants.py under agent slots:
Now for ai shield bashing! For this, you also need the same additions to module_constants.py and module_animations.py, as well as this script:
*NOTE* To adjust the shield bashing amount (cause the way it is right now might be too high for some people), simply raise the (store_sub, ":agent_shield_bash_time", 13, ":shield_level"), to be whatever you want. As it is set bellow, the amount of seconds between shield bashes is 13 minus the troop's shield level seconds.
This in the missions you want it to occur: (I recommend searching for common_battle_tab_press)
Finally, add this to module_mission_templates.py:
Now its time for something interesting: decapitation. This time, we are going to have A LOT of fun.
The following code is roughly based off of scripts released by Theoris a bit down this thread:
https://forums.taleworlds.com/index.php?topic=152057.75
Add this to module_mission_templates.py:
Now add this to the missions you want decapitation. (I recommend searching for common_battle_tab_press)
Now here are some extra goodies! In order for decapitation to work, what the script basically does is checks if an agent is hit in the head area over 35 damage. Then, it rolls a 20% chance that the hit results in an instakill decapitation. After this, the victim's helmet is removed, and replaced with an invisible helmet. This is easy to make, all you have to do is import an empty obj into OpenBRF, but I'll provide one for you bellow anyways . Then, the game spawns a scene prop head, and it spins and falls to the ground. Also, the game spawns blood spouting from the bloody stump at this point. It creates a pretty cool effect. For the scene prop, go to module_scene_props.py and paste this:
For the invishead, paste this into module_items.py:
Remember, credit Thick1988 for the head, and me for the blood on the head!
Download for the BRF and DDS:
(to use these resources, add the BRF to your resource folder of your mod, the DDS to the textures folder, and add "load_module_resource = decapkit" without quotes to your module.ini file in the appropriate spot below the "load_resource" lines.)
https://drive.google.com/folderview?id=0B_rNU8P3lqBqLUEwOFpMLW9wNGc&usp=sharing
If you want to get the latest version of this osp, its in my version of the overhaul mod. It contains fixes, and is much less annoying (no shield bash and kicking spam by ai).
https://forums.taleworlds.com/index.php/topic,361245.0.html
To find the code, just use notepad ++ and press ctrl+f, then search all files in the ms for the text "combat osp" or "ramaraunt". Note there are other features in here that are commented out with Ramaraunt. You can use anything you want from this code, but make sure you give credit.
*end edits*
Ever got bored of warband combat? Ever thought there wasn't enough kicking? Not enough shield bashing? Ever wanted to see a looter's head fly? If so, this is an OSP for you!
NO NEW ANIMATIONS ARE REQUIRED! Thanks to the work of Xenoargh, you can use a blend of animations we already have instead.
If you want to however, you can pick up a nice shield bash animation by Papa Lazarou.
https://forums.taleworlds.com/index.php/topic,177824.0.html
Before I begin, I must say, I couldn't have made this OSP without the code provided by Theoris, Xenoargh and Zarthas! Also, the head model used for decapitations is from historic lords OSP by Thick1988 (with some bloody retexturing done by yours truly)! Shoutout to these excellent gentlemen. You must credit them as well as me if you want to use this in your mod!
https://forums.taleworlds.com/index.php?threads/ai-kicking.349959/
https://forums.taleworlds.com/index.php?threads/shield-bash-osp.134163/
https://forums.taleworlds.com/index.php?threads/fancy-damage-systems.152057/
https://forums.taleworlds.com/index.php?threads/the-historic-lords-project-volume-2-released.261656/
This OSP is basically a combination of these OSP packs, with lots of extra code and work by me, that adds the following to native singleplayer:
- Player Shield Bashing (with timer based on shield skill)
- AI Shield Bashing (also with timer based on the agent's shield skill)
- AI kicking.
**NEW!!**
- DECAPITATION!
AI kicking is rather simple, and is a direct take from Zarthas's OSP. No changes made, so all credit goes to him.
Add this to the top of module_mission_templates.py:
Code:
ai_kick = (
2, 0, 0,
[], [
(get_player_agent_no,":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),#Only humans can kick....FOR NOW
(agent_is_active, ":agent"),
(agent_slot_eq, ":agent", slot_agent_is_running_away, 0),#Isn't fleeing the battle.
##He's an eligible human. Now see if he's in a position to kick.
(agent_get_attack_action, ":attack_action", ":agent"), #returned values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7
(agent_get_defend_action, ":defend_action", ":agent"),#
(this_or_next|eq,":attack_action",4),#Just got parried
(this_or_next|eq,":defend_action",1),#Parrying an enemy
##So he'll only try to kick if he just parried an enemy attack, or his own attack just got parried.
(agent_get_team, ":team", ":agent"),
(assign, ":maximum_distance", 100),
#Target Acquisition
(agent_ai_get_look_target,":suspect",":agent"),
(gt,":suspect",0),#Make sure there is someone.
(agent_is_alive, ":suspect"),
(agent_is_human, ":suspect"),#Only kick humans
(agent_is_active, ":suspect"),
(agent_get_team, ":suspect_team", ":suspect"),
(neq, ":suspect_team", ":team"),#Friends don't let friends kick friends.
(agent_get_position, pos1, ":agent"),#Distance check
(agent_get_position, pos2, ":suspect"),
(neg|position_is_behind_position, pos2, pos1), #Suspect can't be behind kicker.
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", ":maximum_distance"),
#Check chance
(store_random_in_range,":kickchance", 1, 10),
(try_begin),
(eq,":kickchance",1), #10% chance per check
(display_message, "@A person has kicked!"),
(agent_set_animation, ":agent", "anim_prepare_kick_0"),
(agent_deliver_damage_to_agent, ":agent", ":suspect", 3),
(agent_set_animation, ":suspect", "anim_strike3_abdomen_front"),#Get Kicked
(try_end),
(try_end),])
Then, for each mission you want ai to kick, add this to the list of triggers:
Code:
AI_kick,
Now for player shield bashing. This is mostly based off of Xenoargh's OSP, with a tweak that adds a timer that changes based on the player's shield skill level.
Add this to module_animations.py. This isn't a new animation, its a bunch of native ones mixed together to look like what you want.
Code:
["shield_bash", 0, amf_play|amf_priority_defend|amf_use_defend_speed|amf_client_owner_prediction,
[0.75, "defend_shield_parry_all", 1, 50, blend_in_defense], #Adjust duration for balance. Currently at 0.75 seconds, fixed.
[0.75, "defend_shield_right", 1, 50, blend_in_defense],
[0.75, "defend_shield_left", 1, 50, blend_in_defense],
[0.75, "defend_shield_right", 1, 50, blend_in_defense],
],
["shield_strike", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
[1.0, "anim_human", blow+5000, blow+5010, arf_blend_in_3|arf_make_custom_sound],
[1.7, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound],
[1.44, "anim_human", blow+5400, blow+5445, arf_blend_in_2|arf_make_custom_sound],
],
Now this part goes into module_scripts.py:
Code:
#Shield Bash Script
("shield_bash",[
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(get_player_agent_no,":player_agent"),
(store_skill_level,":shield_level", "skl_shield", "trp_player"),
(store_sub, ":player_shield_bash_time", 13, ":shield_level"),
(store_mission_timer_a, ":current_time"),
(agent_get_slot, ":slot_last_shield_bash_time", ":player_agent", 27),
(store_add, ":time_to_shield_bash", ":player_shield_bash_time",":slot_last_shield_bash_time"),
(try_begin),
(ge, ":current_time", ":time_to_shield_bash"),
(try_begin),
(gt, ":player_agent", 0),
(agent_get_animation, ":anim", ":player_agent",0),
(agent_get_horse, ":my_horse", ":player_agent"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(try_begin),
(neq, ":anim", "anim_shield_bash"),
(eq, ":my_horse", -1),
(item_get_type, ":item_type", ":shield_item"),
(eq, ":item_type", itp_type_shield),
(agent_set_animation, ":player_agent","anim_shield_bash"),
(agent_get_position, pos63,":player_agent"),
(position_move_y,pos63,75),#75 cm directly ahead, so it's not a cuboid space around player center
(agent_get_troop_id, ":id", ":player_agent"),
(troop_get_type, ":type", ":id"),
(try_begin),
(eq, ":type", tf_male),
(agent_play_sound, ":player_agent", "snd_man_yell"),
(agent_set_slot, ":player_agent", 27, ":current_time"),
(else_try),
(agent_play_sound, ":player_agent", "snd_woman_yell"),
(agent_set_slot, ":player_agent", 27, ":current_time"),
(try_end),
(try_for_agents,":agent"),
(gt, ":agent", 0),
(neg|agent_is_ally,":agent"),#don't bash allies
(agent_is_human, ":agent"),#stop if not human
(agent_is_active,":agent"),
(agent_is_alive,":agent"),
(try_begin),
(agent_get_position,pos62,":agent"),
(get_distance_between_positions,":dist",pos63,pos62),
(lt,":dist",100),#Set this to whatever you like- 1 meter radius clears a big section of crowd
(agent_get_horse, ":horse", ":agent"),
(eq, ":horse", -1),
(neq,":agent",":player_agent"),
(agent_play_sound, ":player_agent", "snd_wooden_hit_low_armor_high_damage"),
(position_move_y,pos62,-25),
(agent_set_position, ":agent", pos62),
(agent_set_animation, ":agent","anim_shield_strike"),
(try_end),
(try_end),
(try_end),
(try_end),
(else_try),
(display_message, "@You don't have enough shield skill to shield bash again this soon."),
(try_end),
]),
Add this to module_mission_templates.py
Code:
#SHIELD BASH OSP BEGIN
common_shield_bash = (0,0,0,[
(key_clicked, key_left_control),
(get_player_agent_no,":player_agent"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(neq, ":shield_item", -1),
(neq, ":shield_item", 0),
(item_get_type, ":item_type", ":shield_item"),
(eq, ":item_type", itp_type_shield),
(neg|main_hero_fallen),
],
[
(call_script, "script_shield_bash"),
])
#SHIELD BASH OSP END
Add this to every mission you want shield bashing to be possible: (I recommend searching for common_battle_tab_press)
Code:
common_shield_bash ,#SHIELD BASH OSP
Now add this to module_constants.py under agent slots:
Code:
slot_agent_last_shield_bash_time = 27 #RAMARAUNT ADD
Now for ai shield bashing! For this, you also need the same additions to module_constants.py and module_animations.py, as well as this script:
*NOTE* To adjust the shield bashing amount (cause the way it is right now might be too high for some people), simply raise the (store_sub, ":agent_shield_bash_time", 13, ":shield_level"), to be whatever you want. As it is set bellow, the amount of seconds between shield bashes is 13 minus the troop's shield level seconds.
Code:
#RAMARAUNT SCRIPT - with code from Xenoargh's shield bashing OSP.
#AI shield bashing script
("agent_shield_bash",[
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_script_param, ":agent", 1),
(agent_get_troop_id, ":troop_id", ":agent"),
(store_skill_level,":shield_level", "skl_shield", ":troop_id"),
(store_sub, ":agent_shield_bash_time", 13, ":shield_level"),
(store_mission_timer_a, ":current_time"),
(try_begin),
(agent_get_wielded_item, ":shield_item", ":agent", 1),
(neq, ":shield_item", -1),
(neq, ":shield_item", 0),
(item_get_type, ":item_type", ":shield_item"),
(eq, ":item_type", itp_type_shield),
(agent_get_slot, ":slot_last_shield_bash_time", ":agent", 27),
(store_add, ":time_to_shield_bash", ":agent_shield_bash_time",":slot_last_shield_bash_time"),
(try_begin),
(ge, ":current_time", ":time_to_shield_bash"),
(try_begin),
(gt, ":agent", 0),
(agent_get_animation, ":anim", ":agent",0),
(agent_get_horse, ":my_horse", ":agent"),
(try_begin),
(neq, ":anim", "anim_shield_bash"),
(eq, ":my_horse", -1),
(agent_set_animation, ":agent","anim_shield_bash"),
(agent_get_position, pos63,":agent"),
(position_move_y,pos63,75),#75 cm directly ahead, so it's not a cuboid space around player center
(agent_get_troop_id, ":id", ":agent"),
(troop_get_type, ":type", ":id"),
(try_begin),
(eq, ":type", tf_male),
(agent_play_sound, ":agent", "snd_man_yell"),
(agent_set_slot, ":agent", 27, ":current_time"),
(display_message, "@{s2} has shield bashed!"),
(else_try),
(agent_play_sound, ":agent", "snd_woman_yell"),
(agent_set_slot, ":agent", 27, ":current_time"),
(display_message, "@{s2} has shield bashed!"),
(try_end),
(try_for_agents,":victims"),
(gt, ":victims", 0),
(agent_get_team, ":victim_team", ":victims"),
(agent_get_team, ":agent_team", ":agent"),
(teams_are_enemies, ":victim_team", ":agent_team"), #don't bash allies
(agent_is_human, ":victims"),#stop if not human
(agent_is_active,":victims"),
(agent_is_alive,":victims"),
(try_begin),
(agent_get_position,pos62,":victims"),
(get_distance_between_positions,":dist",pos63,pos62),
(lt,":dist",100),#Set this to whatever you like- 1 meter radius clears a big section of crowd
(agent_get_horse, ":horse", ":victims"),
(eq, ":horse", -1),
(neq,":agent",":victims"),
(agent_play_sound, ":victims", "snd_wooden_hit_low_armor_high_damage"),
(position_move_y,pos62,-25),
(agent_set_position, ":victims", pos62),
(agent_set_animation, ":victims","anim_shield_strike"),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end),
(try_end),
]),
#End Shield Bash Script
This in the missions you want it to occur: (I recommend searching for common_battle_tab_press)
Code:
ai_shield_bash,
Finally, add this to module_mission_templates.py:
Code:
#AI BASHING OSP BEGIN
ai_shield_bash = (
0, 0, 0,
[], [
(get_player_agent_no, ":player"),
(try_for_agents, ":agent"),
(neq, ":agent", ":player"),
(agent_is_alive, ":agent"),
(agent_is_human, ":agent"),#Only humans can bash....FOR NOW
(agent_is_active, ":agent"),
(agent_slot_eq, ":agent", slot_agent_is_running_away, 0),#Isn't fleeing the battle.
##He's an eligible human. Now see if he's in a position to bash
(agent_get_attack_action, ":attack_action", ":agent"), #returned values: free = 0, readying_attack = 1, releasing_attack = 2, completing_attack_after_hit = 3, attack_parried = 4, reloading = 5, after_release = 6, cancelling_attack = 7
(agent_get_defend_action, ":defend_action", ":agent"),#
(this_or_next|eq,":attack_action",4),#Just got parried
(this_or_next|eq,":defend_action",1),#Parrying an enemy
##So he'll only try to bash if he just parried an enemy
(agent_get_team, ":team", ":agent"),
(assign, ":maximum_distance", 100),
#Target Acquisition
(agent_ai_get_look_target,":suspect",":agent"),
(gt,":suspect",0),#Make sure there is someone.
(agent_is_alive, ":suspect"),
(agent_is_human, ":suspect"),#Only bash humans
(agent_is_active, ":suspect"),
(agent_get_team, ":suspect_team", ":suspect"),
(neq, ":suspect_team", ":team"),#Friends don't let friends kick friends.
(agent_get_position, pos1, ":agent"),#Distance check
(agent_get_position, pos2, ":suspect"),
(neg|position_is_behind_position, pos2, pos1), #Suspect can't be behind kicker.
(get_distance_between_positions, ":distance", pos1, pos2),
(get_distance_between_positions, ":distance", pos1, pos2),
(le, ":distance", ":maximum_distance"),
(store_random_in_range,":bashchance", 1, 2),
(try_begin),
(eq,":bashchance",1), #50% chance per check
(str_store_agent_name, s2, ":agent"),
(call_script, "script_agent_shield_bash", ":agent"), #suspect not needed anymore because the bash effects multiple agents.
(try_end),
(try_end),])
Now its time for something interesting: decapitation. This time, we are going to have A LOT of fun.
The following code is roughly based off of scripts released by Theoris a bit down this thread:
https://forums.taleworlds.com/index.php?topic=152057.75
Add this to module_mission_templates.py:
Code:
theoris_decapitation = (
ti_on_agent_hit, 0, 0, [],
[
(store_trigger_param_1, ":agent"),
(store_trigger_param_2, ":gloriousvictor"),
(agent_is_human, ":agent"),
(agent_get_troop_id, ":troop_no", ":agent"),
(this_or_next|is_between, ":troop_no","trp_farmer", "trp_kingdom_heroes_including_player_begin"),
(is_between, ":troop_no", bandits_begin, "trp_shady_walker_2"), #CHANGE THIS LINE AND THE ONE ABOVE IT TO FIT WHO YOU WANT TO BE ABLE TO BE DECAPITATED! - RAMARAUNT
(store_random_in_range, ":randomizer", 1, 6),
(eq, ":randomizer", 1),
(store_trigger_param_3, ":damage"),
(ge, ":damage", 35), #strong blow
(store_agent_hit_points, ":hp", ":agent", 1),
(val_sub, ":hp", 5),
(ge, ":damage", ":hp"),
(agent_get_position, pos1, ":agent"),
(get_distance_between_positions, ":distance", pos1, pos0),
(is_between, ":distance", 90, 185), # *zing*
(agent_get_item_slot, ":item", ":agent", 4), #head slot
(try_begin),
(ge, ":item", 1),
(agent_unequip_item, ":agent", ":item"),
(try_end),
(agent_set_hit_points,":agent", 0, 1), #DEATH IS CERTAIN (no running around decapitated idiots :D)
(agent_equip_item, ":agent", "itm_untitled"),
(particle_system_burst, "psys_game_blood_2", pos0, 125), #BLODDYBLOODBLOODDDDDD
(set_spawn_position, pos1),
(spawn_scene_prop, "spr_physics_head"),
(str_store_troop_name, s60, ":troop_no"),
(agent_get_troop_id, ":troop_no_2", ":gloriousvictor"),
(str_store_troop_name, s61, ":troop_no_2"),
(display_message, "@{s61} has beheaded {s60}!", 0xff0000)
])
Now add this to the missions you want decapitation. (I recommend searching for common_battle_tab_press)
Code:
theoris_decapitation,
Now here are some extra goodies! In order for decapitation to work, what the script basically does is checks if an agent is hit in the head area over 35 damage. Then, it rolls a 20% chance that the hit results in an instakill decapitation. After this, the victim's helmet is removed, and replaced with an invisible helmet. This is easy to make, all you have to do is import an empty obj into OpenBRF, but I'll provide one for you bellow anyways . Then, the game spawns a scene prop head, and it spins and falls to the ground. Also, the game spawns blood spouting from the bloody stump at this point. It creates a pretty cool effect. For the scene prop, go to module_scene_props.py and paste this:
Code:
("physics_head" ,sokf_dynamic_physics,"bloodystumps" ,"bloodystumps_bo" , []),
For the invishead, paste this into module_items.py:
Code:
["untitled", "invishead", [("invisihead",0)], itp_type_head_armor|itp_fit_to_head|itp_covers_head|itp_covers_beard, 0, 187, weight(1.25)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0), imodbits_plate ],
Remember, credit Thick1988 for the head, and me for the blood on the head!
Download for the BRF and DDS:
(to use these resources, add the BRF to your resource folder of your mod, the DDS to the textures folder, and add "load_module_resource = decapkit" without quotes to your module.ini file in the appropriate spot below the "load_resource" lines.)
https://drive.google.com/folderview?id=0B_rNU8P3lqBqLUEwOFpMLW9wNGc&usp=sharing
Last edited by a moderator: