Force (container) respawn

Post » Sat Feb 19, 2011 4:08 am

Is there a method to force a container (chest, etc.) to respawn it's contents? And what about a cell, or even everything in the whole game world?
User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Sat Feb 19, 2011 5:45 am

Let's start with cell reset, since that is the easiest. Via console, or in a script, you just need to use the command resetinterior cellIDgoeshere for an interior cell. For exterior cells, a resetworld function exists, but remains undocumented and is prone to crash the game when used in anyway, so your best bet then is to just have the player wait indoors for a natural reset.

For containers, they will respawn when their cells reset. If you need to force-respawn one separately from the cell it's in, you'll want to http://cs.elderscrolls.com/constwiki/index.php/Scripting_Tutorial:_My_First_Script to http://cs.elderscrolls.com/constwiki/index.php/RemoveAllItems from the container, and then http://cs.elderscrolls.com/constwiki/index.php/AddItem each thing that you want in the container again manually.

Happy learning! :)
User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Sat Feb 19, 2011 12:35 am

Thanks for your response. Removing all items and then adding new ones again isn't really what I'm after as they're used by vendors using leveled item lists, but I'll look into the resetinterior command. A resetcontainer command would be nice though.
User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Post » Sat Feb 19, 2011 4:44 am

If you're just trying to make sure a vendor doesn't run out of a certain item, you can add a negative quantity of it. Same method works for a NPC who should always have a food item so they can do an Eat package.
User avatar
Sylvia Luciani
 
Posts: 3380
Joined: Sun Feb 11, 2007 2:31 am

Post » Sat Feb 19, 2011 9:24 am

I wanted to adjust the stock of a lot of vendors based on how the mod is configured through the ini file. The use of resetinterior did the job. Thanks.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Fri Feb 18, 2011 9:21 pm

Using ResetInterior has been known to remove anything 'dropped' in the cell as well. Poof! Bye, bye, its gone.

I personally would script to check the count of items in the chest and add only when they are low.
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Sat Feb 19, 2011 9:45 am

Good to know, although normally items dropped by the player character never decay so should be safe afaik. The mod isn't really adding if items are low though, but uses SetChanceNone and AddToLeveledList to modify the amount and type of items of 32 chests used as stock for vendors. Ideally I could use a ResetContainer function. Maybe something for OBSE 21, heh.
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm

Post » Fri Feb 18, 2011 8:04 pm

Player dropped items have been known to disappear with a forced cell reset. Its best to test it though, for your instance.
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am


Return to IV - Oblivion