Jump to content

Bow Script


Semeren151

Recommended Posts

I've had this idea in my head for a while now. I want to be able to equip my bow with a script attached to it that will equip a stack of specified ammo when I equip the bow. I've tried writing a few of my own scripts but the equipitem function only equips a maximum of one item from a stack. I was wondering if maybe I am using the function incorrectly (I'm relatively new at writing a script from scratch) or if there is another function I could use for the desired effect.
Link to comment
Share on other sites

I've had this idea in my head for a while now. I want to be able to equip my bow with a script attached to it that will equip a stack of specified ammo when I equip the bow. I've tried writing a few of my own scripts but the equipitem function only equips a maximum of one item from a stack. I was wondering if maybe I am using the function incorrectly (I'm relatively new at writing a script from scratch) or if there is another function I could use for the desired effect.

I actually had the same idea some time ago. I had the same issue, too. The problem withe the EquipItem command is that it will only equip 1 item from a stack no matter how you word it, which makes it (almost) useless for arrows. To work around it you can remove all but one arrow before equipping and adding them back afterwards, which will equip the others - but that will not make the quiver on the back in 3rd person mode update correctly.

The script for that looks something like:

 

scn MyBowScript

short ArrowCount

Begin OnEquip Player
Set ArrowCount to player.GetItemCount ArrowID - 1
Player.RemoveItem ArrowID ArrowCount
Player.EquipItem ArrowID
Player.AddItem ArrowID ArrowCount
End

That may not be the exact wording needed for this (it's been a while since I did this), but it should at least point you in the right direction.

 

You might also want to check out Enhanced Hotkeys. One of the features is that it has a special Bow+Arrows hotkey item that, when used, equips a bow + arrows.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...