Move specific ObjectReference into a container?

Post » Sat Dec 14, 2013 10:52 pm

I'm wondering if there's a way to move a specific ObjectReference into a container, and I can't seem to find one... AddItem()/RemoveItem() only seem to deal with base Forms and this is an object that has been dynamically created and renamed using reference aliases. I tried e.g. myObject.Activate(myContainer) but no luck.

Alternatively, is there a way to fill a reference by creating an object inside a container using Papyrus at runtime, similar to the creation kit method of creating an object inside a container to fill a reference at quest start time? Currently to get a valid object reference I'm using PlaceAtMe() to dump the object into the world, I'd like to either move it immediately into a container after renaming or spawn it inside a container and still have a valid reference for renaming.

User avatar
Francesca
 
Posts: 3485
Joined: Thu Jun 22, 2006 5:26 pm

Post » Sat Dec 14, 2013 11:07 pm

AddItem does in fact work on object references. I think RemoveItem should also work since your object is being held in an alias. See wiki page under parameters - http://www.creationkit.com/ObjectReference.AddItem_%28Papyrus%29

Items can be spawned in chests as well through the quest system. Create an alias which points to the container you want, and then create the alias of your object using the Create Reference to Object function.

User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Sat Dec 14, 2013 9:38 pm

Ahh I see, easy enough. Thanks!

User avatar
Lily Something
 
Posts: 3327
Joined: Thu Jun 15, 2006 12:21 pm


Return to V - Skyrim