Filtered Inventory

Post » Sat Feb 19, 2011 12:56 am

I am looking to duplicate an actors inventory to a container I specify, so that I may peruse the contents. But according to information I've found, leveled item lists will always be duplicated broken. Based on what I've seen so far, using DuplicateAllItems on an actor to copy their contents to another container results in some items showing up in the new container as and as a missing mesh if you drop them on the ground. I've also read that you can not remove leveled item lists with RemoveAllItems or RemoveItem.

Example script:
ScriptName AAACloningQuestScriptFloat FQuestDelayTime ; This adds "FQuestDelayTime" as a variable...Ref Target ; This adds "Target" as a variable...Short Organic ; This adds "Organic" as a variable...Short Container ; This adds "Container" as a variable...Short CurrentKey ; This adds "CurrentKey" as a variable...Short KeyDown ; This adds "KeyDown" as a variable...Begin GameMode ; Begin the script...Set FQuestDelayTime To 0.08 ; This sets the quests delay time...Set KeyDown To IsKeyPressed2 AAANOAHKeys.CloningKey ; Button press detection variables...Set Target To Player.GetCrosshairRef ; Sets the target of the script to whats under the crosshair...Set Organic To Target.IsActor ; Detects whether the target is an actor...Set Container To Target.IsContainer ; Detects whether the target is a container...If (KeyDown) && (Organic) || (Container) ; Button is pressed and the target has an inventory...Target.DuplicateAllItems AAAContainer10 ; Duplicates all the targets items to a custom container...AAAContainer10.Activate Player ; Opens the custom container...Set CurrentKey To 1 ; Set the keys status to one...EndIfEnd


For whatever reason, this script will work to copy the items to the new container, but upon doing so will also create a collection of items in the new container as well. I need a way to filter these out, or an alternative way of copying an actors inventory (besides DuplicateAllItems) that won't create this issue. Hopefully someone has some experience with this type of work. I could certainly use a few pointers. Thanks.

-Nate
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm

Return to IV - Oblivion