Jump to content

Moving Items Between Actors. Container Change not working


Recommended Posts

I have a dead actor with a few items I want to move to an alive actor. I thought this script should do the job.

 

Actor Property MyActor Auto
ObjectReference Property OldCont01 Auto; Is dead actor
ObjectReference Property NewCont01 Auto; Is actor
ObjectReference Property OldCont02 Auto
ObjectReference Property NewCont02 Auto

Auto State Waiting

EVENT onTriggerEnter(ObjectReference akActionRef)
if akActionRef == MyActor
GotoState("Busy")

OldCont01.RemoveAllItems(NewCont01)

Debug.Notification ("Items moved")

GoToState("Done")

EndIf
ENDEVENT
ENDSTATE

 

The items are removed from the dead actor's inventory but the other actor doesn't receive them. Well when pickpocketing the NPC the items that should have been moved aren't in the inventory.

Confused - thought this was straight forward.

 

EDIT Tried:

OldCont01.RemoveAllItems(akActionRef)

Still no luck.

Edited by antstubell
Link to comment
Share on other sites

Scenario: Player encounters corpse. Corpse has keys to his house, a note and another 'clue' item in his inventory. Player can obviously loot these items and if player does not do this then the 'paramedic' NPC (witch) will eventually arrive and loot the items for herself, which is a benefit to her because the 'clue' item seems to imply that she had something to do with the death. When witch NPC gets home she will lock the items away in a chest which player can lockpick if player has been smart enough to observe what is going on. The Witch's quest changes on whether the corpse has been looted and in fact it changes if she doesn't know about the dead body.

1. Player encounters or not a corpse.

2. Player loots corpse or not.

3. Other stuff happens and witch NPC gets a note left for her to collect the body.

4a. Player takes the note before witch NPC has chance to read it. Witch NPC does not go to corpse and loot it.

4b. Player leaves note, witch NPC 'reads the note' (it wasn't taken by player), goes to corpse and loots it.

5. If witch NPC read the note > looted the body she gets home and items are moved from her inventory to a chest.

 

EDIT: Typos

Edited by antstubell
Link to comment
Share on other sites

Are the items considered quest items? If so you have to do OldCont01.RemoveAllItems(NewCont01, false, true). If that doesn't work, you can try doing it manually with removeItem: https://www.creationkit.com/index.php?title=RemoveItem_-_ObjectReference. If that still doesn't work, then you can do removeAllItems with no container and then just use AddItem: https://www.creationkit.com/index.php?title=AddItem_-_ObjectReference, as IsHaraMeradin suggested.

Link to comment
Share on other sites

Just theory throwing here...

Are the items on the corpse pre-placed in the Creation Kit? If so, it might be an issue related to GetItemCount not able to count pre-placed items in a container until said container is open. The items are present but have no designated object reference until they get loaded. As such GetItemCount fails to count the # of instances and RemoveAllItems might not be able to deposit into a new container.

 

Have you checked, for completeness sake, to see what happens if the player opens the corpse inventory but does not loot anything so that the NPC can still loot later? Do the items properly transfer then?

Link to comment
Share on other sites

Checking it now, be right back.........

 

UPDATE. Well...er... you gonna think I'm a complete moron and it's true I didn't place any items in the OldContainer01 (actor) inventory.

Just gonna bang my head against the wall for a while.

 

Done with head injuries, now another question. Can I hide items in an actor's inventory? Should I prepare for more headbanging when the obvious answer is provided?

Edited by antstubell
Link to comment
Share on other sites

  • Recently Browsing   0 members

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