hxhunter15 Posted October 30, 2017 Posted October 30, 2017 (edited) Does anyone know how to use this function properly? https://www.creationkit.com/fallout4/index.php?title=RemoveAllItems_-_ObjectReferenceIt says that with this function, you can remove all items from a container then transfer it to another container.Doesn't matter what i do, it doesn't work properly for me, the items gets removed but it doesn't transfer to the other container. Basically what I'm trying to do is removing all items from dead npcs and then transferring them to a special chest. This is my code:int index = 0while(index < GangDisciplesColl.GetCount()) Actor AllActor = GangDisciplesColl.GetAt(index) as Actor if (AllActor.isDead()) ; Transfer all items to a box AllActor.RemoveAllItems(ItemsLocker.GetRef(), false) AllActor.Disable() AllActor.Delete() endif index += 1endwhile Any help please? thanks Edited October 30, 2017 by hxhunter15
deadbeeftffn Posted October 30, 2017 Posted October 30, 2017 I guess that ItemsLocker is not an alias but an ObjectReference for a container. In that case you can't use GetRef(). A simple AllActor.RemoveAllItems(ItemsLocker, false) should work then.
shavkacagarikia Posted October 30, 2017 Posted October 30, 2017 Most likely you have respawn flag checked on your container. Uncheck it.
hxhunter15 Posted November 1, 2017 Author Posted November 1, 2017 I unchecked the respawn flag but it still doesn't work. ItemsLocker is also an alias. Thanks for the help anyway, I give up on this problem already since it's too frustrating lol
ThoraldGM Posted November 1, 2017 Posted November 1, 2017 Is the locker loaded? In same cell as actor?
hxhunter15 Posted November 1, 2017 Author Posted November 1, 2017 Yeah, they're just right beside each other
pra Posted August 26, 2018 Posted August 26, 2018 *threadcromancy* I'm somewhat certain that RemoveAllItems doesn't actually work on items spawned via loot lists. For my Grave Digger mod, I wanted to add special compatibility for Boston Interiors. The latter adds skeleton containers, where you can loot various bones from. What I did was placeatme'ing a grave container next to the skeleton, then calling skeleton.RemoveAllItems(grave), then disabling the skeleton.I noticed that the bones don't actually end up in the grave container, but it works fine for any items I manually put into the skeleton. Is this known behavior, is there a known workaround by now?
markyrocks Posted August 26, 2018 Posted August 26, 2018 As a brute force method to this problem would be to save the items in the first container in an array and then force the script to add the items to the second container via a loop and containerRef.additem(itemArray, 1, issilent) something like that. I'm finding this scripting to be very finicky so who knows if what I'm describing would actually work.
SKKmods Posted August 26, 2018 Posted August 26, 2018 Dynamic content like LevelLists don't *SEEM TO* spawn/respawn until the container OnCellAttach() or OnLoad() to ensure it levels with the player ... are you RemovingAllItems when the container Is3DLoaded in the player's uGridsToLoad radius ?
markyrocks Posted August 26, 2018 Posted August 26, 2018 (edited) Edit Edited August 26, 2018 by markyrocks
Recommended Posts