GetItemCount returning 1 for Level Items in containers

Post » Fri May 13, 2011 11:11 am

Maybe if i try this a little more on point. GetItemCount returns "1" for Level Items that spawn in containers. Is it supposed to do that? Is there a way to check if an item is a Level Item without running a check against a form list of items? Is there a way to check if the container is actually empty?

In the below images, you can see a debug message in the background that pops up then the container is activated.

http://img27.mediafire.com/a739143cd36534ede8b7197912289c893e877de01a61af700bcd58318175efd06g.jpg

http://img2.mediafire.com/122c2cf3a4183719f79cc11c13349f9e2c6dc2b70d5abd9acc214cc7e0c492fd6g.jpg

-----------------------------

The http://img23.mediafire.com/620d04f9c9d73b463edc9ba52b0b7f8c09c0cb06d02671e71074c0d134465c4e6g.jpg

The script on the container:
scn zzCountItemsScriptfloat fMsgVar1float fMsgVar2float fMsgVar3float fMsgVar4float fMsgVar5float fMsgVar6Begin OnActivate	if (IsActionRef Player)		set fMsgVar1 to GetItemCount Scotch		set fMsgVar2 to GetItemCount Vodka		set fMsgVar3 to GetItemCount Whiskey		set fMsgVar4 to GetItemCount Ammo12Ga		set fMsgVar5 to GetItemCount Yeast		set fMsgVar6 to GetItemCount Apple				ShowMessage zzCountItemsMESG, fMsgVar1 fMsgVar2 fMsgVar3 fMsgVar4 fMsgVar5 fMsgVar6				Activate		endifEnd


The plugin:
http://download948.mediafire.com/7r4k4w4gu2dg/2ss313c3b3k359e/zzCount.zip

To launch it:
coc zzCount

Thanks
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm

Post » Fri May 13, 2011 4:35 pm

What happens if you add a beer to the container before checking?
Does it return 2 (which would svck), or does it still return 1(which would give you a workaround: add one of the item, get the number and subtract 1 to get the quantity in the container, and then remove the item again)?
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Fri May 13, 2011 6:59 am

You mean add the item to the container via script or something before accessing it? I'll have to try that. Although, I think what spawns in the container is determined when you enter the cell? Or is it when you 1st access the container?

What I gathered from before was, while the level item is in the container, it will return the correct count.

I still have to try having both placed a level item and a non-level item of the same type and see what happens (IE a level item with beer and an actual non-level beer).

Somethings borked for sure though, I can say that much.
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Fri May 13, 2011 5:17 pm

I made a new Level Item with 1 beer in it at 100% chance. I put that in the container by itself and set the count to 5.

If I access the container right away, it will have 5 (1 from each level list count).

If I add 5 beers to it through the console and then access it, it will have 10 (1 from each level list count + 5 AddItem's).

If I access the container but do not take them, close it and then add 5 in the console, it will have 10 (1 from each level list count + 5 AddItem's).

Regardless of the above, after taking them all, GetItemCount Beer returns "1", even though there are "0". :(
User avatar
Nancy RIP
 
Posts: 3519
Joined: Mon Jan 29, 2007 5:42 am


Return to Fallout: New Vegas