louisthird Posted September 6, 2020 Share Posted September 6, 2020 I have the player drop an item and a companion pick it up. When I have that same companion use DropObject() on that item, the item is marked as stealing for the player. Why? This has something to do with the Owner of the item I think. If that is not the proper way to drop an item to keep the correct owner as not stealing, then what would be the proper way? Link to comment Share on other sites More sharing options...
louisthird Posted September 7, 2020 Author Share Posted September 7, 2020 Answering my own question: this function works for dropping and adjusts if you pass an item reference or base form: ObjectReference Function DropItem(ObjectReference akSenderRef, Form akBaseItem, Int aiItemCount, ObjectReference akItemReference) Actor actorOwner = akSenderRef as Actor ObjectReference droppedObject If akItemReference != None akItemReference.Drop(true) droppedObject = akItemReference Else droppedObject = akSenderRef.DropObject(akBaseItem, aiItemCount) EndIf If droppedObject != None droppedObject.SetActorRefOwner(actorOwner, true) EndIf return droppedObject EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts