Author Topic: Shield Bash kit. Bug fixed and expanded!  (Read 14392 times)

0 Members and 1 Guest are viewing this topic.

Mirathei

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Vaegir
Shield Bash kit. Bug fixed and expanded!
« on: September 04, 2008, 10:14:07 pm »
Pretty simple really, press the attack controll while holding the defend controll. Ai will do it automatically when applicable with some degree of randomization. Got to give Zaro credit for making the results partially dependent on the shield skill of the basher.
To install, just paste the following in to module scripts:
 

 ("cf_agent_shield_bash",
    [(store_script_param, ":agent",1),
     (agent_get_position,pos1,":agent"),
     (agent_set_animation, ":agent", "anim_release_bash"),
     (agent_play_sound,":agent","snd_man_grunt"),
     (assign,":victim",-1),
     (try_for_agents,":possible_victim"),
        (agent_is_alive,":possible_victim"),
        (agent_is_human,":possible_victim"),
        (neq,":possible_victim",":agent"),
        (agent_get_class ,":class", ":possible_victim"),
        (neq,":class",grc_cavalry),
        (agent_get_position,pos2,":possible_victim"),
        (get_distance_between_positions,":dist",pos1,pos2),
        (lt,":dist",150),
        (neg|position_is_behind_position,pos2,pos1),
        (assign,":victim",":possible_victim"),
     (end_try),
     (gt,":victim",-1),
     (store_random_in_range,":rand",0,2),
     (store_agent_hit_points,":hp",":victim",1),
     (val_sub,":hp",":rand"),
     (store_random_in_range,":hit_reaction",1,101),
     (store_skill_level,":a_shield",skl_shield,":victim"),
     (store_skill_level,":v_shield",skl_shield,":agent"),   
     (try_begin),
         (gt,":hp",0),
         (agent_set_hit_points,":victim",":hp",1),
         (agent_play_sound,":agent","snd_shield_hit_wood_wood"),
         (agent_play_sound,":victim","snd_blunt_hit"),
         (try_begin),      
           (gt,":a_shield", ":v_shield"),
              (try_begin),      
                (is_between,":hit_reaction",0,10),   
                (agent_set_animation, ":victim", "anim_bash_unsuccessful"),
              (else_try),      
                (is_between,":hit_reaction",11,20),   
                (agent_set_animation, ":victim", "anim_bash_crouch"),            
              (else_try),
                (is_between,":hit_reaction",21,30),   
                (agent_set_animation, ":victim", "anim_bash_mini_stun"),
              (else_try),
                (is_between,":hit_reaction",21,79),   
                (agent_set_animation, ":victim", "anim_bash_stun"),            
              (else_try),
                (is_between,":hit_reaction",80,100),   
                (agent_set_animation, ":victim", "anim_bash_knocked"),
              (end_try),            
         (else_try),
           (lt,":a_shield", ":v_shield"),
              (try_begin),      
                (is_between,":hit_reaction",0,20),   
                (agent_set_animation, ":victim", "anim_bash_unsuccessful"),
              (else_try),      
                (is_between,":hit_reaction",21,42),   
                (agent_set_animation, ":victim", "anim_bash_crouch"),            
              (else_try),
                (is_between,":hit_reaction",43,65),   
                (agent_set_animation, ":victim", "anim_bash_mini_stun"),
              (else_try),
                (is_between,":hit_reaction",66,92),   
                (agent_set_animation, ":victim", "anim_bash_stun"),            
              (else_try),
                (is_between,":hit_reaction",93,100),   
                (agent_set_animation, ":victim", "anim_bash_knocked"),
              (end_try),
         (else_try),
           (eq,":a_shield", ":v_shield"),
              (try_begin),      
                (is_between,":hit_reaction",0,16),   
                (agent_set_animation, ":victim", "anim_bash_unsuccessful"),
              (else_try),      
                (is_between,":hit_reaction",17,33),   
                (agent_set_animation, ":victim", "anim_bash_crouch"),            
              (else_try),
                (is_between,":hit_reaction",34,50),   
                (agent_set_animation, ":victim", "anim_bash_mini_stun"),
              (else_try),
                (is_between,":hit_reaction",51,89),   
                (agent_set_animation, ":victim", "anim_bash_stun"),            
              (else_try),
                (is_between,":hit_reaction",90,100),   
                (agent_set_animation, ":victim", "anim_bash_knocked"),
              (end_try),
         (end_try),      
     (else_try),
         (agent_play_sound,":agent","snd_shield_hit_wood_wood"),
         (agent_play_sound,":victim","snd_blunt_hit"),
         (agent_deliver_damage_to_agent,":agent",":victim"),
     (end_try),
   ]),

The following into any applicable mission template:

      (ti_before_mission_start, 0, 0, [], [(assign,"$bash_readiness",0)]),


      (0.1, 0, 0, [], [(val_add,"$bash_readiness",1),]),


      (0, 0, 0, [(game_key_is_down, gk_defend),(game_key_clicked, gk_attack),],
       [(assign,":continue",0),
        (get_player_agent_no,":player"),
        (agent_is_alive,":player"),
        (try_for_range,":shield","itm_wooden_shield","itm_heraldic_mail_with_surcoat"),
            (agent_has_item_equipped,":player",":shield"),
            (assign,":continue",1),
        (end_try),
        (eq,":continue",1),
        (agent_get_horse,":horse",":player"),
        (neg|gt,":horse",0),
        (ge,"$bash_readiness",10),
        (assign,"$bash_readiness",0),
        (call_script,"script_cf_agent_shield_bash",":player"),
        ]),

      (1.0, 0, 0, [],
       [(get_player_agent_no,":player"),
        (try_for_agents,":agent"),
           (agent_is_alive,":agent"),
           (agent_is_human,":agent"),
           (neq,":agent",":player"),
           (agent_get_class ,":class", ":agent"),
           (neq,":class",grc_cavalry),
           (assign,":continue",0),
           (try_for_range,":shield","itm_wooden_shield","itm_heraldic_mail_with_surcoat"),
               (agent_has_item_equipped,":agent",":shield"),
               (assign,":continue",1),
           (end_try),
           (eq,":continue",1),
           (assign,":chances",0),
           (agent_get_team,":team",":agent"),
           (agent_get_position,pos1,":agent"),
           (try_for_agents,":other"),
                (agent_is_alive,":other"),
                (agent_is_human,":other"),
                (agent_get_class ,":class", ":other"),
                (neq,":class",grc_cavalry),
                (agent_get_team,":otherteam",":other"),
                (neq,":team",":otherteam"),
                (agent_get_position,pos2,":other"),
                (get_distance_between_positions,":dist",pos1,pos2),
                (neg|position_is_behind_position,pos2,pos1),
                (lt,":dist",200),
                (val_add,":chances",1),
           (end_try),
           (store_agent_hit_points,":health",":agent",0),
           (val_mul,":health",-1),
           (val_add,":health",100),
           (val_div,":health",10),
           (val_mul,":chances",":health"),
           (store_random_in_range,":rand",1,25),
           (lt,":rand",":chances"),
           (call_script,"script_cf_agent_shield_bash",":agent"),
        (end_try),]),
And the following into module animations (note that these must be pasted over unused animations, not at the end of the file):

# strike_fall_back_rise_after_bashed
 ["bash_knocked", acf_enforce_all|acf_align_with_ground,
   [2.0, "anim_human", blow+5400, blow+5453, arf_blend_in_2],
 ],
# strike_chest_front_stop
 ["bash_stun", acf_enforce_all,
   [1.5, "anim_human", blow+5000, blow+5010, arf_blend_in_3],
 ],
# strike_chest_front_stop
 ["bash_mini_stun", acf_enforce_all,
   [0.6, "anim_human", blow+5000, blow+5010, arf_blend_in_3],
 ],
 # anim jump end
 ["bash_crouch", acf_enforce_all|acf_enforce_lowerbody,
   [0.5, "anim_human", 280, 290, arf_blend_in_3],
 ], 
# strike_head_front_left
 ["bash_unsuccessful", acf_enforce_all,
   [0.55, "anim_human", blow+0, blow+10, arf_blend_in_3],
 ],

 ["release_bash", acf_enforce_all|acf_right_cut|acf_parallels_for_look_slope,
   [0.62, "anim_human", combat+5710, combat+5740, blend_in_release],
 ],




Things to take note of: bashing is only for and only against footmen., thus cavalry will not bash or be bashed. Also, only shields in the range referenced in red above will be bash usable. If you want to bash with a shield, put it in that range.


Enjoy.  :)
« Last Edit: September 08, 2008, 04:27:03 am by Mirathei »

Dryvus

  • The Subscriber Is Power Off
  • Grandmaster Knight
  • *
  • Nobody fucks with William T. Riker.
    • View Profile
  • Faction: Vaegir
  • MP nick: Dryvus
Re: Shield Bash kit. Come check it out.
« Reply #1 on: September 04, 2008, 10:16:25 pm »
Congrats! Can't wait to try this out!

Edit: Will this be added to Gun Thunder?
"When the castle falls, all those inside will be put to the sword. Your herds will be butchered, your godswood will be felled, your keeps and towers will burn. I'll pull your walls down, and divert the Tumblestone over the ruins. By the time I'm done no man will ever know that a castle once stood here." Jaime got to his feet. "Your wife may whelp before that. You'll want your child, I expect. I'll send him to you when he's born. With a trebuchet."

Alec{zacool}

  • Knight at Arms
  • *
  • Retardation at it's worst.
    • View Profile
    • My website!
  • Faction: Neutral
  • MP nick: KoS_Aleczacool
Re: Shield Bash kit. Come check it out.
« Reply #2 on: September 04, 2008, 10:48:01 pm »
Mirethei.



You.

Are.

The.

God.

Of.

Discovering.

Neat.

Crap.

And.

Doing.

It.

'tis going to be added to my mod.

-Alec

Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • The root word in "Funeral" is "Fun"
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Shield Bash kit. Come check it out.
« Reply #3 on: September 04, 2008, 10:48:47 pm »
as it shall be added to mine :)

Suzerain

  • Regular
  • *
    • View Profile
Re: Shield Bash kit. Come check it out.
« Reply #4 on: September 04, 2008, 11:57:19 pm »
fantastic.... I might actualyl start to use shields as they're meant to be.

now, if only we could have a "kick in the bollocks" button and a "get in close and force them over" action, the combat would be nicely brutal and more realistic :)
"she had the shy, retiring, almost virginal look of the professional nymphomaniac"

KON_Air

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Shield Bash kit. Come check it out.
« Reply #5 on: September 05, 2008, 12:07:15 am »
asfaf I just finalized my trade script(s) and checking animations to starting to work on that :P
Comparing Fallout 3 and 1-2 is like comparing an apple to a mutated apple which is trying to bite your face.

Zaro

  • italiano stallion-o
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Shield Bash kit. Come check it out.
« Reply #6 on: September 05, 2008, 12:11:05 am »
It's a shame we don't have a more suitable animation to use. I tried it out and it does add some more depth to combat, as you can't just stand there blocking everything. Getting knocked over also leaves you quite vulnerable. I take it we can't use the 'stunned' animation and somehow increase the duration?

AvaRice

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Shield Bash kit. Come check it out.
« Reply #7 on: September 05, 2008, 12:14:08 am »
Wow, can't wait to see it in action.

insomniac391

  • Sergeant
  • *
  • cant get enough of it!!!!
    • View Profile
  • Faction: Swadian
Re: Shield Bash kit. Come check it out.
« Reply #8 on: September 05, 2008, 12:18:11 am »
i cant find a file called module scripts or module animations
i feel dumb

Mirathei

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Vaegir
Re: Shield Bash kit. Come check it out.
« Reply #9 on: September 05, 2008, 12:39:30 am »
Congrats! Can't wait to try this out!

Edit: Will this be added to Gun Thunder?

Yes, it will be in Gun Thunder, but you probably won't see much of it in there, since most of the troops don't have shields.

It's a shame we don't have a more suitable animation to use. I tried it out and it does add some more depth to combat, as you can't just stand there blocking everything. Getting knocked over also leaves you quite vulnerable. I take it we can't use the 'stunned' animation and somehow increase the duration?

What exactly do you mean by the "stunned" animation? I'm sure it could  be added in, but what duration is it that you want to increase.

i cant find a file called module scripts or module animations
i feel dumb

Are you looking in the module system?

Zaro

  • italiano stallion-o
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Shield Bash kit. Come check it out.
« Reply #10 on: September 05, 2008, 12:55:32 am »
Quote
What exactly do you mean by the "stunned" animation? I'm sure it could  be added in, but what duration is it that you want to increase.


The animation when someone is hit and they are stunned temporarily. I assume it's this one:

Code: [Select]
["strike_chest_front_stop", acf_enforce_all,
   [0.4, "anim_human", blow+5000, blow+5010, arf_blend_in_3],
 ],

I'm looking forward to seeing what animations have been improved/added for 1.0.

insomniac391

  • Sergeant
  • *
  • cant get enough of it!!!!
    • View Profile
  • Faction: Swadian
Re: Shield Bash kit. Come check it out.
« Reply #11 on: September 05, 2008, 01:26:27 am »
i cant find a file called module scripts or module animations
i feel dumb

Are you looking in the module system?
[/quote]

yes i am
it might help if pasted the directory in here to help me out
right now im looking in D:\M&B 9.6\Modules\Native and im looking through all the text documents

Zaro

  • italiano stallion-o
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Shield Bash kit. Come check it out.
« Reply #12 on: September 05, 2008, 01:56:25 am »
That's not the module system, as it isn't a mod folder containing text files, it's a separate download that contains python files than compile into text files. You can download it in a sticky near the top of this section.

Trooper5445

  • Master Knight
  • *
  • Exiled
    • View Profile
  • Faction: Rhodok
Re: Shield Bash kit. Come check it out.
« Reply #13 on: September 05, 2008, 04:22:51 am »
Rhodoks in Gun Thunder are going to kick major ass.
The Forum of Taleworlds is a medium sized, liberal forum, remarkable for its tight restrictions on idiocy. Its population of 33.46 thousand citizens are ruled by a group of mostly-benevolent dictators, who grant the populace the freedom to live their own lives but watches carefully for anyone to slip up.

Quote from: Marx
I wouldn't want to belong to any club that would have me as a member


D'Sparil

  • Grandmaster Knight
  • *
  • Hunting the Vaegir scum since 0.711!
    • View Profile
  • Faction: Swadian
Re: Shield Bash kit. Come check it out.
« Reply #14 on: September 05, 2008, 05:28:29 am »
Jesus christ dude. I was totally right when I chose you as best modder on the Forum Awards thread  :P
Fear the LOL FAG Man army, for it will destroy you and everything you love.


The Eagle & The Radiant Cross for 1.011