Jump to content

Why is game ignoring this script?


Masterofnet

Recommended Posts

Scriptname DropIt extends ObjectReference  

Armor Property AR Auto

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
Actor PlayerRef = Game.GetPlayer()
		If PlayerRef == akNewContainer 
PlayerRef.DropObject(Self)
EndIf
EndEvent

Why is the game ignoring Self??? When I replace Self with Ar it works. I have tried Self.GetBaseObject().

 

 

 

Does anyone know?

Edited by Masterofnet
Link to comment
Share on other sites

You can't reference "self" on an item as long as it is in an inventory. You have to pass the base object as a property. Basically as long as an item is in an inventory it's just an entry in a list, not an object with a "self." Of course it's more complicated than that, but that's the quick and dirty way to think about it.

Link to comment
Share on other sites

Objects inside inventories as far as I know don't have a sense of self (or as least as far as papyrus is concerned) when it comes to object references unless a quest is referencing them in an alias. If this is for just a single specific instance of an item you could probably use a quest alias to allow this to work, if it's for all objects of that base type you will have to place this on that specific form and use a property pointing to the armor form.

Edited by Arocide
Link to comment
Share on other sites

  • Recently Browsing   0 members

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