#---------------------------------------------------------
dismemberment_init = (
ti_before_mission_start, 0, ti_once, [],
[
(assign, "$dismember_do_fun", -1),
(assign, "$dismember_agent", -1),
(assign, "$dismember_check", 0),
])
dismemberment_optimization = (
ti_on_agent_spawn, 0, 0, [(eq, "$dismember_check", 0)],
[
(store_trigger_param_1, ":agent"),
(try_begin),
(agent_get_wielded_item, ":w_item", ":agent", 2), #hand_no 2 = shield?
(eq, ":w_item", "itm_arm"),
(assign, "$dismember_check", 1),
(try_end),
])
dismemberment_check = (
0.05, 0, 0, [(eq, "$dismember_check", 1)],
[
(try_for_agents, ":agent"),
(agent_get_wielded_item, ":w_item", ":agent", 2), #hand_no 2 = shield?
(eq, ":w_item", "itm_arm"), #shield shaped like arm or head
(assign, "$dismember_agent", ":agent"),
(assign, "$dismember_do_fun", 1),
(try_end),
])
dismember_check_and_do_fun = (
0.1, 0, 0, [(eq, "$dismember_do_fun", 1)],
[
(try_for_agents, ":agent"),
(eq, ":agent", "$dismember_agent"),
(agent_get_wielded_item, ":w_item", ":agent", 2), #hand_no 2 = shield?
(neq, ":w_item", "itm_arm"),
(play_sound, "snd_man_screams"),
(agent_get_position, pos1, ":agent"),
(particle_system_burst, "psys_game_blood", pos1, 100), #100 as power.
(agent_set_animation, ":agent", "anim_armchop"), # custom anim
(try_end),
])
#---------------------------------------------------------
seoman of earthsea said:Sweet. So when this is ready will you make a series of commands/mod that can be put into any module?
#Dismemberment Fat Arm
(.5, 0, 0, [], [
(try_for_agents, ":cur_agent"),
(store_mission_timer_a,":cur_time"),
(ge, ":cur_time", 5), #this gives them time to make sure they equip their 'shield
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_troop_id, ":troop", ":cur_agent"),
(eq, ":troop", "trp_security_guard"), #make sure this is the name of the troop
(agent_get_wielded_item,":item",":cur_agent",1),
(neq, ":item", "itm_fatseveredarm"), #make sure this is the name of the item (their arm)
(agent_set_hit_points, ":cur_agent", 40,40),
(get_player_agent_no, ":player"),
(agent_deliver_damage_to_agent, ":player", ":cur_agent", 10),
(agent_get_position, pos1, ":cur_agent"),
(position_move_z, pos1, 90), #makes the blood higher, otherwise it's on ground level
(position_move_x, pos1, -35), #makes the blood out from the torso towards the arm stump
(position_move_y, pos1, -10), #makes the blood come out severed stump
(position_rotate_x, pos1, 90), #makes the blood spurt downwards
(particle_system_burst, "psys_game_blood_2", pos1, 200), #100 as power.
(agent_play_sound,":cur_agent", "snd_armchop"),
(agent_set_animation, ":cur_agent", "anim_armchop"),
(try_end),]),
(.5, 0, 0, [
(store_mission_timer_a,":cur_time"),
(ge, ":cur_time", 5), #this gives them time to make sure they equip their 'shield
], [
(try_for_agents, ":cur_agent"),
(agent_is_human, ":cur_agent"),
(agent_is_alive, ":cur_agent"),
(agent_get_troop_id, ":troop", ":cur_agent"),
(eq, ":troop", "trp_security_guard"), #make sure this is the name of the troop
(agent_get_wielded_item,":item",":cur_agent",1),
(neq, ":item", "itm_fatseveredarm"), #make sure this is the name of the item (their arm)
(store_agent_hit_points, ":hp", ":cur_agent", 0), #percent
(val_mul, ":hp", 4), #get 40% of original hp
(val_div, ":hp", 10), #change if you want
(agent_set_hit_points, ":cur_agent", ":hp", 0), #again, 0 param = relative
(get_player_agent_no, ":player"),
(agent_deliver_damage_to_agent, ":player", ":cur_agent", 1), #param 1 = deal dmg with weapon - usually insta-kills
#you can make a new agent called "Bleeding" equipped with a 1-dmg wpn and use that instead of the player agent
(agent_get_position, pos1, ":cur_agent"),
(position_move_z, pos1, 90), #makes the blood higher, otherwise it's on ground level
(position_move_x, pos1, -35), #makes the blood out from the torso towards the arm stump
(position_move_y, pos1, -10), #makes the blood come out severed stump
(position_rotate_x, pos1, 90), #makes the blood spurt downwards
(particle_system_burst, "psys_game_blood_2", pos1, 200), #100 as power.
(agent_play_sound,":cur_agent", "snd_armchop"),
(agent_set_animation, ":cur_agent", "anim_armchop"),
(try_end),]),
Flanged said:.
I've released the mod featuring the dismemberment anims and effects already seen in this thread. Thought people might want to have a go at chopping some limbs themselves.
The thread for the mod is here: http://forums.taleworlds.com/index.php/topic,136356.0.html
Thanks again to everyone who helped dismemberment become a reality in Mount and Blade!!!