tweakyllama Posted August 4, 2016 Share Posted August 4, 2016 Hey, I'm trying to get an object to perform an action (add a keyword or store a reference) on a companion or settler when the player adds it to their inventory. I've looked at the OnContainerChanged event, but this seems to give an ObjectReference and I can't find a way to check if this is an Actor let alone a potential follower. Is there an easier way to go about this? Link to comment Share on other sites More sharing options...
Reneer Posted August 4, 2016 Share Posted August 4, 2016 You will want to post the source of the script you are working on if you want people to help you. :) Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted August 5, 2016 Share Posted August 5, 2016 If you would like to check if the old container or new container is an actor in the OnContainerChanged() event then cast them as an actor to check..Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If (Game.GetPlayer() == akOldContainer) && (akNewContainer As Actor) Faction PotentialCompanionFaction = Game.GetFormFromFile(0x001EC1B9, "Fallout4.esm") As Faction Bool bIsPotComp = (akNewContainer As Actor).IsInFaction(PotentialCompanionFaction) If bIsPotComp Debug.Notification("Player Added This Item To A Potential Companion") Else Debug.Notification("Player Added This Item To A NON Potential Companion") EndIf EndIf EndEvent Link to comment Share on other sites More sharing options...
tweakyllama Posted August 5, 2016 Author Share Posted August 5, 2016 Ah thank you. That's the key info I was missing. I will try it when I get home Link to comment Share on other sites More sharing options...
Recommended Posts