Check container if empty

Post » Fri Nov 05, 2010 10:31 pm

Any way in geck for check if a container is empty ? :blink:
User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Sat Nov 06, 2010 2:45 am

Any way in geck for check if a container is empty ? :blink:

Well for vanilla there is a formlist named Everything that has - everything in it. So you can do
if (containerREF.GetItemCount EveryThing == 0)  ;do stuffendif


For NVSE there is :

short iItemsset iItems to GetNumItems containerREF

User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Sat Nov 06, 2010 10:21 am

Thanks Ricker, i already know the form list "everything", but my goal is to check even if they are no vanilla items.
So i need to move to NVSE ? No way to do it without it ??
User avatar
Bonnie Clyde
 
Posts: 3409
Joined: Thu Jun 22, 2006 10:02 pm

Post » Fri Nov 05, 2010 11:57 pm

Thanks Ricker, i already know the form list "everything", but my goal is to check even if they are no vanilla items.
So i need to move to NVSE ? No way to do it without it ??


There's no way that I know of. Functions that manipulate inventory are pretty sparse in the vanilla scripting.

Well, there is a new vanilla scripting function GetContainerInventoryCount, but the current version of the Geck that we have will not compile it. It is used in a couple scripts after the 1.2 patch, vMojaveExpressControlBoxSCRIPT is one of them. Hopefully we'll get an update to the Geck after the next patch.

And the NVSE function I mentioned is actually used in a call by reference, so ignore the way I typed it above.

short iItemsset iItems to containerREF.GetNumItems

User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am


Return to Fallout: New Vegas