".resetinventory" isn't working

Post » Mon Apr 26, 2010 11:05 am

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
Harinder Ghag
 
Posts: 3405
Joined: Wed Jan 17, 2007 11:26 am

Post » Mon Apr 26, 2010 1:24 pm

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
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Mon Apr 26, 2010 6:15 pm

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
john page
 
Posts: 3401
Joined: Thu May 31, 2007 10:52 pm

Post » Tue Apr 27, 2010 1:08 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
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Tue Apr 27, 2010 1:13 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
Kill Bill
 
Posts: 3355
Joined: Wed Aug 30, 2006 2:22 am

Post » Mon Apr 26, 2010 5:56 pm

Just use ContRef.RemoveAllItems, then add back what was originally in them.
User avatar
Svenja Hedrich
 
Posts: 3496
Joined: Mon Apr 23, 2007 3:18 pm

Post » Mon Apr 26, 2010 11:10 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
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Mon Apr 26, 2010 9:02 pm

Oh jeez! Pfsh, now I feel spectacularly dumb.


You and me both... :facepalm:
User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm


Return to Fallout 3