OSP Kit Combat Fancy Damage Systems

Users who are viewing this thread

dunde said:
Head is 150 to 180 cm from ground, with 30 cm radius from center. Legs are below 90 cm, body is 90-150 cm from ground, with 30 cm radius from center. Outside of the radius could be arms. It's not too precision, but better then only check distance_from_ground.

Bit of off-topic/dumb question but how can i get these values for custom skeletons? I haven't done any m&b modding outside of module system and i have no clue what program to use or where to look :/
 
rabican said:
Bit of off-topic/dumb question but how can i get these values for custom skeletons? I haven't done any m&b modding outside of module system and i have no clue what program to use or where to look :/

I got the values from  moving  the custom camera around the character and noted the relative position of camera from character position. I made  a trigger to display the camera position any time I press a specific button.
 
Einskaldir said:
So can this work or have I to set in another way?

theoris_decapitation = (
    ti_on_agent_hit, 0, 0, [],
    [
      (store_trigger_param_1, ":agent"),
      (agent_is_human, ":agent"),
      (store_trigger_param_3, ":damage"),
      (ge, ":damage", 50), #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", 160, 176), # *zing*
      (agent_get_item_slot, ":item", ":agent", 4), #head slot
      (try_begin),     
          (ge, ":item", 1),
        (agent_unequip_item, ":agent", ":item"),
        (le, ":hp", 0),
        (set_position_delta, 0, 0, -10), #center of head is somewhere above stump?
        (particle_system_add_new, "psys_game_blood"),
        (particle_system_emit, "psys_game_blood" , 100000, 100),

      (try_end),
      (agent_equip_item, ":agent", "itm_invisible_head"),
      (particle_system_burst, "psys_game_blood_2", pos0, 125), #Yeah..
      #(set_spawn_position, pos1),
      #(spawn_scene_prop, "spr_physics_head"),
    ])

How do I apply this to the Native version of warband? is there a certain file I must edit and paste this into?
 
alright, all downloaded and ready to go, where do I have to enter the decapitation script before applying and compiling?

edit; figured out the files I need to edit via previous posts, now trying to work out how to get it working xD

edit#2; Ok,
Einskaldir said:
So can this work or have I to set in another way?

theoris_decapitation = (
    ti_on_agent_hit, 0, 0, [],
    [
      (store_trigger_param_1, ":agent"),
      (agent_is_human, ":agent"),
      (store_trigger_param_3, ":damage"),
      (ge, ":damage", 50), #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", 160, 176), # *zing*
      (agent_get_item_slot, ":item", ":agent", 4), #head slot
      (try_begin),     
          (ge, ":item", 1),
        (agent_unequip_item, ":agent", ":item"),
        (le, ":hp", 0),
        (set_position_delta, 0, 0, -10), #center of head is somewhere above stump?
        (particle_system_add_new, "psys_game_blood"),
        (particle_system_emit, "psys_game_blood" , 100000, 100),

      (try_end),
      (agent_equip_item, ":agent", "itm_invisible_head"),
      (particle_system_burst, "psys_game_blood_2", pos0, 125), #Yeah..
      #(set_spawn_position, pos1),
      #(spawn_scene_prop, "spr_physics_head"),
    ])

I have added this to the module_mission_templates, compiled it with no issues but I can't seem to cut the heads off.. no matter where I hit, neck, head etc it just wont come off, I have even used cheats for testing purposes made my hits do 300 damage and still nothing. I read earlier I need to add "itm_invisible_head" to module_items? can someone tell me how to do this either here or through private message. I have never coded anything since tonight and I've come along way since then.

Thanks for your patience :wink:
 
Einskaldir said:
*facepalm*

Edit 1: That's fixed now and works! (tried replacing the head with a helmet and is ok. Now just need to make some chopped and bloody neck instead of a helmet and done!

Thank you all very, very much!

Edit 2:
mb6s.jpg

Just need to tweak the textures a bit.

P.S: At the moment of cut some heads no extra blood was flowing, but anyways is really nice!

Ok, I got the head strikes to finally change to the helm same as you did, how do you edit textures and get it like you did?? is there a simple way to do it or do I need to download another editing program?
 
Hello,

Im working on implementing decapitation to my warband 1.143 multiplayer mod, but I can't get it working correcly. Could someone check my code?

Code:
#### DECAPITATION
theoris_decapitation = (
   ti_on_agent_hit, 0, 0, [(game_in_multiplayer_mode)],
	[
            (store_trigger_param_1, ":victim"),
            (store_trigger_param_3, ":damage"),
            (agent_is_active,":victim"),#v0.4
            (agent_is_human, ":victim"),
            (store_agent_hit_points, ":hp", ":victim", 1),
            (ge, ":damage", 5), #5 for DEBUG
            (ge, ":damage", ":hp"),
            (multiplayer_send_int_to_server, multiplayer_event_decapitation, ":victim"),
            (display_message, "@Cuttoff try is sended to server!", 0xCC0000), #DEBUG
	])

Code:
###### MULTIPLAYER DECAPITATION
#Server event.
(eq, ":event_type", multiplayer_event_decapitation),
   (store_script_param, ":victim", 3),
##      (player_get_agent_id, ":agent_id", ":player_no"),
        (agent_is_active,":victim"),#v0.4
	(agent_is_human, ":victim"),
         ### DEBUG
            (str_store_player_username, s31, ":player_no"),
            (multiplayer_send_string_to_player, ":player_no", multiplayer_event_show_server_message, "@Good damage to cut off head!"), #CLIENT SIDE DEBUG
            (display_message, "@DEBUG: {s31} has good damage to cut head off!", 0xCC0000), #SERVER SIDE DEBUG
         ### DEBUG END
	(agent_get_position, pos1, ":victim"),
	(get_distance_between_positions, ":distance", pos1, pos0),
	(is_between, ":distance", 160, 176), # *zing*
	(agent_get_item_slot, ":item", ":victim", 4), #head slot
	(try_begin),
		(ge, ":item", 1),
		(agent_unequip_item, ":victim", ":item"),
                (multiplayer_send_string_to_player, ":player_no", multiplayer_event_show_server_message, "@You cutted off enemy head!"),
                (display_message, "@DEBUG: {s31} cutted head off!", 0xCC0000), #SERVER SIDE DEBUG
	(try_end),
	(agent_equip_item, ":victim", "itm_invisible_head"),
	(particle_system_burst, "psys_game_blood_2", pos1, 125), #Blood effect
	#(set_spawn_position, pos1),
	#(spawn_scene_prop, "spr_physics_head"),
      
   (else_try),
###########
###### MULTIPLAYER DECAPITATION
 
narandill said:
Hello,

Im working on implementing decapitation to my warband 1.143 multiplayer mod, but I can't get it working correcly. Could someone check my code?

Code:
#### DECAPITATION
theoris_decapitation = (
   ti_on_agent_hit, 0, 0, [(game_in_multiplayer_mode)],
	[
            (store_trigger_param_1, ":victim"),
            (store_trigger_param_3, ":damage"),
            (agent_is_active,":victim"),#v0.4
            (agent_is_human, ":victim"),
            (store_agent_hit_points, ":hp", ":victim", 1),
            (ge, ":damage", 5), #5 for DEBUG
            (ge, ":damage", ":hp"),
            (multiplayer_send_int_to_server, multiplayer_event_decapitation, ":victim"),
            (display_message, "@Cuttoff try is sended to server!", 0xCC0000), #DEBUG
	])

Code:
###### MULTIPLAYER DECAPITATION
#Server event.
(eq, ":event_type", multiplayer_event_decapitation),
   (store_script_param, ":victim", 3),
##      (player_get_agent_id, ":agent_id", ":player_no"),
        (agent_is_active,":victim"),#v0.4
	(agent_is_human, ":victim"),
         ### DEBUG
            (str_store_player_username, s31, ":player_no"),
            (multiplayer_send_string_to_player, ":player_no", multiplayer_event_show_server_message, "@Good damage to cut off head!"), #CLIENT SIDE DEBUG
            (display_message, "@DEBUG: {s31} has good damage to cut head off!", 0xCC0000), #SERVER SIDE DEBUG
         ### DEBUG END
	(agent_get_position, pos1, ":victim"),
	(get_distance_between_positions, ":distance", pos1, pos0),
	(is_between, ":distance", 160, 176), # *zing*
	(agent_get_item_slot, ":item", ":victim", 4), #head slot
	(try_begin),
		(ge, ":item", 1),
		(agent_unequip_item, ":victim", ":item"),
                (multiplayer_send_string_to_player, ":player_no", multiplayer_event_show_server_message, "@You cutted off enemy head!"),
                (display_message, "@DEBUG: {s31} cutted head off!", 0xCC0000), #SERVER SIDE DEBUG
	(try_end),
	(agent_equip_item, ":victim", "itm_invisible_head"),
	(particle_system_burst, "psys_game_blood_2", pos1, 125), #Blood effect
	#(set_spawn_position, pos1),
	#(spawn_scene_prop, "spr_physics_head"),
      
   (else_try),
###########
###### MULTIPLAYER DECAPITATION

ti_on_agent_hit is server side. no need to send multiplayer message. just check condition and execute all code in mission_templates.
 
Here's a fancier version, with random knockback / knockdown, critical hits for missiles. It has been tested, and works.

This is more advanced stuff, please read the comments before attempting to copy-pasta this code, it has a dependency.

Code:
common_damage_system = (ti_on_agent_hit, 0, 0, [],
[
    (store_trigger_param_1, ":agent"),
    (store_trigger_param_2, ":attacker"),  
    (store_trigger_param_3, ":damage"),
    (store_trigger_param_3, ":orig_damage"),
    (agent_get_troop_id, ":troop", ":agent"),
    (agent_get_troop_id, ":attacker_troop", ":attacker"),  

    #Damage is lowered 5% per point of Ironflesh.
    (try_begin),
        (agent_is_human, ":agent"),#stop if not human
        (store_skill_level, ":ironflesh",  "skl_ironflesh", ":troop"),
        (gt, ":ironflesh", 0),
        (val_mul, ":ironflesh", 5),
        (assign, ":mod_damage", ":damage"),      
        (val_mul, ":mod_damage", ":ironflesh"),
        (val_div, ":mod_damage", 100),#Rounded here, but whatever.
        (val_sub, ":damage", ":mod_damage"),
    (try_end),
    #Damage is avoided 5% per point of Athletics
    (try_begin),
        (agent_is_human, ":agent"),#stop if not human
        (store_skill_level, ":athletics",  "skl_athletics", ":troop"),
        (gt, ":athletics", 0),  
        (val_mul, ":athletics", 5),
        (store_random_in_range, ":random_no", 1, 100),
        (try_begin),
            (le, ":random_no", ":athletics"),
            (assign, ":damage", 1),
            (try_begin),
                (eq, ":troop", "trp_player"),
                (display_message, "@You dodge the attack!"),
            (else_try),
                (eq, ":attacker_troop", "trp_player"),
                (display_message, "@{He/She} dodges the attack!"),
            (try_end),          
        (try_end),
    (try_end),  
    #Critical hits for missiles
    (try_begin),
        (is_between, reg0, "itm_missile_weapons_start", "itm_missile_weapons_end"),#special def in Blood and Steel source
        (store_random_in_range, ":random_no", 1, 100),
        (try_begin),
            (le, ":random_no", 5),
            (val_min, ":damage", 20),
        (try_end),
    (try_end),  
    #Random knockdown, with STR used to test
    (try_begin),
        (store_attribute_level,":strength",":attacker_troop",ca_strength),
        (store_attribute_level,":enemy_strength",":troop",ca_strength),
        (store_sub, ":strength_test", ":strength", ":enemy_strength"),
        (val_min, ":strength_test", 2),#2 percent knockdown, for weaker characters.
        (store_random_in_range, ":random", 1, 100),
        (try_begin),
            (neg|agent_is_ally,":agent"),#don't knock down allies
            (agent_is_human, ":agent"),#stop if not human          
            (agent_is_active,":agent"),#stop accidental CTD
            (agent_is_alive,":agent"),#same diff
            (agent_get_horse, ":horse", ":agent"),
            (eq, ":horse", -1),#don't knock down riders, maybe write some "lose yer horse" code later  
            (le, ":random", ":strength_test"),
            (agent_set_animation, ":agent","anim_shield_strike"),#see module_animations from Blood and Steel source for this anim definition
        (try_end),
    (try_end),
    (store_sub, ":diff_damage", ":damage", ":orig_damage"),
    (val_mul, ":diff_damage", -1),
    (store_agent_hit_points, ":hitpoints" , ":agent", 1),
    (val_add, ":hitpoints", ":diff_damage"),
    (agent_set_hit_points,":agent",":hitpoints",1),
])

Oh, and one other thing: agent_deliver_damage_to_agent triggers this code. That has some pretty cool implications.

Hello, I know this is an old post and this is a very noob question, but I'd like to know if this damage system works only for the player character or if it works for the NPCs too. Thanks.
 
Back
Top Bottom