".resetinventory" isn't working

Post » Wed Nov 30, 2011 2:03 pm

I created a bunch of unique containers for a cell I created. They contain various weapons, ammo, and aid. I double-click on each of them, check the "persistent reference" box, and assign them a unique name in the empty field at the top (example "FirstAidKit01"). I create a unique terminal, and in the result script field of one of its menu items ("restore supplies") I have the script "[containername].resetinventory" for each container (example "FirstAidKit01.resetinventory"). The GECK tells me that the result script is working fine, as it compiles without issue. But when I go into the game, remove items from containers, and then access that terminal to restore all supplies, the containers from which I took items do not restore their previous inventories. Is ".resetinventory" the wrong command? Does it not work on containers that have already been opened?
User avatar
Robert DeLarosa
 
Posts: 3415
Joined: Tue Sep 04, 2007 3:43 pm

Post » Wed Nov 30, 2011 5:58 am

I'm not 100% sure, but perhaps the cell needs to reset first. Also, you can check the "respawn" flag on the containner and it will restock when the cell resets as well. If you want an immediate re-supply, try using the "Container.AddItem <#>" command from the results script on your terminal.
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Wed Nov 30, 2011 5:35 am

I'm not 100% sure, but perhaps the cell needs to reset first. Also, you can check the "respawn" flag on the containner and it will restock when the cell resets as well. If you want an immediate re-supply, try using the "Container.AddItem <#>" command from the results script on your terminal.


But see, then it'll add those items to the containers, even if they haven't been removed. :(
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Wed Nov 30, 2011 3:01 am

So do a containerRef.GetItemCount first. If the value is 0, add the items. If the value is non zero, either don't add the items or add the number that you want based on how many are in the container.
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Wed Nov 30, 2011 10:12 am

So do a containerRef.GetItemCount first. If the value is 0, add the items. If the value is non zero, either don't add the items or add the number that you want based on how many are in the container.


I suppose. I hadn't really thought of that. Thanks.

EDIT: Actually, that would mean I'd have to create dozens of menu items, each with a huge list of conditions, each restoring a different number of items to a different number of containers. Are you sure there isn't a simpler way?

EDIT II: It just occurred to me that I could have the containers be initially empty, thus making it logical that the terminal could add items to them without regard to what's already in them. This would make things a lot simpler, and I wouldn't have to use conditions on menu items. (I've always hated conditions. I wish you could just type them out in a field, like "GhoulSpawnway01.GetDead == 1" instead of having to fill out a mini-form and find references manually every time.)
User avatar
Mackenzie
 
Posts: 3404
Joined: Tue Jan 23, 2007 9:18 pm

Post » Wed Nov 30, 2011 10:51 am

Just use ContRef.RemoveAllItems, then add back what was originally in them.
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Wed Nov 30, 2011 3:59 am

Just use ContRef.RemoveAllItems, then add back what was originally in them.


Oh jeez! Pfsh, now I feel spectacularly dumb. How convenient! I'll see if that works, straight away!

EDIT: It works! Thanks. Anyone know why ".resetinventory" doesn't work?
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm

Post » Wed Nov 30, 2011 5:51 pm

Oh jeez! Pfsh, now I feel spectacularly dumb.


You and me both... :facepalm:
User avatar
louise fortin
 
Posts: 3327
Joined: Wed Apr 04, 2007 4:51 am


Return to Fallout 3