Jump to content

[LE] How to make ammo to be weapon specific


Hearton

Recommended Posts

On a mod I've been working on for a very long time I've ran into an issue.

 

I've made a bow and ammo to be used on it.

 

I don't want that ammo to be usable on any other weapon than that specific weapon.

 

I swear I've done it before. Somehow...

 

Thoughts?

Link to comment
Share on other sites

Your script idea lacks a property for your custom ammo. See below. Don't forget to actually assign your ammo to the property, otherwise it will do nothing in-game.

 

 

Scriptname MyScript extends ObjectReference  

Ammo Property CustomAmmo Auto

Event OnUnEquipped(Actor akActor)
    akActor.unequipItem(CustomAmmo)
EndEvent
 

 

 

This will not prevent using the ammo with other types of bows. If you do not want that as well, the best solution is to remove the ammo from the actor's inventory. This is what happens with bound arrows.

Link to comment
Share on other sites

Thanks for the input.

 

It compiles fine until I add in line 5: akActor.unequipItem(CustomAmmo) the it fails for some reason.

 

Also good point about that not preventing. There is a syntax that may work: akActor.abPreventEquip.

 

I think I may just leave it open for any bow. if this doesn't work. It's become more trouble than it's worth.

Link to comment
Share on other sites

Some functions do not run on objects when that object is inside a container. The bow when in the player inventory is inside a container so that may explain why it fails to unequip the ammo.

 

If this were for only the player, then you could create a quest with a player alias with a script. On that script you would equip or unequip the ammo as needed depending upon if the bow were equipped or unequipped. The perk idea might work, but only for the player. NPCs cannot have perks added in-game.

 

Good luck.

Link to comment
Share on other sites

  • 1 year later...

Thanks for the input.

 

It compiles fine until I add in line 5: akActor.unequipItem(CustomAmmo) the it fails for some reason.

 

Also good point about that not preventing. There is a syntax that may work: akActor.abPreventEquip.

 

I think I may just leave it open for any bow. if this doesn't work. It's become more trouble than it's worth.

 

I myself am working on something very similar in regards to this post. Going to give this a try this weekend. Any suggestions or input would be appreciated =D

Link to comment
Share on other sites

  • Recently Browsing   0 members

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