niston Posted June 19, 2024 Share Posted June 19, 2024 The infamous 128 elements limit for Papyrus arrays was added as a safety precaution. Which is probably a good thing, generally speaking. But sometimes, you just gotta put more than 128 elements. Here's how: ; use your own struct here Struct SomeStruct Int SomeInt Float Whatever EndStruct ; the array you want to add to SomeStruct[] myArray = new SomeStruct[0] ; your new element to add to myArray SomeStruct newElement = new SomeStruct ; add new element to the array If (myArray.Length < 128) ; regular add myArray.Add(newElement) Else ; SUP based add past 128 limit SomeStruct[] newEntryArray = new SomeStruct[1] newEntryArray[0] = newElement myArray = SUP_F4SE.MergeArrays(myArray as Var[], newEntryArray as Var[]) as SomeStruct[] EndIf The example shown uses an array of Struct, but the principle works with any Papyrus array type. Link to comment Share on other sites More sharing options...
DlinnyLag Posted June 19, 2024 Share Posted June 19, 2024 Or you can use arrays from F4DS, where it is suitable %) Link to comment Share on other sites More sharing options...
Recommended Posts