Jump to content

How to properly use RemoveAllItem()?


hxhunter15

Recommended Posts

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
Link to comment
Share on other sites

  • 9 months later...

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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