decapitations and severed limbs death animations.

Users who are viewing this thread

Thanks, Al Mansur, I got the head set up as a correctly positioned shield so that it can be chopped off, and it looks pretty funny so far, but the head just pops off with no reaction from the fighter. 

All I need now, God willing, is a little bit of help with the dismemberment code by Cdvader.  Any suggestions are welcome, and all help appreciated.  The code basically is designed to detect which troop has the "dismember_item" and keep track of whether he still has it equipped or not.  If the game detects that he no longer has the item (because it's been chopped off  :grin:) he should react with a scream, an animation, and will take damage.

This is the code for the arm chop.  It will be easily adapted to fit the head as well, provided we can get it working.

In mission_templates I have:

#---------------------------------------------------------
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),
])
#---------------------------------------------------------
 

Please, anyone who can help this to trigger in-game, or can see why it is not triggering already, help!  I wish Hokie was still around - or Jik for that matter... wonder where they are these days.

Anyways, all suggestions welcome.
 
forgot to post up the decapitation video... decap is at about 1.25 in this video, and it's with a gun due to the problems with making them keep their heads in place at close distance (they keep lowering the "shield" to strike).  This would not be a problem with specially made monsters, but is with humans.

http://www.youtube.com/watch?v=Od7ZHtNo7AQ

Al Mansur, I had to alter the head slightly because it seems shields cannot be multi-meshes, but there'll be a way to fix that.  Thanks for your help.  I should've PMed you the vid, will do so now.

When you watch that decap, imagine it working correctly with the swing of a great axe!  It'll be good... 
 
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?

I'll try to have it as an exclusive feature for a week or two (anybody who helps make it gets to use it too, of course) then release it as a kit.  I've never really made any fully original features before that no one else has got, so I need my little exclusive.

Once it's out fully, anyone will be able to add it in.  Though I should probably ask Rosha about that as well - he's helping me script it.
 
Progress is progressing in a progressive fashion.  Still some problems to be ironed out (as you'll see) but it is going good now thanks to Rosha and Al Mansur's detachable head  :grin: :

http://www.youtube.com/watch?v=AhcCrjG8-cY
 
Okay, I'm back to working on this in a serious way again, and things are getting quite close to working.

http://www.youtube.com/watch?v=B2DAkf9vHG4

The problem is with the code - the anim and sound that are set to play when the agent's "shield" is destroyed (arm chopped off) just repeat and loop continuously, and nothing I've tried so far will make them play just once.  It would be better if I could just set one long anim to it, and one long scream - then the victim keeps fighting, hehe.

Here is the current code:

#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),]),

Can any experts - especially Yoshi, or Cdvader, who wrote the original code, see what the problem is?  Every other script I have where I set a sound or an animation to play, as well as a particle system burst, it only happens once - why is this one different?
 
The problem is that your try_for_agents loop will fire every .5 seconds to check if your security guard no longer has his arm, but doesn't mark the agent in any way other than playing the animation and particle effects. There are also some problems with your usage of certain operations - in particular with the last parameter of (agent_set_hit_points) and (agent_deliver_damage_to_agent). From what I can tell on the video, the agent isn't receiving any additional damage like you wanted. Also, you'll want to move the timer check to the conditions, not inside the loop itself. If you want to mark the agent in any way, you should use agent slots, and that way the agent doesn't take additional damage every time the loop runs every .5 seconds.
Code:
(.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),]),
 
Thanks for that Somebody, I tested your script and it works perfectly for making them bleed to death (either slow or fast depending how I set it) after their arm is severed, though the anim and the sound still seem to repeat endlessly until death.  I've figured out a way around the overlapping screams issue, though - and I quite like the way the "glitched" anim looks as he flails about kind of spastically.

You also said: "#you can make a new agent called "Bleeding" equipped with a 1-dmg wpn and use that instead of the player agent.

I know how annoying it must get for people like yourself who can actually understand scripting, but how would I go about doing that?  Would you say there is any real need to add it?  - the victim doesn't get seem to get insta-killed anyway.

I'm going to have to start a list of everybody who's contributed something to dismemberment so they can all get credit.  :grin:
 
Well, I think I've got it to work how I want it now!  There might be refinements still to be made (maybe by others, when I release it as a kit) but it's more or less done:

http://www.youtube.com/watch?v=u3dp_cEYWYQ

Hands will also be severable.

I can't remember who all contributed, so feel free to remind me if you've gave me objects or scripts that I've used.  So far the credits go like this:

Me
Somebody
Rosha
cdvader
Al-mansur
 
Of course, I done all the hard work.  :lol:  Is there anybody else, though?  It's been months, so don;t go in the huff if I've forgotten you.

Anyways.  Job done!
 
.
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!!!  :twisted:
 
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!!!  :twisted:

You would make history if you made a tutorial on how you did it and what you need to do it.
 
I'll be releasing a pack eventually that will have everything people need to chop off arms.  It should work in Warband too, I think.  The tutorial is mostly contained in this thread, and the scripts too.  Nearly everything needed is in here already, but the pack will make it unnecessary for folk to puzzle it out themselves.

I'll have to make it work with normal-sized NPCs first - the only dismemberable folk in the mod are big fatties with muscly arms, which made it a bit easier.
 
Back
Top Bottom