Problem : When moving from the container HUB to the PC, GetItemCount on the container returns the correct value. However it doesn't work on the PC.
The script is simple (well... not so it seems in the end), where I'm using one Formlist containing the "valid" keywords hence defining one single category : all items having at least one of its keywords will get processed and moved into a container HUB located in an inaccessible cell. Actually, the Formlist I'm testing with currently has one single Keyword : VendorItemPotion.
Here is the script (I haven't include the whole script, only the relevant parts for a workable script) :
Scriptname fj_BHStorageSingleCategoryScript extends ObjectReferenceObjectReference Property rContainerCategoryHUB Auto{Associated shared HUB container in an unaccessible cell}Formlist Property fCategory Auto{Formlist of Keywords : any item having one of its Keywords will get processed}Int iIndexKeywords ;Index for traversing the FormlistInt iCountPerK ;Number of items matching a specific Keyword in the FormlistInt iCountItem ;Number of items matching the whole Category (all the Keywords in the Formlist)Event OnInit() iCountKeywords = fCategory.GetSize()EndEventEvent OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() iCountItem = 0 iIndexKeywords = iCountKeywords ; number of Keywords in the Formlist ShowMenu(0, akActionRef) EndifEndEventFunction ShowMenu(Int iButton = 0, ObjectReference akActionRef)iButton = mMainMenuFourChoices.Show()If iButton == 0 ;*** STORE ALL items While iIndexKeywords iIndexKeywords -= 1 [color=#ffa07a]iCountPerK = akActionRef.GetItemCount(fCategory.GetAt(iIndexKeywords) As Keyword)[/color] iCountItem += iCountPerK akActionRef. .RemoveItem(kCurrentKeyword, iCountPerK, True, rContainerCategoryHUB)debug.Notification("STORE ALL iCountKeywords = "+iCountKeywords+"; iIndexKeywords = "+iIndexKeywords+"; iCountPerK = "+iCountPerK+"; iCountItem = "+iCountItem) EndWhileElseIf iButton == 1 ;*** TAKE ALL Items - cut down to minimalistic functionality rContainerCategoryHUB.RemoveAllItems(akActionRef, True, True)ElseIf iButton == 2 ;*** INVENTORY rContainerCategoryHUB.Activate(akActionRef) Utility.Wait(0.1) While iIndexKeywords iIndexKeywords -= 1 iCountPerK = rContainerCategoryHUB.GetItemCount(fCategory.GetAt(iIndexKeywords) As Keyword) iCountItem += iCountPerKdebug.Notification("INVENTORY iCountKeywords = "+iCountKeywords+"; iIndexKeywords = "+iIndexKeywords+"; iCountPerK = "+iCountPerK+"; iCountItem = "+iCountItem) EndWhileElseIf iButton &--#62;= 3EndIfEndFunctionWith one Keyword in the Formlist, the TAKE ALL section notification shows incxorrect values for iCountPerK : it always return a negative value, even when there's no item matching the Keyword criteria. However the section INVENTORY works prefectly, iCountPerK returning the correct value.What am I doing wrong? Any tweek? Help!
