M3rvin Posted July 19, 2012 Share Posted July 19, 2012 I want to add 1 unit of every item in a form list to a container. But the basic Container_ListView.AddItem(List_Sort, 1, true) doesn't work. If I replace that by the following loop, it works like a charm. int i = 0 Form Item while(i < List_Sort.GetSize()) Item = List_Sort.GetAt(i) Container_ListView.AddItem(Item) i += 1 endwhile Does anyone know what the cause of this problem is? Link to comment Share on other sites More sharing options...
steve40 Posted July 20, 2012 Share Posted July 20, 2012 Yes. In your first example you are actually trying to add the form list itself into the container, not the base forms that are in the list. You can't do that.In the second example you are retrieving the item's that the form list is pointing to, via the GetAt(i) function. That is the correct way. Link to comment Share on other sites More sharing options...
M3rvin Posted July 20, 2012 Author Share Posted July 20, 2012 I'm sure that the 1st way worked a few patches back.And the creation kit wiki article on additem says: akItemToAdd: [...] If a form list, then it will add aiCount of each item in the list. Link to comment Share on other sites More sharing options...
flobalob Posted July 20, 2012 Share Posted July 20, 2012 I'm sure that the 1st way worked a few patches back.And the creation kit wiki article on additem says: akItemToAdd: [...] If a form list, then it will add aiCount of each item in the list. Also from the wikiAs of 6/5/2012, it appears that the latest beta patch (1.6) no longer allows for the AddItem method to add an object or objectreference of Form 'Container' to the player's inventory. Link to comment Share on other sites More sharing options...
scrivener07 Posted July 21, 2012 Share Posted July 21, 2012 Ive been scratching my head on this one too. I knew it worked once. Thanks for pointing this out Link to comment Share on other sites More sharing options...
Arodicus Posted August 15, 2012 Share Posted August 15, 2012 What's curious about this bug is that it's so arbitrary - always works for some users, never works for others, and is sporadic for the rest. In the game, the most obvious instance of the bug is that Salmon are no longer lootable. I'm not sure if it's used elsewhere. http://forums.bethsoft.com/topic/1403481-additem-formlist-not-working-in-17-please-verify/ Link to comment Share on other sites More sharing options...
Recommended Posts