Hearton Posted November 15, 2016 Share Posted November 15, 2016 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 More sharing options...
Hearton Posted November 15, 2016 Author Share Posted November 15, 2016 Here's an idea: Scriptname MyScript extends ObjectReference Event OnUnEquipped(Actor akActor) akActor.unequipItem(CustomAmmo)EndEvent Unfortunately it failed to compile. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 15, 2016 Share Posted November 15, 2016 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 More sharing options...
Hearton Posted November 16, 2016 Author Share Posted November 16, 2016 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 More sharing options...
Hearton Posted November 16, 2016 Author Share Posted November 16, 2016 Let's go around the tree. I'll make a perk that auto removes those arrows. Equipping the bow removes that perk. Unequipping the bow adds that perk. This could work Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 16, 2016 Share Posted November 16, 2016 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 More sharing options...
djanico Posted August 9, 2018 Share Posted August 9, 2018 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 More sharing options...
Recommended Posts