Jump to content

Restricted Weapons


SeraVerte

Recommended Posts

Is there a way to modify a weapon so that it can only be used by certain npcs? Or does not allow other npcs to pick up said weapon?

On a related note, is there a way to disallow a certain type of arrow to appear in an npc's inventory after it has struck them?

Link to comment
Share on other sites

Is there a way to modify a weapon so that it can only be used by certain npcs? Or does not allow other npcs to pick up said weapon?

On a related note, is there a way to disallow a certain type of arrow to appear in an npc's inventory after it has struck them?

You could mark it as unplayable and start the game with it in that npc's inventory. Then, when they die, the player can't pick it up. If you don't want it to start in the npc's inventory, you would have to write a script giving them the weapon.

Link to comment
Share on other sites

The following script placed on the specific objects that you do not want NPCs to use should prevent them from using them by having said objects automatically removed from their inventory once added.

 

 

 

Scriptname PreventNPCsFromUsingItem Extends ObjectReference

Actor Property PlayerRef Auto
ObjectReference Property SelfObject Auto

;when the specified self object changes container and the player isn't the new container and the new container is an actor 
;then get the # of the specified self object and remove that from the actor's inventory.
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
  If (akNewContainer != PlayerRef) && (akNewContainer as Actor) 
    Int Num = akNewContainer.GetItemCount(SelfObject)
    akNewContainer.RemoveItem(SelfObject,Num,true) 
  EndIf
EndEvent

 

 

Modifying stock assets directly for local use could be acceptable but doing so for public release is not. There are too many issues that can arise due to removing a mod mid game that applied scripts directly to stock objects. It would therefore be beneficial to utilize a quest with aliases that point to the objects you wish to apply the script to. There would however need to be slight changes to the above script, but not much.

 

 

Do note that I have not tested the above script for compilation or functionality. It was written based on theory and experience with the various events and functions.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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