Jump to content

Recommended Posts

Posted (edited)

Does anyone know how to use this function properly? https://www.creationkit.com/fallout4/index.php?title=RemoveAllItems_-_ObjectReference

It 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 = 0
while(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 += 1
endwhile

 

Any help please? thanks

Edited by hxhunter15
Posted

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.

Posted

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

  • 9 months later...
Posted

*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?

Posted
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.
Posted

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 ?

  • Recently Browsing   0 members

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