F4llfield Posted May 14 Share Posted May 14 Creation kit/Papyrus question Hi, I have a list of NPC ID's that I want to put in an array, and after access them one by one. What would be the best of doing that ? Thanks for your time... Link to comment Share on other sites More sharing options...
LarannKiar Posted May 15 Share Posted May 15 Depends on how you have the list of FormIDs you'd like to add to an array then process. If the IDs are already in an array, this should work: Scriptname testScript Int[] Property InputFormIDs Auto Const Int[] Property OutputFormIDs Auto Const Function TestFunction() Int Index = InputFormIDs.Length -1 While Index >= 0 Int LoopFormID = InputFormIDs[Index] If LoopFormID > 0 If OutputFormIDs.Find(LoopFormID) < 0 OutputFormIDs.Add(LoopFormID) EndIf If OutputFormIDs.Find(LoopFormID) >= 0 ; ID now should be in OutputFormIDs now ; can be processed further if needed EndIf EndIf Index = Index - 1 EndWhile EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts