IronDusk33 Posted December 20, 2015 Share Posted December 20, 2015 I'm working on a mod that relies on a script to detect whether or not the player has up to 300 of these distinct items. I'll not go into the details because I would be here all day, but the way I currently have it set up goes like this. I have a FormList which is added as a property to the script, this FormList is filled with 60 other FormLists, which each contain 5 items. In the script I have an embedded while loop to detect whether or not the player has any number of these items, and if he does, adds that item to another FormList: FormList Property ListA autoFormList Property ListB auto...int ListIndex = 0While(ListIndex < ListA.GetSize()) FormList TempList = ListA.GetAt(ListIndex) as FormList int ListIndex2 = TempList.GetSize() - 1 While(ListIndex >= 0) if(Game.GetPlayer().GetItemCount(TempList.GetAt(ListIndex2) as MiscObject) > 0) ListB.AddForm(TempList.GetAt(ListIndex2) as MiscObject) endIf ListIndex2 = ListIndex2 - 1 endWhile ListIndex = ListIndex + 1endWhile So does anyone know of a way to streamline this process? As this code takes about 40 seconds to run, which is kinda annoying. Some way to check each of the 60 inner FormLists would be one way to streamline it, but I haven't found an elegant way to do that. Link to comment Share on other sites More sharing options...
Recommended Posts