Author Topic: [Code] Flying Daggers  (Read 1250 times)

0 Members and 1 Guest are viewing this topic.

dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
[Code] Flying Daggers
« on: August 20, 2012, 12:40:00 AM »
I always think that tiny throwing weapons like daggers and knives should can be used as secondary secret weapons. A skillfull fighter should be able to pick the daggers from his belt and throw them lefthanded as surprising attack to his enemies.
So, here we bring the story to Warband.
(click to show/hide)
(click to show/hide)
 
(click to show/hide)
Notes :
- It can run without WSE, but surely WSE will make it better (imod related things)
- I use Papa Lazarau's shield bash animation. I'll be happy if there's anyone can provide me more representative animation.

EDIT1 : To disable while crouching
EDIT2 : BUG FIX on script_cf_has_throwing_daggers, now it check the current ammo left.
EDIT3 : Add mission trigger for AI
EDIT4 : Balancing things and add randomization
« Last Edit: August 22, 2012, 09:33:36 AM by dunde »

Mandible

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
  • WB
Re: [OSP] Flying Daggers
« Reply #1 on: August 20, 2012, 01:28:17 AM »
So basically, this allows you to quickly toss a throwing dagger without having to switch to it first? Cool!

Questions:
Can you allow AI to do it too? This would be great for assassin-type enemies!
Can you do it while holding a shield or a two-handed weapon? (seems like this would be a bit difficult to do in a combat situation)

dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: [OSP] Flying Daggers
« Reply #2 on: August 20, 2012, 03:58:12 AM »
So basically, this allows you to quickly toss a throwing dagger without having to switch to it first? Cool!
Yes, as long as you have throwing daggers or throwing knives equipped while your right hand holding 1 handed weapon and your left hand is idle, you can use them without wielding them

Can you allow AI to do it too? This would be great for assassin-type enemies!

Allowing AI do it is simple, the hard part is to make them do it in the right situation. Here's the scheme, I may update the OP while I finish my test for AI :
Code: [Select]
AI_do_special_moves = (0.1, 0, 0,
 [(try_for_agents, ":agent"),
     (agent_is_active,  ":agent"),  (agent_is_alive,":agent"), (agent_is_human, ":agent"),
    (agent_get_horse, ":horse", ":agent"),  # not mounting
    (le, ":horse", 0),
    (agent_get_crouch_mode, ":horse",":agent"), # not crouching
    (eq, ":horse", 0),
    (agent_get_wielded_item, ":shield", ":agent", 1),
    (le, ":shield", 0),
    (agent_get_wielded_item, ":weapon", ":agent", 0),
    (gt, ":weapon", 0),
    (item_get_type, ":weapon_type", ":weapon"),
    (eq, ":weapon_type", itp_type_one_handed_wpn),

   < more AI check, like whose his current target, the distance, etc >

    (call_script, "script_cf_has_throwing_daggers", ":agent"),
    (assign, ":weapon", reg0), (assign, ":slot", reg1),
    (call_script, "script_quick_throw", ":agent", ":weapon", ":slot"),
   (try_end),] ,[])

Can you do it while holding a shield or a two-handed weapon? (seems like this would be a bit difficult to do in a combat situation)

No, you can't do it while wielding shield. You can only do it while your right hand holding 1 handed weapon, and your left is idle. It's hard to pick a dagger from your belt and throw it while 10 kg+ pavise is weighting your left hand, isn't it. Sure, it can be modified, like if you wield buckler you still can do it with speed penalty. But I prefer not to let it at all. I think it's balanced this way.

Dawiduh

  • Squire
  • *
  • The sleep of reason creates monsters.
    • View Profile
    • David Stancu
  • Faction: Neutral
  • WB
Re: [OSP] Flying Daggers
« Reply #3 on: August 20, 2012, 06:39:00 AM »
Nice, this might come in handy some day  :mrgreen:

Lumos

  • Grandmaster Knight
  • *
  • Mens sana in corpore sano
    • View Profile
  • Faction: Nord
  • M&BWBWF&SNW
Re: [OSP] Flying Daggers
« Reply #4 on: August 20, 2012, 06:47:23 PM »
Will be used by TBS, most certainly. Thanks!

dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: [OSP] Flying Daggers
« Reply #5 on: August 22, 2012, 03:38:25 AM »
Updated. Now AI troops will do it too.

Hazzardevil

  • Squire
  • *
    • View Profile
  • Faction: Swadian
  • MP nick: Hazzardevil
  • NW
Re: [OSP] Flying Daggers
« Reply #6 on: September 01, 2012, 12:05:33 PM »
By having an "idle" left hand, are you referring to fighting with a one handed weapon and no shield or  can you do it with a two-handed weapon out?

dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: [OSP] Flying Daggers
« Reply #7 on: September 01, 2012, 01:07:08 PM »
With one handed weapon and no shield. In my opinion, two handed weapons keep left hand busy and weighted. So, player must choose +defensive option (shield) or +attacking option (flying daggers)
In my mods, I enable it for pistol and throwing knives too, so you can quickly deal with enemy closing on you with left handed throw and still can aim for another farther enemy.

Hazzardevil

  • Squire
  • *
    • View Profile
  • Faction: Swadian
  • MP nick: Hazzardevil
  • NW
Re: [OSP] Flying Daggers
« Reply #8 on: September 01, 2012, 02:19:37 PM »
With one handed weapon and no shield. In my opinion, two handed weapons keep left hand busy and weighted. So, player must choose +defensive option (shield) or +attacking option (flying daggers)
In my mods, I enable it for pistol and throwing knives too, so you can quickly deal with enemy closing on you with left handed throw and still can aim for another farther enemy.

Makes sense, I didn't know you could get firearms in your mods though.

dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: [OSP] Flying Daggers
« Reply #9 on: September 02, 2012, 06:29:49 AM »
There are 2 quick battle heroes with firearms. And yes, you're right.  I haven't add firearms into SP campaign yet.