Background for Skyrim SE

PapyrusUtil


Inheritance Tree

No indexed scripts extend this script.

Properties
Events
Functions
intfunctionGetVersion()NativeGlobal

Get version of papyrus DLL library. Version 4.6 will return 46.

intfunctionGetScriptVersion()Global

Get version of compiled papyrus scripts which should match return from GetVersion()

Actor[]functionActorArray(intsize, Actorfiller=NONE)NativeGlobal

Few extra array types not provided by SKSE normally to help avoid having to use and cast Form arrays

Actor[]functionResizeActorArray(Actor[]ArrayValues, inttoSize, Actorfiller=NONE)NativeGlobal
ObjectReference[]functionObjRefArray(intsize, ObjectReferencefiller=NONE)NativeGlobal
ObjectReference[]functionResizeObjRefArray(ObjectReference[]ArrayValues, inttoSize, ObjectReferencefiller=NONE)NativeGlobal
float[]functionPushFloat(float[]ArrayValues, floatpush)NativeGlobal

Append a value to the end of the given array and return the new array.

NOTE: The array has to be recreated each time you call this. For the sake of memory usage and performance, DO NOT use these to build up an array through a loop,

in such a situation it is significantly faster to create the full length array first and then fill it. Best to limit to only the occasional need.

int[]functionPushInt(int[]ArrayValues, intpush)NativeGlobal
string[]functionPushString(string[]ArrayValues, stringpush)NativeGlobal

bool[] function PushBool(bool[] ArrayValues, bool push) global native ; // Bugged - Non-native version available below

Form[]functionPushForm(Form[]ArrayValues, Formpush)NativeGlobal
Alias[]functionPushAlias(Alias[]ArrayValues, Aliaspush)NativeGlobal
Actor[]functionPushActor(Actor[]ArrayValues, Actorpush)NativeGlobal
ObjectReference[]functionPushObjRef(ObjectReference[]ArrayValues, ObjectReferencepush)NativeGlobal
float[]functionRemoveFloat(float[]ArrayValues, floatToRemove)NativeGlobal

Removes all elements from the given array matching the provided value and returns the shortened array.

int[]functionRemoveInt(int[]ArrayValues, intToRemove)NativeGlobal
string[]functionRemoveString(string[]ArrayValues, stringToRemove)NativeGlobal

bool[] function RemoveBool(bool[] ArrayValues, bool ToRemove) global native ; // Bugged - Non-native version available below

Form[]functionRemoveForm(Form[]ArrayValues, FormToRemove)NativeGlobal
Alias[]functionRemoveAlias(Alias[]ArrayValues, AliasToRemove)NativeGlobal
Actor[]functionRemoveActor(Actor[]ArrayValues, ActorToRemove)NativeGlobal
ObjectReference[]functionRemoveObjRef(ObjectReference[]ArrayValues, ObjectReferenceToRemove)NativeGlobal
float[]functionRemoveDupeFloat(float[]ArrayValues)NativeGlobal

Removes all duplicate elements from the given array and returns the shortened array with only a single instance of all element values.

int[]functionRemoveDupeInt(int[]ArrayValues)NativeGlobal
string[]functionRemoveDupeString(string[]ArrayValues)NativeGlobal
Form[]functionRemoveDupeForm(Form[]ArrayValues)NativeGlobal
Alias[]functionRemoveDupeAlias(Alias[]ArrayValues)NativeGlobal
Actor[]functionRemoveDupeActor(Actor[]ArrayValues)NativeGlobal
ObjectReference[]functionRemoveDupeObjRef(ObjectReference[]ArrayValues)NativeGlobal
float[]functionGetDiffFloat(float[]ArrayValues1, float[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal

Get an array of values from ArrayValues1 that ARE NOT among the values of ArrayValues2. Duplicates are removed by default.

Setting CompareBoth = true will change the behavior to also include the reverse comparison of ArrayValues2 values that are not present in ArrayValues1.

Setting IncludeDupes = true will allow the resulting array to include duplicate entries of the same value if they were also duplicated in the input arrays.

int[]functionGetDiffInt(int[]ArrayValues1, int[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
string[]functionGetDiffString(string[]ArrayValues1, string[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
Form[]functionGetDiffForm(Form[]ArrayValues1, Form[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
Alias[]functionGetDiffAlias(Alias[]ArrayValues1, Alias[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
Actor[]functionGetDiffActor(Actor[]ArrayValues1, Actor[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
ObjectReference[]functionGetDiffObjRef(ObjectReference[]ArrayValues1, ObjectReference[]ArrayValues2, boolCompareBoth=false, boolIncludeDupes=false)NativeGlobal
float[]functionGetMatchingFloat(float[]ArrayValues1, float[]ArrayValues2)NativeGlobal

Get an array of values that are present in both ArrayValues1 and ArrayValues2.

int[]functionGetMatchingInt(int[]ArrayValues1, int[]ArrayValues2)NativeGlobal
string[]functionGetMatchingString(string[]ArrayValues1, string[]ArrayValues2)NativeGlobal
Form[]functionGetMatchingForm(Form[]ArrayValues1, Form[]ArrayValues2)NativeGlobal
Alias[]functionGetMatchingAlias(Alias[]ArrayValues1, Alias[]ArrayValues2)NativeGlobal
Actor[]functionGetMatchingActor(Actor[]ArrayValues1, Actor[]ArrayValues2)NativeGlobal
ObjectReference[]functionGetMatchingObjRef(ObjectReference[]ArrayValues1, ObjectReference[]ArrayValues2)NativeGlobal
intfunctionCountFloat(float[]ArrayValues, floatEqualTo)NativeGlobal

Returns the number of instances an array has an element equal to the given value

intfunctionCountInt(int[]ArrayValues, intEqualTo)NativeGlobal
intfunctionCountBool(bool[]ArrayValues, boolEqualTo)NativeGlobal
intfunctionCountString(string[]ArrayValues, stringEqualTo)NativeGlobal
intfunctionCountForm(Form[]ArrayValues, FormEqualTo)NativeGlobal
intfunctionCountAlias(Alias[]ArrayValues, AliasEqualTo)NativeGlobal
intfunctionCountActor(Actor[]ArrayValues, ActorEqualTo)NativeGlobal
intfunctionCountObjRef(ObjectReference[]ArrayValues, ObjectReferenceEqualTo)NativeGlobal
float[]functionMergeFloatArray(float[]ArrayValues1, float[]ArrayValues2, boolRemoveDupes=false)NativeGlobal

Returns two arrays combined into one, optionally also removing any duplicate occurrences of a value.

int[]functionMergeIntArray(int[]ArrayValues1, int[]ArrayValues2, boolRemoveDupes=false)NativeGlobal
string[]functionMergeStringArray(string[]ArrayValues1, string[]ArrayValues2, boolRemoveDupes=false)NativeGlobal

bool[] function MergeBoolArray(bool[] ArrayValues1, bool[] ArrayValues2, bool RemoveDupes = false) global native ; // Bugged - Non-native version available below

Form[]functionMergeFormArray(Form[]ArrayValues1, Form[]ArrayValues2, boolRemoveDupes=false)NativeGlobal
Alias[]functionMergeAliasArray(Alias[]ArrayValues1, Alias[]ArrayValues2, boolRemoveDupes=false)NativeGlobal
Actor[]functionMergeActorArray(Actor[]ArrayValues1, Actor[]ArrayValues2, boolRemoveDupes=false)NativeGlobal
ObjectReference[]functionMergeObjRefArray(ObjectReference[]ArrayValues1, ObjectReference[]ArrayValues2, boolRemoveDupes=false)NativeGlobal
float[]functionSliceFloatArray(float[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal

Returns a sub section of an array indicated by a starting and ending index.

The default argument "int EndIndex = -1" clamps the to the end of the array. Equivalent of setting EndIndex = (ArrayValues.Length - 1)

int[]functionSliceIntArray(int[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal
string[]functionSliceStringArray(string[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal

bool[] function SliceBoolArray(bool[] ArrayValues, int StartIndex, int EndIndex = -1) global native ; // Bugged - Non-native version available below

Form[]functionSliceFormArray(Form[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal
Alias[]functionSliceAliasArray(Alias[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal
Actor[]functionSliceActorArray(Actor[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal
ObjectReference[]functionSliceObjRefArray(ObjectReference[]ArrayValues, intStartIndex, intEndIndex=-1)NativeGlobal
voidfunctionSortIntArray(int[]ArrayValues, booldescending=false)NativeGlobal

Sorts a given array's elements alphanumerically. Sorted in ascending order by default.

voidfunctionSortFloatArray(float[]ArrayValues, booldescending=false)NativeGlobal
voidfunctionSortStringArray(string[]ArrayValues, booldescending=false)NativeGlobal
string[]functionClearEmpty(string[]ArrayValues)Global
Form[]functionClearNone(Form[]ArrayValues)Global
intfunctionCountFalse(bool[]ArrayValues)Global
intfunctionCountTrue(bool[]ArrayValues)Global
intfunctionCountNone(Form[]ArrayValues)Global
string[]functionStringSplit(stringArgString, stringDelimiter="")NativeGlobal

Similar to SKSE's native StringUtil.Split() except results are whitespace trimmed. So comma, separated,list,can, be, spaced,or,not.

stringfunctionStringJoin(string[]Values, stringDelimiter="")NativeGlobal

Opposite of StringSplit()

intfunctionAddIntValues(int[]Values)NativeGlobal

Return the total sum of all values stored in the given array

floatfunctionAddFloatValues(float[]Values)NativeGlobal
intfunctionClampInt(intvalue, intmin, intmax)NativeGlobal

Returns the value clamped to the min or max when out of range

floatfunctionClampFloat(floatvalue, floatmin, floatmax)NativeGlobal
intfunctionWrapInt(intvalue, intend, intstart=0)NativeGlobal

Similar to the clamp functions, only values wrap around to the other side of range instead.

Mostly useful for traversing around array values by wrapping the index from end to end without having to check for it being out of range first.

i.e.: Form var = myFormArray[WrapInt(i, (myFormArray.Length - 1))]

floatfunctionWrapFloat(floatvalue, floatend, floatstart=0.0)NativeGlobal
intfunctionSignInt(booldoSign, intvalue)NativeGlobal

Returns the given value signed if bool is true, unsigned if false, regardless if value started out signed or not.

floatfunctionSignFloat(booldoSign, floatvalue)NativeGlobal
bool[]functionResizeBoolArray(bool[]ArrayValues, inttoSize, boolfiller=false)Global
bool[]functionPushBool(bool[]ArrayValues, boolpush)Global
bool[]functionRemoveBool(bool[]ArrayValues, boolToRemove)Global
bool[]functionMergeBoolArray(bool[]ArrayValues1, bool[]ArrayValues2, boolRemoveDupes=false)Global
bool[]functionSliceBoolArray(bool[]ArrayValues, intStartIndex, intEndIndex=-1)Global
float[]functionFloatArray(intsize, floatfiller=0.0)Global
int[]functionIntArray(intsize, intfiller=0)Global
bool[]functionBoolArray(intsize, boolfiller=false)Global
string[]functionStringArray(intsize, stringfiller="")Global
Form[]functionFormArray(intsize, Formfiller=NONE)Global
Alias[]functionAliasArray(intsize, Aliasfiller=NONE)Global
float[]functionResizeFloatArray(float[]ArrayValues, inttoSize, floatfiller=0.0)Global
int[]functionResizeIntArray(int[]ArrayValues, inttoSize, intfiller=0)Global
string[]functionResizeStringArray(string[]ArrayValues, inttoSize, stringfiller="")Global
Form[]functionResizeFormArray(Form[]ArrayValues, inttoSize, Formfiller=NONE)Global
Alias[]functionResizeAliasArray(Alias[]ArrayValues, inttoSize, Aliasfiller=NONE)Global
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.