Removed unused PapyrusUtil scripts

This commit is contained in:
Eddoursul 2021-12-09 20:40:19 +01:00
parent 6ac30a41f8
commit 10a133a2c3
10 changed files with 0 additions and 1465 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,222 +0,0 @@
scriptname JsonUtil Hidden
;/
MOD AUTHORS, READ!
These functions all work in exactly the same way as their StorageUtil.psc equivalents. See them for usage docs.
The important difference between these functions and the ones on StorageUtil.psc, is that instead of giving "Form obj"
argument for the location to save the data, you give it a "string FileName" argument, pointing to an external JSON formatted file.
These files will be saved/loaded in JSON format, and the starting location for the files to save/load from is as follows:
data/skse/plugins/StorageUtilData/
Some important notes on usage to keep in mind:
- You may specific a folder path in the filename, i.e. "../MyData/config" will save to data/skse/plugins/MyData/config.json
- If not given in the filename argument, the filename will have the extension .json appended to it automatically when used.
- You do not need to call Load() or Save() manually unless you have a specific need to.
- When the player saves their game any modified file will be automatically saved, written to, or created if it does not exist.
- When the player loads another save without saving themselves or the Save() function having been manually called by a script,
the loaded data will be discarded and revert back to whatever the contents of the current saved file are.
/;
bool function Load(string FileName) global native
bool function Save(string FileName, bool minify = false) global native
bool function Unload(string FileName, bool saveChanges = true, bool minify = false) global native
; Check if given file has had any changes to it that haven't yet been saved
bool function IsPendingSave(string FileName) global native
; Check if the given file was succesfully loaded and has no json parser errors
bool function IsGood(string FileName) global native
; Get a formatted error string of any json parser errors on a file, returns as empty string if no errors.
string function GetErrors(string FileName) global native
; Returns a list of all filenames in a given folder that end in .json
string[] function JsonInFolder(string folderPath) global native
; Check if a json file exists or not
bool function JsonExists(string FileName) global
if !FileName
return false
elseIf StringUtil.Find(FileName, ".json") == -1
FileName += ".json"
endIf
return MiscUtil.FileExists("data/skse/plugins/StorageUtilData/"+FileName)
endFunction
; See StorageUtil.psc for equivalent function usage instructions
int function SetIntValue(string FileName, string KeyName, int value) global native
float function SetFloatValue(string FileName, string KeyName, float value) global native
string function SetStringValue(string FileName, string KeyName, string value) global native
form function SetFormValue(string FileName, string KeyName, form value) global native
int function GetIntValue(string FileName, string KeyName, int missing = 0) global native
float function GetFloatValue(string FileName, string KeyName, float missing = 0.0) global native
string function GetStringValue(string FileName, string KeyName, string missing = "") global native
form function GetFormValue(string FileName, string KeyName, form missing = none) global native
bool function UnsetIntValue(string FileName, string KeyName) global native
bool function UnsetFloatValue(string FileName, string KeyName) global native
bool function UnsetStringValue(string FileName, string KeyName) global native
bool function UnsetFormValue(string FileName, string KeyName) global native
bool function HasIntValue(string FileName, string KeyName) global native
bool function HasFloatValue(string FileName, string KeyName) global native
bool function HasStringValue(string FileName, string KeyName) global native
bool function HasFormValue(string FileName, string KeyName) global native
int function IntListAdd(string FileName, string KeyName, int value, bool allowDuplicate = true) global native
int function FloatListAdd(string FileName, string KeyName, float value, bool allowDuplicate = true) global native
int function StringListAdd(string FileName, string KeyName, String value, bool allowDuplicate = true) global native
int function FormListAdd(string FileName, string KeyName, Form value, bool allowDuplicate = true) global native
Int function IntListGet(string FileName, string KeyName, int index) global native
Float function FloatListGet(string FileName, string KeyName, int index) global native
String function StringListGet(string FileName, string KeyName, int index) global native
Form function FormListGet(string FileName, string KeyName, int index) global native
Int function IntListSet(string FileName, string KeyName, int index, int value) global native
Float function FloatListSet(string FileName, string KeyName, int index, float value) global native
String function StringListSet(string FileName, string KeyName, int index, String value) global native
Form function FormListSet(string FileName, string KeyName, int index, Form value) global native
int function IntListRemove(string FileName, string KeyName, int value, bool allInstances = true) global native
int function FloatListRemove(string FileName, string KeyName, float value, bool allInstances = true) global native
int function StringListRemove(string FileName, string KeyName, String value, bool allInstances = true) global native
int function FormListRemove(string FileName, string KeyName, Form value, bool allInstances = true) global native
bool function IntListInsertAt(string FileName, string KeyName, int index, int value) global native
bool function FloatListInsertAt(string FileName, string KeyName, int index, float value) global native
bool function StringListInsertAt(string FileName, string KeyName, int index, String value) global native
bool function FormListInsertAt(string FileName, string KeyName, int index, Form value) global native
bool function IntListRemoveAt(string FileName, string KeyName, int index) global native
bool function FloatListRemoveAt(string FileName, string KeyName, int index) global native
bool function StringListRemoveAt(string FileName, string KeyName, int index) global native
bool function FormListRemoveAt(string FileName, string KeyName, int index) global native
int function IntListClear(string FileName, string KeyName) global native
int function FloatListClear(string FileName, string KeyName) global native
int function StringListClear(string FileName, string KeyName) global native
int function FormListClear(string FileName, string KeyName) global native
int function IntListCount(string FileName, string KeyName) global native
int function FloatListCount(string FileName, string KeyName) global native
int function StringListCount(string FileName, string KeyName) global native
int function FormListCount(string FileName, string KeyName) global native
int function IntListCountValue(string FileName, string KeyName, int value, bool exclude = false) global native
int function FloatListCountValue(string FileName, string KeyName, float value, bool exclude = false) global native
int function StringListCountValue(string FileName, string KeyName, String value, bool exclude = false) global native
int function FormListCountValue(string FileName, string KeyName, Form value, bool exclude = false) global native
int function IntListFind(string FileName, string KeyName, int value) global native
int function FloatListFind(string FileName, string KeyName, float value) global native
int function StringListFind(string FileName, string KeyName, String value) global native
int function FormListFind(string FileName, string KeyName, Form value) global native
bool function IntListHas(string FileName, string KeyName, int value) global native
bool function FloatListHas(string FileName, string KeyName, float value) global native
bool function StringListHas(string FileName, string KeyName, String value) global native
bool function FormListHas(string FileName, string KeyName, Form value) global native
function IntListSlice(string FileName, string KeyName, int[] slice, int startIndex = 0) global native
function FloatListSlice(string FileName, string KeyName, float[] slice, int startIndex = 0) global native
function StringListSlice(string FileName, string KeyName, string[] slice, int startIndex = 0) global native
function FormListSlice(string FileName, string KeyName, Form[] slice, int startIndex = 0) global native
int function IntListResize(string FileName, string KeyName, int toLength, int filler = 0) global native
int function FloatListResize(string FileName, string KeyName, int toLength, float filler = 0.0) global native
int function StringListResize(string FileName, string KeyName, int toLength, string filler = "") global native
int function FormListResize(string FileName, string KeyName, int toLength, Form filler = none) global native
bool function IntListCopy(string FileName, string KeyName, int[] copy) global native
bool function FloatListCopy(string FileName, string KeyName, float[] copy) global native
bool function StringListCopy(string FileName, string KeyName, string[] copy) global native
bool function FormListCopy(string FileName, string KeyName, Form[] copy) global native
int[] function IntListToArray(string FileName, string KeyName) global native
float[] function FloatListToArray(string FileName, string KeyName) global native
string[] function StringListToArray(string FileName, string KeyName) global native
Form[] function FormListToArray(string FileName, string KeyName) global native
int function AdjustIntValue(string FileName, string KeyName, int amount) global native
float function AdjustFloatValue(string FileName, string KeyName, float amount) global native
Int function IntListAdjust(string FileName, string KeyName, int index, Int amount) global native
float function FloatListAdjust(string FileName, string KeyName, int index, float amount) global native
int function CountIntValuePrefix(string FileName, string PrefixKey) global native
int function CountFloatValuePrefix(string FileName, string PrefixKey) global native
int function CountStringValuePrefix(string FileName, string PrefixKey) global native
int function CountFormValuePrefix(string FileName, string PrefixKey) global native
int function CountIntListPrefix(string FileName, string PrefixKey) global native
int function CountFloatListPrefix(string FileName, string PrefixKey) global native
int function CountStringListPrefix(string FileName, string PrefixKey) global native
int function CountFormListPrefix(string FileName, string PrefixKey) global native
int function CountAllPrefix(string FileName, string PrefixKey) global native
; Experimental custom json formatting handlers. Paths are resolved using typical json syntax.
; The path will be created as necessary when setting data and the path does not yet exists.
; examples:
; JSON File: { "foo": { "bar": [3, 10, 7] } }
; Function: GetPathIntValue("filename.json", ".foo.bar[1]")
; Return: 10
function SetPathIntValue(string FileName, string Path, int value) global native
function SetPathFloatValue(string FileName, string Path, float value) global native
function SetPathStringValue(string FileName, string Path, string value) global native
function SetPathFormValue(string FileName, string Path, form value) global native
bool function SetRawPathValue(string FileName, string Path, string RawJSON) global native
int function GetPathIntValue(string FileName, string Path, int missing = 0) global native
float function GetPathFloatValue(string FileName, string Path, float missing = 0.0) global native
string function GetPathStringValue(string FileName, string Path, string missing = "") global native
form function GetPathFormValue(string FileName, string Path, form missing = none) global native
bool function GetPathBoolValue(string FileName, string Path, bool missing = false) global
return GetPathIntValue(FileName, Path, (missing as int)) != 0
endFunction
int[] function PathIntElements(string FileName, string Path, int invalidType = 0) global native
float[] function PathFloatElements(string FileName, string Path, float invalidType = 0.0) global native
string[] function PathStringElements(string FileName, string Path, string invalidType = "") global native
form[] function PathFormElements(string FileName, string Path, form invalidType = none) global native
int function FindPathIntElement(string FileName, string Path, int toFind) global native
int function FindPathFloatElement(string FileName, string Path, float toFind) global native
int function FindPathStringElement(string FileName, string Path, string toFind) global native
int function FindPathFormElement(string FileName, string Path, form toFind) global native
int function PathCount(string FileName, string Path) global native
string[] function PathMembers(string FileName, string Path) global native
bool function CanResolvePath(string FileName, string Path) global native
bool function IsPathString(string FileName, string Path) global native
bool function IsPathNumber(string FileName, string Path) global native
bool function IsPathForm(string FileName, string Path) global native
bool function IsPathBool(string FileName, string Path) global native
bool function IsPathArray(string FileName, string Path) global native
bool function IsPathObject(string FileName, string Path) global native
function SetPathIntArray(string FileName, string Path, int[] arr, bool append = false) global native
function SetPathFloatArray(string FileName, string Path, float[] arr, bool append = false) global native
function SetPathStringArray(string FileName, string Path, string[] arr, bool append = false) global native
function SetPathFormArray(string FileName, string Path, form[] arr, bool append = false) global native
function ClearPath(string FileName, string Path) global native
; Debug use
function ClearAll(string FileName) global native

View File

@ -1,93 +0,0 @@
scriptname MiscUtil Hidden
;/
Cell scanning functions
/;
; Scans the current cell of the given CenterOn for an object of the given form type ID within radius and returns an array for all that
; and (optionally) also has the given keyword if changed from default none. Setting radius to 0.0 will return all matches in cell.
; NOTE: This function is fairly untested beyond simply checking if it works as expected.
ObjectReference[] function ScanCellObjects(int formType, ObjectReference CenterOn, float radius = 5000.0, Keyword HasKeyword = none) global native
; Scans the current cell of the given CenterOn for an actor within the given radius and returns an array for all actors that are
; currently alive and (optionally) has the given keyword if changed from default none. Setting radius to 0.0 will return all in cell.
; NOTE: This function is fairly untested beyond simply checking if it works as expected.
Actor[] function ScanCellNPCs(ObjectReference CenterOn, float radius = 5000.0, Keyword HasKeyword = none, bool IgnoreDead = true) global native
; Same as ScanCellNPCs(), however it filters the return by a given faction and (optionally) their rank in that faction.
Actor[] function ScanCellNPCsByFaction(Faction FindFaction, ObjectReference CenterOn, float radius = 5000.0, int minRank = 0, int maxRank = 127, bool IgnoreDead = true) global native
;/
Camera functions
/;
; Toggle freefly camera.
function ToggleFreeCamera(bool stopTime = false) global native
; Set freefly cam speed.
function SetFreeCameraSpeed(float speed) global native
; Set current freefly cam state & set the speed if enabling
function SetFreeCameraState(bool enable, float speed = 10.0) global native
;/
File related functions
/;
; Get an array of files in a given parent directory that have the given extension.
; directory is relative to the root Skyrim folder (where skyrim.exe is) and is non-recursive.
; extension=".nif" to get all .nif mesh files.
; (default) extension="*" to get all files
string[] function FilesInFolder(string directory, string extension="*") global native
; Check if a given file exists relative to root Skyrim directory. Example: FileExists("data/meshes/example.nif")
bool function FileExists(string fileName) global native
; Read string from file. Do not read large files!
string function ReadFromFile(string fileName) global native
; Write string to file.
bool function WriteToFile(string fileName, string text, bool append = true, bool timestamp = false) global native
;/
Misc
/;
; Print text to console.
function PrintConsole(string text) global native
; Get race's editor ID.
string function GetRaceEditorID(Race raceForm) global native
; Get race's editor ID.
string function GetActorRaceEditorID(Actor actorRef) global native
; Set HUD on / off
function SetMenus(bool enabled) global native
; Get node rotation
; REMOVED v2.9: Useless, only does a part of the job.
; float function GetNodeRotation(ObjectReference obj, string nodeName, bool firstPerson, int rotationIndex) global native
float function GetNodeRotation(ObjectReference obj, string nodeName, bool firstPerson, int rotationIndex) global
Debug.TraceStack("MiscUtil.GetNodeRotation("+obj+", "+nodeName+") - REMOVED FUNCTION")
return 0.0
endFunction
; Bat console command.
; REMOVED v2.9: Unused.
; function ExecuteBat(string fileName) global native
function ExecuteBat(string fileName) global
Debug.TraceStack("MiscUtil.ExecuteBat("+fileName+") - REMOVED FUNCTION")
endFunction
; LEGACY v3.3 - Added Ignoredead parameter to function, aliased for backwards compatability with v3.2.
Actor[] function ScanCellActors(ObjectReference CenterOn, float radius = 5000.0, Keyword HasKeyword = none) global
return ScanCellNPCs(CenterOn, radius, HasKeyword, true)
endFunction

View File

@ -1,36 +0,0 @@
scriptname ObjectUtil Hidden
;/
Animation override.
Here you can replace animations on objects by animation event name.
Idle Property laughIdle Auto ; "IdleLaugh" here from CK
SetReplaceAnimation(akTarget, "moveStart", laughIdle)
No whenever this character tries to move they start laughing instead.
Animation replace is checked once, that means if you replace moveStart with
IdleLaugh and IdleLaugh with idleEatingStandingStart then whenever you try to
move you start laughing and not eating.
This replacement persists through save games.
/;
; Replace animation on object by animation event name. If obj is none then it will replace globally, be careful with this!
function SetReplaceAnimation(ObjectReference obj, string oldAnimEvent, Idle newAnim) global native
; Remove a previously set animation replacement.
bool function RemoveReplaceAnimation(ObjectReference obj, string oldAnimEvent) global native
; Count how many animation replacements have been set on object.
int function CountReplaceAnimation(ObjectReference obj) global native
; Clear all animation replacements on object.
int function ClearReplaceAnimation(ObjectReference obj) global native
; Get animation event that is replaced on an object by index (use count function to iterate).
string function GetKeyReplaceAnimation(ObjectReference obj, int index) global native
; Get animation that is replacing previous animation on an object.
Idle function GetValueReplaceAnimation(ObjectReference obj, string oldAnim) global native

View File

@ -1,257 +0,0 @@
scriptname PapyrusUtil Hidden
; Get version of papyrus DLL library. Version 3.3 will return 33.
int function GetVersion() global native
; Get version of compiled papyrus scripts which should match return from GetVersion()
int function GetScriptVersion() global
return 33
endFunction
; ##
; ## Array manipulation utilities
; ##
; Few extra array types not provided by SKSE normally to help avoid having to use and cast Form arrays
Actor[] function ActorArray(int size, Actor filler = none) global native
Actor[] function ResizeActorArray(Actor[] ArrayValues, int toSize, Actor filler = none) global native
ObjectReference[] function ObjRefArray(int size, ObjectReference filler = none) global native
ObjectReference[] function ResizeObjRefArray(ObjectReference[] ArrayValues, int toSize, ObjectReference filler = none) global native
; ## 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.
float[] function PushFloat(float[] ArrayValues, float push) global native
int[] function PushInt(int[] ArrayValues, int push) global native
; bool[] function PushBool(bool[] ArrayValues, bool push) global native ; // Bugged - Non-native version available below
string[] function PushString(string[] ArrayValues, string push) global native
Form[] function PushForm(Form[] ArrayValues, Form push) global native
Alias[] function PushAlias(Alias[] ArrayValues, Alias push) global native
Actor[] function PushActor(Actor[] ArrayValues, Actor push) global native
ObjectReference[] function PushObjRef(ObjectReference[] ArrayValues, ObjectReference push) global native
; ## Removes all elements from the given array matching the provided value and returns the shortened array.
float[] function RemoveFloat(float[] ArrayValues, float ToRemove) global native
int[] function RemoveInt(int[] ArrayValues, int ToRemove) global native
; bool[] function RemoveBool(bool[] ArrayValues, bool ToRemove) global native ; // Bugged - Non-native version available below
string[] function RemoveString(string[] ArrayValues, string ToRemove) global native
Form[] function RemoveForm(Form[] ArrayValues, Form ToRemove) global native
Alias[] function RemoveAlias(Alias[] ArrayValues, Alias ToRemove) global native
Actor[] function RemoveActor(Actor[] ArrayValues, Actor ToRemove) global native
ObjectReference[] function RemoveObjRef(ObjectReference[] ArrayValues, ObjectReference ToRemove) global native
; ## Returns the number of instances an array has an element equal to the given value
int function CountFloat(float[] ArrayValues, float EqualTo) global native
int function CountInt(int[] ArrayValues, int EqualTo) global native
int function CountBool(bool[] ArrayValues, bool EqualTo) global native
int function CountString(string[] ArrayValues, string EqualTo) global native
int function CountForm(Form[] ArrayValues, Form EqualTo) global native
int function CountAlias(Alias[] ArrayValues, Alias EqualTo) global native
int function CountActor(Actor[] ArrayValues, Actor EqualTo) global native
int function CountObjRef(ObjectReference[] ArrayValues, ObjectReference EqualTo) global native
; ## Returns two arrays combined into one, optionally also removing any duplicate occurrences of a value.
float[] function MergeFloatArray(float[] ArrayValues1, float[] ArrayValues2, bool RemoveDupes = false) global native
int[] function MergeIntArray(int[] ArrayValues1, int[] ArrayValues2, bool RemoveDupes = false) global native
; bool[] function MergeBoolArray(bool[] ArrayValues1, bool[] ArrayValues2, bool RemoveDupes = false) global native ; // Bugged - Non-native version available below
string[] function MergeStringArray(string[] ArrayValues1, string[] ArrayValues2, bool RemoveDupes = false) global native
Form[] function MergeFormArray(Form[] ArrayValues1, Form[] ArrayValues2, bool RemoveDupes = false) global native
Alias[] function MergeAliasArray(Alias[] ArrayValues1, Alias[] ArrayValues2, bool RemoveDupes = false) global native
Actor[] function MergeActorArray(Actor[] ArrayValues1, Actor[] ArrayValues2, bool RemoveDupes = false) global native
ObjectReference[] function MergeObjRefArray(ObjectReference[] ArrayValues1, ObjectReference[] ArrayValues2, bool RemoveDupes = false) global native
; ## 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)
float[] function SliceFloatArray(float[] ArrayValues, int StartIndex, int EndIndex = -1) global native
int[] function SliceIntArray(int[] ArrayValues, int StartIndex, int EndIndex = -1) global native
; bool[] function SliceBoolArray(bool[] ArrayValues, int StartIndex, int EndIndex = -1) global native ; // Bugged - Non-native version available below
string[] function SliceStringArray(string[] ArrayValues, int StartIndex, int EndIndex = -1) global native
Form[] function SliceFormArray(Form[] ArrayValues, int StartIndex, int EndIndex = -1) global native
Alias[] function SliceAliasArray(Alias[] ArrayValues, int StartIndex, int EndIndex = -1) global native
Actor[] function SliceActorArray(Actor[] ArrayValues, int StartIndex, int EndIndex = -1) global native
ObjectReference[] function SliceObjRefArray(ObjectReference[] ArrayValues, int StartIndex, int EndIndex = -1) global native
function SortIntArray(int[] ArrayValues, bool descending = false) global native
function SortFloatArray(float[] ArrayValues, bool descending = false) global native
function SortStringArray(string[] ArrayValues, bool descending = false) global native
; ##
; ## Shortcuts for common usage
; ##
string[] function ClearEmpty(string[] ArrayValues) global
return RemoveString(ArrayValues, "")
endFunction
Form[] function ClearNone(Form[] ArrayValues) global
return RemoveForm(ArrayValues, none)
endFunction
int function CountFalse(bool[] ArrayValues) global
return CountBool(ArrayValues, false)
endFunction
int function CountTrue(bool[] ArrayValues) global
return CountBool(ArrayValues, true)
endFunction
int function CountNone(Form[] ArrayValues) global
return CountForm(ArrayValues, none)
endFunction
; ##
; ## Extra String Utilities
; ##
; ## Similar to SKSE's native StringUtil.Split() except results are whitespace trimmed. So comma, separated,list,can, be, spaced,or,not.
string[] function StringSplit(string ArgString, string Delimiter = ",") global native
; ## Opposite of StringSplit()
string function StringJoin(string[] Values, string Delimiter = ",") global native
; ##
; ## Shortcuts for some common number actions. Mostly to help cut some basic and overly verbose checks down to a single line.
; ## Making these native instead of normal globals is probably massive overkill...
; ##
; ## Return the total sum of all values stored in the given array
int function AddIntValues(int[] Values) global native
float function AddFloatValues(float[] Values) global native
; ## Returns the value clamped to the min or max when out of range
int function ClampInt(int value, int min, int max) global native
float function ClampFloat(float value, float min, float max) global native
; ## 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))]
int function WrapInt(int value, int end, int start = 0) global native
float function WrapFloat(float value, float end, float start = 0.0) global native
; ## Returns the given value signed if bool is true, unsigned if false, regardless if value started out signed or not.
int function SignInt(bool doSign, int value) global native
float function SignFloat(bool doSign, float value) global native
; ##
; ## Non-Native bool versions of some functions where SKSE version is bugged.
; ## SKSE version VMResultArray<bool> fails to be manipulated by other native functions past creation.
; ##
bool[] function ResizeBoolArray(bool[] ArrayValues, int toSize, bool filler = false) global
bool[] Output = Utility.CreateBoolArray(toSize, filler)
int i = ArrayValues.Length
if i > toSize
i = toSize
endIf
while i
i -= 1
Output[i] = ArrayValues[i]
endWhile
return Output
endFunction
bool[] function PushBool(bool[] ArrayValues, bool push) global
return ResizeBoolArray(ArrayValues, ArrayValues.Length + 1, push)
endFunction
bool[] function RemoveBool(bool[] ArrayValues, bool ToRemove) global
int count = CountBool(ArrayValues, ToRemove)
return Utility.CreateBoolArray((ArrayValues.Length - Count), !ToRemove)
endFunction
bool[] function MergeBoolArray(bool[] ArrayValues1, bool[] ArrayValues2, bool RemoveDupes = false) global
if !ArrayValues1 && !ArrayValues2
return Utility.CreateBoolArray(0)
elseIf RemoveDupes
; Don't know why this option would ever be used for bool arrays, but provided for consistency sake with others
bool[] Output = new bool[1]
Output[0] = (ArrayValues1 && ArrayValues1[0]) || (!ArrayValues1 && ArrayValues2 && ArrayValues2[0])
if (ArrayValues1 && ArrayValues1.Find(!Output[0]) != -1) || (ArrayValues2 && ArrayValues2.Find(!Output[0]) != -1)
Output = PushBool(Output, !Output[0])
endIf
return Output
elseIf !ArrayValues1
return ArrayValues2
elseIf !ArrayValues2
return ArrayValues1
endIf
bool[] Output = Utility.CreateBoolArray(ArrayValues1.Length + ArrayValues2.Length)
bool[] Source = ArrayValues2
int n = Source.Length
int i = Output.Length
while i
i -= 1
n -= 1
if n < 0 && i > 0
Source = ArrayValues1
n = ArrayValues1.Length - 1
endIf
Output[i] = Source[n]
endWhile
return Output
endFunction
bool[] function SliceBoolArray(bool[] ArrayValues, int StartIndex, int EndIndex = -1) global
if !ArrayValues || (StartIndex > EndIndex && EndIndex > -1)
return Utility.CreateBoolArray(0)
elseIf StartIndex <= 0 && (EndIndex == -1 || EndIndex >= ArrayValues.Length)
return ArrayValues
endIf
if StartIndex < 0
StartIndex = 0
endIf
if EndIndex < 0 || EndIndex >= ArrayValues.Length
EndIndex = ArrayValues.Length - 1
endIf
if StartIndex == EndIndex
return Utility.CreateBoolArray(1, ArrayValues[StartIndex])
endIf
EndIndex += 1
bool[] Output = Utility.CreateBoolArray(EndIndex - StartIndex)
int i = Output.Length
while i && EndIndex
i -= 1
EndIndex -= 1
Output[i] = ArrayValues[EndIndex]
endWhile
return Output
endFunction
; ##
; ## DEPRECATED: SKSE now provides their own variable sized arrays for these types - mirrored here for backwards compatibility.
; ##
float[] function FloatArray(int size, float filler = 0.0) global
return Utility.CreateFloatArray(size, filler)
endFunction
int[] function IntArray(int size, int filler = 0) global
return Utility.CreateIntArray(size, filler)
endFunction
bool[] function BoolArray(int size, bool filler = false) global
return Utility.CreateBoolArray(size, filler)
endFunction
string[] function StringArray(int size, string filler = "") global
return Utility.CreateStringArray(size, filler)
endFunction
Form[] function FormArray(int size, Form filler = none) global
return Utility.CreateFormArray(size, filler)
endFunction
Alias[] function AliasArray(int size, Alias filler = none) global
return Utility.CreateAliasArray(size, filler)
endFunction
float[] function ResizeFloatArray(float[] ArrayValues, int toSize, float filler = 0.0) global
return Utility.ResizeFloatArray(ArrayValues, toSize, filler)
endFunction
int[] function ResizeIntArray(int[] ArrayValues, int toSize, int filler = 0) global
return Utility.ResizeIntArray(ArrayValues, toSize, filler)
endFunction
string[] function ResizeStringArray(string[] ArrayValues, int toSize, string filler = "") global
return Utility.ResizeStringArray(ArrayValues, toSize, filler)
endFunction
Form[] function ResizeFormArray(Form[] ArrayValues, int toSize, Form filler = none) global
return Utility.ResizeFormArray(ArrayValues, toSize, filler)
endFunction
Alias[] function ResizeAliasArray(Alias[] ArrayValues, int toSize, Alias filler = none) global
return Utility.ResizeAliasArray(ArrayValues, toSize, filler)
endFunction

View File

@ -1,857 +0,0 @@
scriptname StorageUtil Hidden
;/
MOD AUTHORS, READ!
This script contains functions for saving and loading any amount of int, float, form and string values
by name on a form or globally. These values can be accessed and changed from any mod which allows
mods to become compatible with each other without adding any requirements to the other mod or its version
other than this plugin.
Values will stay on forms or globally until they are Unset or Cleared in case of lists. If value
is set on a form and the object is deleted then value will be removed when saving game.
If you are done with using a certain variable you should use Unset or Clear function to remove them
but it is not required.
Saving MCM config values here would allow other mods to change your mod settings which may
be useful. It should also allow you to change MCM config script without worrying about versioning
since there are no new variables in the script itself.
Functions that start with File in the name will save values to a separate file, so that you can
access the same values from all savegames. This may be useful for configuration settings.
Saved values take very little memory - expect to use less than 500 KB of physical memory even when
setting thousands of values.
Value names are not case sensitive, that means GetIntValue(none, "abc") == GetIntValue(none, "aBC").
All values are separated from each other by type! That means SetIntValue(none, "abc", 1) and
SetFloatValue(none, "abc", 2.0) create separate entries and aren't affected by each other.
StorageUtil.SetIntValue(none, "myValue", 1)
StorageUtil.SetFloatValue(none, "myValue", 5.0)
int value = StorageUtil.GetIntValue(none, "myValue")
value == 1 ; true
value == 5 ; false
When choosing names for variables try to remember that all mods access the same storage, so if you
create a variable with name "Name" then many other mods could use the same variable but in different
ways that lead to unwanted behavior. It is recommended to prefix the variable with your mod name,
that way you can be sure nobody else will try to use the same variable in their mod. For example
realistic needs and diseases might set hunger as "rnd_hungervalue".
You can also use this storage to make your mod functions available to other mods, for example if
your mod has a function that sets an Actor to be invisible you could add a script that checks:
int i = StorageUtil.FormListCount(none, "MakeInvisible")
while(i > 0)
i--
Actor make = StorageUtil.FormListGet(none, "MakeInvisible", i) as Actor
if(make)
MyScriptFunction(make)
endif
StorageUtil.FormListRemoveAt(none, "MakeInvisible", i)
endwhile
And the other mod could write:
StorageUtil.FormListAdd(none, "MakeInvisible", myActor)
to make someone invisible using your mod. But if your mod isn't present then nothing happens.
This is just an example, I'm sure you can find better ways to implement compatibility, it would
help to include a documentation for other modders if you do.
;/
;/
Storage functions - values in save game file.
/;
;/ Set int/float/string/Form value globally or on any form by name and return
the value passed, or as uninitialized variable if invalid keys given.
ObjKey: form to save on. Set none to save globally.
KeyName: name of value.
value: value to set to the given keys. If zero, empty, or none are given, the key will be unset.
/;
int function SetIntValue(Form ObjKey, string KeyName, int value) global native
float function SetFloatValue(Form ObjKey, string KeyName, float value) global native
string function SetStringValue(Form ObjKey, string KeyName, string value) global native
Form function SetFormValue(Form ObjKey, string KeyName, Form value) global native
;/ Remove a previously set int/float/string/Form value on an form or globally and
return if successful. This will return false if value didn't exist.
ObjKey: form to remove from. Set none to remove global value.
KeyName: name of value.
/;
bool function UnsetIntValue(Form ObjKey, string KeyName) global native;
bool function UnsetFloatValue(Form ObjKey, string KeyName) global native
bool function UnsetStringValue(Form ObjKey, string KeyName) global native
bool function UnsetFormValue(Form ObjKey, string KeyName) global native
;/ Check if int/float/string/Form value has been set on form or globally.
ObjKey: form to check on. Set none to check global value.
KeyName: name of value.
/;
bool function HasIntValue(Form ObjKey, string KeyName) global native
bool function HasFloatValue(Form ObjKey, string KeyName) global native
bool function HasStringValue(Form ObjKey, string KeyName) global native
bool function HasFormValue(Form ObjKey, string KeyName) global native
;/ Get previously saved int/float/string/Form value on form or globally.
ObjKey: form to get from. Set none to get global value.
KeyName: name of value.
[optional] missing: if value has not been set, return this value instead.
/;
int function GetIntValue(Form ObjKey, string KeyName, int missing = 0) global native
float function GetFloatValue(Form ObjKey, string KeyName, float missing = 0.0) global native
string function GetStringValue(Form ObjKey, string KeyName, string missing = "") global native
Form function GetFormValue(Form ObjKey, string KeyName, Form missing = none) global native
;/ Plucks a previously saved int/float/string/Form value on form or globally.
Returning the value stored, then removing it from storage.
ObjKey: form to pluck from. Set none to get global value.
KeyName: name of value.
[optional] missing: if value has not been set, return this value instead.
/;
int function PluckIntValue(Form ObjKey, string KeyName, int missing = 0) global native
float function PluckFloatValue(Form ObjKey, string KeyName, float missing = 0.0) global native
string function PluckStringValue(Form ObjKey, string KeyName, string missing = "") global native
Form function PluckFormValue(Form ObjKey, string KeyName, Form missing = none) global native
;/ Get previously saved int/float/string/Form value on form or globally.
ObjKey: form to get from. Set none to get global value.
KeyName: name of value.
amount: +/- the amount to adjust the current value by
given keys will be initialized to given amount if it does not exist
/;
int function AdjustIntValue(Form ObjKey, string KeyName, int amount) global native
float function AdjustFloatValue(Form ObjKey, string KeyName, float amount) global native
;/ Add an int/float/string/Form to a list on form or globally and return
the value's new index. Index can be -1 if we were unable to add
the value.
ObjKey: form to add to. Set none to add global value.
KeyName: name of value.
value: value to add.
[optional] allowDuplicate: allow adding value to list if this value already exists in the list.
/;
int function IntListAdd(Form ObjKey, string KeyName, int value, bool allowDuplicate = true) global native
int function FloatListAdd(Form ObjKey, string KeyName, float value, bool allowDuplicate = true) global native
int function StringListAdd(Form ObjKey, string KeyName, string value, bool allowDuplicate = true) global native
int function FormListAdd(Form ObjKey, string KeyName, Form value, bool allowDuplicate = true) global native
;/ Get a value from list by index on form or globally.
This will return 0 as value if there was a problem.
ObjKey: form to get value on. Set none to get global list value.
KeyName: name of list.
index: index of value in the list.
/;
int function IntListGet(Form ObjKey, string KeyName, int index) global native
float function FloatListGet(Form ObjKey, string KeyName, int index) global native
string function StringListGet(Form ObjKey, string KeyName, int index) global native
Form function FormListGet(Form ObjKey, string KeyName, int index) global native
;/ Set a value in list by index on form or globally.
This will return the previous value or 0 if there was a problem.
ObjKey: form to set value on. Set none to set global list value.
KeyName: name of list.
index: index of value in the list.
value: value to set to.
/;
int function IntListSet(Form ObjKey, string KeyName, int index, int value) global native
float function FloatListSet(Form ObjKey, string KeyName, int index, float value) global native
string function StringListSet(Form ObjKey, string KeyName, int index, string value) global native
Form function FormListSet(Form ObjKey, string KeyName, int index, Form value) global native
;/ Plucks a value from list by index on form or globally.
The index is removed from the list's storage after returning it's value.
ObjKey: form to pluck value from. Set none to get global list value.
KeyName: name of list.
index: index of value in the list.
[optional] missing: if index has not been set, return this value instead.
/;
int function IntListPluck(Form ObjKey, string KeyName, int index, int missing) global native
float function FloatListPluck(Form ObjKey, string KeyName, int index, float missing) global native
string function StringListPluck(Form ObjKey, string KeyName, int index, string missing) global native
Form function FormListPluck(Form ObjKey, string KeyName, int index, Form missing) global native
;/ Gets the value of the very first element in a list, and subsequently removes the index afterward.
ObjKey: form to shift value from. Set none to get global list value.
KeyName: name of list to shift it's first value from.
/;
int function IntListShift(Form ObjKey, string KeyName) global native
float function FloatListShift(Form ObjKey, string KeyName) global native
string function StringListShift(Form ObjKey, string KeyName) global native
Form function FormListShift(Form ObjKey, string KeyName) global native
;/ Gets the value of the very last element in a list, and subsequently removes the index afterward.
ObjKey: form to pop value from. Set none to get global list value.
KeyName: name of list to pop off it's last value.
/;
int function IntListPop(Form ObjKey, string KeyName) global native
float function FloatListPop(Form ObjKey, string KeyName) global native
string function StringListPop(Form ObjKey, string KeyName) global native
Form function FormListPop(Form ObjKey, string KeyName) global native
;/ Adjust the existing value of a list by the given amount.
ObjKey: form to set value on. Set none to set global list value.
KeyName: name of list.
index: index of value in the list.
amount: +/- the amount to adjust the lists current index value by.
returns 0 if index does not exists
/;
int function IntListAdjust(Form ObjKey, string KeyName, int index, int amount) global native
float function FloatListAdjust(Form ObjKey, string KeyName, int index, float amount) global native
;/ Insert an int/float/string/Form to a list on form or globally and return
if successful.
ObjKey: form to add to. Set none to add global value.
KeyName: name of value.
index: position in list to put the value. 0 is first entry in list.
value: value to add.
/;
bool function IntListInsert(Form ObjKey, string KeyName, int index, int value) global native
bool function FloatListInsert(Form ObjKey, string KeyName, int index, float value) global native
bool function StringListInsert(Form ObjKey, string KeyName, int index, string value) global native
bool function FormListInsert(Form ObjKey, string KeyName, int index, Form value) global native
;/ Remove a previously added int/float/string/Form value from a list on form
or globally and return how many instances of this value were removed.
ObjKey: form to remove from. Set none to remove global value.
KeyName: name of value.
value: value to remove.
[optional] allowInstances: remove all instances of this value in a list.
/;
int function IntListRemove(Form ObjKey, string KeyName, int value, bool allInstances = false) global native
int function FloatListRemove(Form ObjKey, string KeyName, float value, bool allInstances = false) global native
int function StringListRemove(Form ObjKey, string KeyName, string value, bool allInstances = false) global native
int function FormListRemove(Form ObjKey, string KeyName, Form value, bool allInstances = false) global native
;/ Clear a list of values (unset) on an form or globally and
return the previous size of list.
ObjKey: form to clear on. Set none to clear global list.
KeyName: name of list.
/;
int function IntListClear(Form ObjKey, string KeyName) global native
int function FloatListClear(Form ObjKey, string KeyName) global native
int function StringListClear(Form ObjKey, string KeyName) global native
int function FormListClear(Form ObjKey, string KeyName) global native
;/ Remove a value from list by index on form or globally and
return if we were successful in doing so.
ObjKey: form to remove from. Set none to remove global value.
KeyName: name of list.
index: index of value in the list.
/;
bool function IntListRemoveAt(Form ObjKey, string KeyName, int index) global native
bool function FloatListRemoveAt(Form ObjKey, string KeyName, int index) global native
bool function StringListRemoveAt(Form ObjKey, string KeyName, int index) global native
bool function FormListRemoveAt(Form ObjKey, string KeyName, int index) global native
;/ Get size of a list on form or globally.
ObjKey: form to check on. Set none to check global list.
KeyName: name of list.
/;
int function IntListCount(Form ObjKey, string KeyName) global native
int function FloatListCount(Form ObjKey, string KeyName) global native
int function StringListCount(Form ObjKey, string KeyName) global native
int function FormListCount(Form ObjKey, string KeyName) global native
;/ Get the number of occurrences of a specific value within a list.
ObjKey: form to check on. Set none to check global list.
KeyName: name of list.
value: value to look for.
[optional] exclude: if true, function will return number of elements NOT equal to value.
/;
int function IntListCountValue(Form ObjKey, string KeyName, int value, bool exclude = false) global native
int function FloatListCountValue(Form ObjKey, string KeyName, float value, bool exclude = false) global native
int function StringListCountValue(Form ObjKey, string KeyName, string value, bool exclude = false) global native
int function FormListCountValue(Form ObjKey, string KeyName, Form value, bool exclude = false) global native
;/ Find a value in list on form or globally and return its
index or -1 if value was not found.
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
value: value to search.
/;
int function IntListFind(Form ObjKey, string KeyName, int value) global native
int function FloatListFind(Form ObjKey, string KeyName, float value) global native
int function StringListFind(Form ObjKey, string KeyName, string value) global native
int function FormListFind(Form ObjKey, string KeyName, Form value) global native
;/ Find if a value in list on form or globally exists, true if it exists,
false if it doesn't.
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
value: value to search.
/;
bool function IntListHas(Form ObjKey, string KeyName, int value) global native
bool function FloatListHas(Form ObjKey, string KeyName, float value) global native
bool function StringListHas(Form ObjKey, string KeyName, string value) global native
bool function FormListHas(Form ObjKey, string KeyName, Form value) global native
;/ Sort an int/float/string/Form list by values in ascending order.
ObjKey: form to sort on. Set none for global value.
KeyName: name of value.
/;
function IntListSort(Form ObjKey, string KeyName) global native
function FloatListSort(Form ObjKey, string KeyName) global native
function StringListSort(Form ObjKey, string KeyName) global native
function FormListSort(Form ObjKey, string KeyName) global native
;/ Fills the given input array with the values of the list on form or globally,
will fill the array until either the array or list runs out of valid indexes
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
slice[]: an initialized array set to the slice size you want, i.e. int[] slice = new int[10]
[optional] startIndex: the starting list index you want to start filling your slice array with
/;
function IntListSlice(Form ObjKey, string KeyName, int[] slice, int startIndex = 0) global native
function FloatListSlice(Form ObjKey, string KeyName, float[] slice, int startIndex = 0) global native
function StringListSlice(Form ObjKey, string KeyName, string[] slice, int startIndex = 0) global native
function FormListSlice(Form ObjKey, string KeyName, Form[] slice, int startIndex = 0) global native
;/ Sizes the given list to a set number of elements. If the list exists already it will be truncated
when given fewer elements, or resized to the appropriate length with the filler argument being used as
the default values
Returns the number of elements truncated (signed) or added (unsigned) onto the list.
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
toLength: The size you want to change the list to. Max length when using this function is 500.
[optional] filler: When adding empty elements to the list this will be used as the default value
/;
int function IntListResize(Form ObjKey, string KeyName, int toLength, int filler = 0) global native
int function FloatListResize(Form ObjKey, string KeyName, int toLength, float filler = 0.0) global native
int function StringListResize(Form ObjKey, string KeyName, int toLength, string filler = "") global native
int function FormListResize(Form ObjKey, string KeyName, int toLength, Form filler = none) global native
;/ Creates a copy of array on the given storage list at the given object+key,
overwriting any list that might already exists.
Returns true on success.
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
copy[]: The papyrus array with the content you wish to copy over into StorageUtil
[optional] filler: When adding empty elements to the list this will be used as the default value
/;
bool function IntListCopy(Form ObjKey, string KeyName, int[] copy) global native
bool function FloatListCopy(Form ObjKey, string KeyName, float[] copy) global native
bool function StringListCopy(Form ObjKey, string KeyName, string[] copy) global native
bool function FormListCopy(Form ObjKey, string KeyName, Form[] copy) global native
;/ Outputs the values currently stored by the given object+key.
Returns a new array containing the values.
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
/;
int[] function IntListToArray(Form ObjKey, string KeyName) global native
float[] function FloatListToArray(Form ObjKey, string KeyName) global native
string[] function StringListToArray(Form ObjKey, string KeyName) global native
Form[] function FormListToArray(Form ObjKey, string KeyName) global native
;/ Returns array of forms from list that have (or optionally don't have) the specified form types.
For valid list of form types, see FormType.psc or http://www.creationkit.com/GetType_-_Form
ObjKey: form to find value on. Set none to find global list value.
KeyName: name of list.
FormTypeIDs[]: The int papyrus array with all the form types you wish to filter for
[optional] ReturnMatching: By default, TRUE, the output Form[] array will contain forms from list that match the form types
If set to FALSE, inverts the resulting array with forms that have a type that DO NOT match.
/;
Form[] function FormListFilterByTypes(Form ObjKey, string KeyName, int[] FormTypeIDs, bool ReturnMatching = true) global native
; Convenience version of FormListFilterByTypes() for when only getting a single type.
Form[] function FormListFilterByType(Form ObjKey, string KeyName, int FormTypeID, bool ReturnMatching = true) global
int[] FormTypeIDs = new int[1]
FormTypeIDs[0] = FormTypeID
return FormListFilterByTypes(ObjKey, KeyName, FormTypeIDs, ReturnMatching)
endFunction
;/ Counts each type of of any KeyName that starts with a given string prefix on all objects.
PrefixKey: The string a KeyName must start with to be counted. Cannot be empty.
/;
int function CountIntValuePrefix(string PrefixKey) global native
int function CountFloatValuePrefix(string PrefixKey) global native
int function CountStringValuePrefix(string PrefixKey) global native
int function CountFormValuePrefix(string PrefixKey) global native
int function CountIntListPrefix(string PrefixKey) global native
int function CountFloatListPrefix(string PrefixKey) global native
int function CountStringListPrefix(string PrefixKey) global native
int function CountFormListPrefix(string PrefixKey) global native
; Performs all of the above prefix counts in one go.
int function CountAllPrefix(string PrefixKey) global native
;/ Counts each type of of any KeyName that starts with a given string prefix on all objects.
ObjKey: form to perform the prefix count on.
PrefixKey: The string a KeyName must start with to be counted. Cannot be empty.
/;
int function CountObjIntValuePrefix(Form ObjKey, string PrefixKey) global native
int function CountObjFloatValuePrefix(Form ObjKey, string PrefixKey) global native
int function CountObjStringValuePrefix(Form ObjKey, string PrefixKey) global native
int function CountObjFormValuePrefix(Form ObjKey, string PrefixKey) global native
int function CountObjIntListPrefix(Form ObjKey, string PrefixKey) global native
int function CountObjFloatListPrefix(Form ObjKey, string PrefixKey) global native
int function CountObjStringListPrefix(Form ObjKey, string PrefixKey) global native
int function CountObjFormListPrefix(Form ObjKey, string PrefixKey) global native
; Performs all of the above prefix counts in one go.
int function CountAllObjPrefix(Form ObjKey, string PrefixKey) global native
;/ Clears each type of of any KeyName that starts with a given string prefix on all objects.
Returns the number of values/lists that were unset.
PrefixKey: The string a KeyName must start with to be cleared. Cannot be empty.
/;
int function ClearIntValuePrefix(string PrefixKey) global native
int function ClearFloatValuePrefix(string PrefixKey) global native
int function ClearStringValuePrefix(string PrefixKey) global native
int function ClearFormValuePrefix(string PrefixKey) global native
int function ClearIntListPrefix(string PrefixKey) global native
int function ClearFloatListPrefix(string PrefixKey) global native
int function ClearStringListPrefix(string PrefixKey) global native
int function ClearFormListPrefix(string PrefixKey) global native
; Performs all of the above prefix clears in one go.
int function ClearAllPrefix(string PrefixKey) global native
;/ Clears each type of of any KeyName that starts with a given string prefix on specific objects.
Returns the number of values/lists that were unset.
ObjKey: form to perform the prefix clear on.
PrefixKey: The string a KeyName must start with to be cleared. Cannot be empty.
/;
int function ClearObjIntValuePrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjFloatValuePrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjStringValuePrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjFormValuePrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjIntListPrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjFloatListPrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjStringListPrefix(Form ObjKey, string PrefixKey) global native
int function ClearObjFormListPrefix(Form ObjKey, string PrefixKey) global native
; Performs all of the above prefix clears in one go.
int function ClearAllObjPrefix(Form ObjKey, string PrefixKey) global native
;/
Debug functions - can be helpful to find problems or for development.
/;
function debug_DeleteValues(Form ObjKey) global native
function debug_DeleteAllValues() global native
int function debug_Cleanup() global native
Form[] function debug_AllIntObjs() global native
Form[] function debug_AllFloatObjs() global native
Form[] function debug_AllStringObjs() global native
Form[] function debug_AllFormObjs() global native
Form[] function debug_AllIntListObjs() global native
Form[] function debug_AllFloatListObjs() global native
Form[] function debug_AllStringListObjs() global native
Form[] function debug_AllFormListObjs() global native
string[] function debug_AllObjIntKeys(Form ObjKey) global native
string[] function debug_AllObjFloatKeys(Form ObjKey) global native
string[] function debug_AllObjStringKeys(Form ObjKey) global native
string[] function debug_AllObjFormKeys(Form ObjKey) global native
string[] function debug_AllObjIntListKeys(Form ObjKey) global native
string[] function debug_AllObjFloatListKeys(Form ObjKey) global native
string[] function debug_AllObjStringListKeys(Form ObjKey) global native
string[] function debug_AllObjFormListKeys(Form ObjKey) global native
int function debug_GetIntObjectCount() global native
int function debug_GetFloatObjectCount() global native
int function debug_GetStringObjectCount() global native
int function debug_GetFormObjectCount() global native
int function debug_GetIntListObjectCount() global native
int function debug_GetFloatListObjectCount() global native
int function debug_GetStringListObjectCount() global native
int function debug_GetFormListObjectCount() global native
Form function debug_GetIntObject(int index) global native
Form function debug_GetFloatObject(int index) global native
Form function debug_GetStringObject(int index) global native
Form function debug_GetFormObject(int index) global native
Form function debug_GetIntListObject(int index) global native
Form function debug_GetFloatListObject(int index) global native
Form function debug_GetStringListObject(int index) global native
Form function debug_GetFormListObject(int index) global native
int function debug_GetIntKeysCount(Form ObjKey) global native
int function debug_GetFloatKeysCount(Form ObjKey) global native
int function debug_GetStringKeysCount(Form ObjKey) global native
int function debug_GetFormKeysCount(Form ObjKey) global native
int function debug_GetIntListKeysCount(Form ObjKey) global native
int function debug_GetFloatListKeysCount(Form ObjKey) global native
int function debug_GetStringListKeysCount(Form ObjKey) global native
int function debug_GetFormListKeysCount(Form ObjKey) global native
string function debug_GetIntKey(Form ObjKey, int index) global native
string function debug_GetFloatKey(Form ObjKey, int index) global native
string function debug_GetStringKey(Form ObjKey, int index) global native
string function debug_GetFormKey(Form ObjKey, int index) global native
string function debug_GetIntListKey(Form ObjKey, int index) global native
string function debug_GetFloatListKey(Form ObjKey, int index) global native
string function debug_GetStringListKey(Form ObjKey, int index) global native
string function debug_GetFormListKey(Form ObjKey, int index) global native
;/
Storage functions - separate file. These are shared in all save games. Values are loaded and saved
when savegame is loaded or saved.
DEPRECATED v2.9: Replaced by JsonUtil functions. Existing functions here have been proxied to a shared
json file to maintain compatibility.
/;
int function FileSetIntValue(string KeyName, int value) global
return JsonUtil.SetIntValue("../StorageUtil.json", KeyName, value)
endFunction
float function FileSetFloatValue(string KeyName, float value) global
return JsonUtil.SetFloatValue("../StorageUtil.json", KeyName, value)
endFunction
string function FileSetStringValue(string KeyName, string value) global
return JsonUtil.SetStringValue("../StorageUtil.json", KeyName, value)
endFunction
form function FileSetFormValue(string KeyName, Form value) global
return JsonUtil.SetFormValue("../StorageUtil.json", KeyName, value)
endFunction
int function FileAdjustIntValue(string KeyName, int amount) global
return JsonUtil.AdjustIntValue("../StorageUtil.json", KeyName, amount)
endFunction
float function FileAdjustFloatValue(string KeyName, float amount) global
return JsonUtil.AdjustFloatValue("../StorageUtil.json", KeyName, amount)
endFunction
bool function FileUnsetIntValue(string KeyName) global
return JsonUtil.UnsetIntValue("../StorageUtil.json", KeyName)
endFunction
bool function FileUnsetFloatValue(string KeyName) global
return JsonUtil.UnsetFloatValue("../StorageUtil.json", KeyName)
endFunction
bool function FileUnsetStringValue(string KeyName) global
return JsonUtil.UnsetStringValue("../StorageUtil.json", KeyName)
endFunction
bool function FileUnsetFormValue(string KeyName) global
return JsonUtil.UnsetFormValue("../StorageUtil.json", KeyName)
endFunction
bool function FileHasIntValue(string KeyName) global
return JsonUtil.HasIntValue("../StorageUtil.json", KeyName)
endFunction
bool function FileHasFloatValue(string KeyName) global
return JsonUtil.HasFloatValue("../StorageUtil.json", KeyName)
endFunction
bool function FileHasStringValue(string KeyName) global
return JsonUtil.HasStringValue("../StorageUtil.json", KeyName)
endFunction
bool function FileHasFormValue(string KeyName) global
return JsonUtil.HasFormValue("../StorageUtil.json", KeyName)
endFunction
int function FileGetIntValue(string KeyName, int missing = 0) global
return JsonUtil.GetIntValue("../StorageUtil.json", KeyName, missing)
endFunction
float function FileGetFloatValue(string KeyName, float missing = 0.0) global
return JsonUtil.GetFloatValue("../StorageUtil.json", KeyName, missing)
endFunction
string function FileGetStringValue(string KeyName, string missing = "") global
return JsonUtil.GetStringValue("../StorageUtil.json", KeyName, missing)
endFunction
Form function FileGetFormValue(string KeyName, Form missing = none) global
return JsonUtil.GetFormValue("../StorageUtil.json", KeyName, missing)
endFunction
int function FileIntListAdd(string KeyName, int value, bool allowDuplicate = true) global
return JsonUtil.IntListAdd("../StorageUtil.json", KeyName, value, allowDuplicate)
endFunction
int function FileFloatListAdd(string KeyName, float value, bool allowDuplicate = true) global
return JsonUtil.FloatListAdd("../StorageUtil.json", KeyName, value, allowDuplicate)
endFunction
int function FileStringListAdd(string KeyName, string value, bool allowDuplicate = true) global
return JsonUtil.StringListAdd("../StorageUtil.json", KeyName, value, allowDuplicate)
endFunction
int function FileFormListAdd(string KeyName, Form value, bool allowDuplicate = true) global
return JsonUtil.FormListAdd("../StorageUtil.json", KeyName, value, allowDuplicate)
endFunction
int function FileIntListAdjust(string KeyName, int index, int amount) global
return JsonUtil.IntListAdjust("../StorageUtil.json", KeyName, index, amount)
endFunction
float function FileFloatListAdjust(string KeyName, int index, float amount) global
return JsonUtil.FloatListAdjust("../StorageUtil.json", KeyName, index, amount)
endFunction
int function FileIntListRemove(string KeyName, int value, bool allInstances = false) global
return JsonUtil.IntListRemove("../StorageUtil.json", KeyName, value, allInstances)
endFunction
int function FileFloatListRemove(string KeyName, float value, bool allInstances = false) global
return JsonUtil.FloatListRemove("../StorageUtil.json", KeyName, value, allInstances)
endFunction
int function FileStringListRemove(string KeyName, string value, bool allInstances = false) global
return JsonUtil.StringListRemove("../StorageUtil.json", KeyName, value, allInstances)
endFunction
int function FileFormListRemove(string KeyName, Form value, bool allInstances = false) global
return JsonUtil.FormListRemove("../StorageUtil.json", KeyName, value, allInstances)
endFunction
int function FileIntListGet(string KeyName, int index) global
return JsonUtil.IntListGet("../StorageUtil.json", KeyName, index)
endFunction
float function FileFloatListGet(string KeyName, int index) global
return JsonUtil.FloatListGet("../StorageUtil.json", KeyName, index)
endFunction
string function FileStringListGet(string KeyName, int index) global
return JsonUtil.StringListGet("../StorageUtil.json", KeyName, index)
endFunction
Form function FileFormListGet(string KeyName, int index) global
return JsonUtil.FormListGet("../StorageUtil.json", KeyName, index)
endFunction
int function FileIntListSet(string KeyName, int index, int value) global
return JsonUtil.IntListSet("../StorageUtil.json", KeyName, index, value)
endFunction
float function FileFloatListSet(string KeyName, int index, float value) global
return JsonUtil.FloatListSet("../StorageUtil.json", KeyName, index, value)
endFunction
string function FileStringListSet(string KeyName, int index, string value) global
return JsonUtil.StringListSet("../StorageUtil.json", KeyName, index, value)
endFunction
Form function FileFormListSet(string KeyName, int index, Form value) global
return JsonUtil.FormListSet("../StorageUtil.json", KeyName, index, value)
endFunction
int function FileIntListClear(string KeyName) global
return JsonUtil.IntListClear("../StorageUtil.json", KeyName)
endFunction
int function FileFloatListClear(string KeyName) global
return JsonUtil.FloatListClear("../StorageUtil.json", KeyName)
endFunction
int function FileStringListClear(string KeyName) global
return JsonUtil.StringListClear("../StorageUtil.json", KeyName)
endFunction
int function FileFormListClear(string KeyName) global
return JsonUtil.FormListClear("../StorageUtil.json", KeyName)
endFunction
bool function FileIntListRemoveAt(string KeyName, int index) global
return JsonUtil.IntListRemoveAt("../StorageUtil.json", KeyName, index)
endFunction
bool function FileFloatListRemoveAt(string KeyName, int index) global
return JsonUtil.FloatListRemoveAt("../StorageUtil.json", KeyName, index)
endFunction
bool function FileStringListRemoveAt(string KeyName, int index) global
return JsonUtil.StringListRemoveAt("../StorageUtil.json", KeyName, index)
endFunction
bool function FileFormListRemoveAt(string KeyName, int index) global
return JsonUtil.FormListRemoveAt("../StorageUtil.json", KeyName, index)
endFunction
bool function FileIntListInsert(string KeyName, int index, int value) global
return JsonUtil.IntListInsertAt("../StorageUtil.json", KeyName, index, value)
endFunction
bool function FileFloatListInsert(string KeyName, int index, float value) global
return JsonUtil.FloatListInsertAt("../StorageUtil.json", KeyName, index, value)
endFunction
bool function FileStringListInsert(string KeyName, int index, string value) global
return JsonUtil.StringListInsertAt("../StorageUtil.json", KeyName, index, value)
endFunction
bool function FileFormListInsert(string KeyName, int index, Form value) global
return JsonUtil.FormListInsertAt("../StorageUtil.json", KeyName, index, value)
endFunction
int function FileIntListCount(string KeyName) global
return JsonUtil.IntListCount("../StorageUtil.json", KeyName)
endFunction
int function FileFloatListCount(string KeyName) global
return JsonUtil.FloatListCount("../StorageUtil.json", KeyName)
endFunction
int function FileStringListCount(string KeyName) global
return JsonUtil.StringListCount("../StorageUtil.json", KeyName)
endFunction
int function FileFormListCount(string KeyName) global
return JsonUtil.FormListCount("../StorageUtil.json", KeyName)
endFunction
int function FileIntListFind(string KeyName, int value) global
return JsonUtil.IntListFind("../StorageUtil.json", KeyName, value)
endFunction
int function FileFloatListFind(string KeyName, float value) global
return JsonUtil.FloatListFind("../StorageUtil.json", KeyName, value)
endFunction
int function FileStringListFind(string KeyName, string value) global
return JsonUtil.StringListFind("../StorageUtil.json", KeyName, value)
endFunction
int function FileFormListFind(string KeyName, Form value) global
return JsonUtil.FormListFind("../StorageUtil.json", KeyName, value)
endFunction
bool function FileIntListHas(string KeyName, int value) global
return JsonUtil.IntListHas("../StorageUtil.json", KeyName, value)
endFunction
bool function FileFloatListHas(string KeyName, float value) global
return JsonUtil.FloatListHas("../StorageUtil.json", KeyName, value)
endFunction
bool function FileStringListHas(string KeyName, string value) global
return JsonUtil.StringListHas("../StorageUtil.json", KeyName, value)
endFunction
bool function FileFormListHas(string KeyName, Form value) global
return JsonUtil.FormListHas("../StorageUtil.json", KeyName, value)
endFunction
function FileIntListSlice(string KeyName, int[] slice, int startIndex = 0) global
return JsonUtil.IntListSlice("../StorageUtil.json", KeyName, slice, startIndex)
endFunction
function FileFloatListSlice(string KeyName, float[] slice, int startIndex = 0) global
return JsonUtil.FloatListSlice("../StorageUtil.json", KeyName, slice, startIndex)
endFunction
function FileStringListSlice(string KeyName, string[] slice, int startIndex = 0) global
return JsonUtil.StringListSlice("../StorageUtil.json", KeyName, slice, startIndex)
endFunction
function FileFormListSlice(string KeyName, Form[] slice, int startIndex = 0) global
return JsonUtil.FormListSlice("../StorageUtil.json", KeyName, slice, startIndex)
endFunction
int function FileIntListResize(string KeyName, int toLength, int filler = 0) global
return JsonUtil.IntListResize("../StorageUtil.json", KeyName, toLength, filler)
endFunction
int function FileFloatListResize(string KeyName, int toLength, float filler = 0.0) global
return JsonUtil.FloatListResize("../StorageUtil.json", KeyName, toLength, filler)
endFunction
int function FileStringListResize(string KeyName, int toLength, string filler = "") global
return JsonUtil.StringListResize("../StorageUtil.json", KeyName, toLength, filler)
endFunction
int function FileFormListResize(string KeyName, int toLength, Form filler = none) global
return JsonUtil.FormListResize("../StorageUtil.json", KeyName, toLength, filler)
endFunction
bool function FileIntListCopy(string KeyName, int[] copy) global
return JsonUtil.IntListCopy("../StorageUtil.json", KeyName, copy)
endFunction
bool function FileFloatListCopy(string KeyName, float[] copy) global
return JsonUtil.FloatListCopy("../StorageUtil.json", KeyName, copy)
endFunction
bool function FileStringListCopy(string KeyName, string[] copy) global
return JsonUtil.StringListCopy("../StorageUtil.json", KeyName, copy)
endFunction
bool function FileFormListCopy(string KeyName, Form[] copy) global
return JsonUtil.FormListCopy("../StorageUtil.json", KeyName, copy)
endFunction
function debug_SaveFile() global
JsonUtil.Save("../StorageUtil.json")
endFunction
;/
Currently no longer implemented, unknown if/when they will return.
/;
int function debug_FileGetIntKeysCount() global
return 0
endFunction
int function debug_FileGetFloatKeysCount() global
return 0
endFunction
int function debug_FileGetStringKeysCount() global
return 0
endFunction
int function debug_FileGetIntListKeysCount() global
return 0
endFunction
int function debug_FileGetFloatListKeysCount() global
return 0
endFunction
int function debug_FileGetStringListKeysCount() global
return 0
endFunction
string function debug_FileGetIntKey(int index) global
return ""
endFunction
string function debug_FileGetFloatKey(int index) global
return ""
endFunction
string function debug_FileGetStringKey(int index) global
return ""
endFunction
string function debug_FileGetIntListKey(int index) global
return ""
endFunction
string function debug_FileGetFloatListKey(int index) global
return ""
endFunction
string function debug_FileGetStringListKey(int index) global
return ""
endFunction
function debug_FileDeleteAllValues() global
endFunction
function debug_SetDebugMode(bool enabled) global
endFunction
bool function ImportFile(string fileName, string restrictKey = "", int restrictType = -1, Form restrictForm = none, bool restrictGlobal = false, bool keyContains = false) global
return false
endFunction
bool function ExportFile(string fileName, string restrictKey = "", int restrictType = -1, Form restrictForm = none, bool restrictGlobal = false, bool keyContains = false, bool append = true) global
return false
endFunction