Removing PC's goods

Post » Mon Nov 09, 2009 9:58 am

I want to have the player walk into a certain cell and have all of his/her items removed from his/her inventory and placed in a certain chest. Is this possible? Thanks for the help. :)
User avatar
Chica Cheve
 
Posts: 3411
Joined: Sun Aug 27, 2006 10:42 pm

Post » Mon Nov 09, 2009 2:17 pm

Player.RemoveAllItems [ContainerReferenceID]ExamplePlayer.RemoveAllItems MyContainerRef


It doesn't work on quest items, I don't think, or non-playables.

Edit:

From The CS Wiki:
Quest items are not removed when this function is called on the player
This function causes worn or wielded quest items to become unequipped. Any enchantment on wearable quest items will remain attached to the player permanently, and the quest item will become unwearable. The stuck enchantment effects may be removed from the player by using the "player.dispel EnchantmentID" command.
This function does not remove items flagged as "unplayable".
Sometimes the OnDrop and OnAdd of the moved items are not triggered when this function is called until the player opens the target container. For some scripted items using OnDrop and OnAdd, it may cause unexpected results.

User avatar
Esther Fernandez
 
Posts: 3415
Joined: Wed Sep 27, 2006 11:52 am

Post » Mon Nov 09, 2009 5:18 pm

Edit: CDM_ beat me to it :D
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Mon Nov 09, 2009 5:57 am

Thank you!

So if I put that in a script on the door the player enters to access that cell, when the player activates the door to teleport it will work?

What it is, is an ancient cult and the player stumbles onto an initiates test where all their items are removed into a chest that can be found at the end of the test, and the player must use their wits and various items scattered to find their way through the test....kinda Ultima Underworld style.
User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Mon Nov 09, 2009 8:53 am

It should do, it'll need to be something like:

Begin OnActivate Player  Player.RemoveAllItems [ChestRef]  ActivateEnd

User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am


Return to IV - Oblivion