Class UtilityScript
- Namespace
- SkyrimForge.Papyrus
- Assembly
- SkyrimForge.Game.dll
Functions and comments from Utility.psc.
public static class UtilityScript
- Inheritance
-
UtilityScript
- Inherited Members
Properties
Dispatcher
The dispatcher that binds this script to a form and calls the functions and properties that have no generated member.
public static PapyrusScriptDispatcher Dispatcher { get; }
Property Value
Methods
CaptureFrameRate(int)
Gets you a string describing the frame rate for a certain number of frames (String will be no longer than 1K characters long, separated by commas)
public static Task<string> CaptureFrameRate(int numFrames)
Parameters
numFramesint
Returns
CreateBoolArray(int, bool)
public static Task<bool[]> CreateBoolArray(int size, bool fill = false)
Parameters
Returns
CreateFloatArray(int, float)
public static Task<float[]> CreateFloatArray(int size, float fill = 0)
Parameters
Returns
CreateFormArray(int, IForm?)
public static Task<Form?[]> CreateFormArray(int size, IForm? fill = null)
Parameters
Returns
CreateIntArray(int, int)
public static Task<int[]> CreateIntArray(int size, int fill = 0)
Parameters
Returns
CreateStringArray(int, string)
public static Task<string[]> CreateStringArray(int size, string fill = "")
Parameters
Returns
EndFrameRateCapture()
public static Task EndFrameRateCapture()
Returns
GameTimeToString(float)
Converts a float game time (in terms of game days passed) to a string detailing the date and time it represents in "MM/DD/YYYY HH:MM" format. A 24-hour clock is used, and the function is latent (due to issues in the current architecture with returning strings from code)
public static Task<string> GameTimeToString(float afGameTime)
Parameters
afGameTimefloat
Returns
GetAverageFrameRate()
public static Task<float> GetAverageFrameRate()
Returns
GetBudgetCount()
public static Task<int> GetBudgetCount()
Returns
GetBudgetName(int)
public static Task<string> GetBudgetName(int aiBudgetNumber)
Parameters
aiBudgetNumberint
Returns
GetCurrentBudget(int)
public static Task<int> GetCurrentBudget(int aiBudgetNumber)
Parameters
aiBudgetNumberint
Returns
GetCurrentGameTime()
Obtains the current game time in terms of game days passed (same as the global variable)
public static Task<float> GetCurrentGameTime()
Returns
GetCurrentMemory()
Must be called first, it sets up the memory stats used by the other functions
public static Task<int> GetCurrentMemory()
Returns
GetCurrentRealTime()
Obtains the number of seconds since the application started (the same timer that WaitMenuMode uses) Does not take into account menu-mode, or VM frozen time Most useful for determining how long something took to run
public static Task<float> GetCurrentRealTime()
Returns
GetINIBool(string)
public static Task<bool> GetINIBool(string ini)
Parameters
inistring
Returns
GetINIFloat(string)
public static Task<float> GetINIFloat(string ini)
Parameters
inistring
Returns
GetINIInt(string)
public static Task<int> GetINIInt(string ini)
Parameters
inistring
Returns
GetINIString(string)
public static Task<string> GetINIString(string ini)
Parameters
inistring
Returns
GetMaxFrameRate()
public static Task<float> GetMaxFrameRate()
Returns
GetMinFrameRate()
public static Task<float> GetMinFrameRate()
Returns
IsInMenuMode()
Returns whether the game is currently in menu mode or not
public static Task<bool> IsInMenuMode()
Returns
OverBudget(int)
public static Task<bool> OverBudget(int aiBudgetNumber)
Parameters
aiBudgetNumberint
Returns
RandomFloat(float, float)
Generates a random floating point number between afMin and afMax (inclusive)
public static Task<float> RandomFloat(float afMin = 0, float afMax = 1)
Parameters
Returns
RandomInt(int, int)
Generates a random integer between aiMin and aiMax (inclusive)
public static Task<int> RandomInt(int aiMin = 0, int aiMax = 100)
Parameters
Returns
ResizeBoolArray(IReadOnlyCollection<bool>, int, bool)
public static Task<bool[]> ResizeBoolArray(IReadOnlyCollection<bool> source, int size, bool fill = false)
Parameters
sourceIReadOnlyCollection<bool>sizeintfillbool
Returns
ResizeFloatArray(IReadOnlyCollection<float>, int, float)
public static Task<float[]> ResizeFloatArray(IReadOnlyCollection<float> source, int size, float fill = 0)
Parameters
sourceIReadOnlyCollection<float>sizeintfillfloat
Returns
ResizeFormArray<TForm>(IReadOnlyCollection<TForm>, int, IForm?)
public static Task<Form?[]> ResizeFormArray<TForm>(IReadOnlyCollection<TForm> source, int size, IForm? fill = null) where TForm : IForm
Parameters
sourceIReadOnlyCollection<TForm>sizeintfillIForm
Returns
Type Parameters
TForm
ResizeIntArray(IReadOnlyCollection<int>, int, int)
public static Task<int[]> ResizeIntArray(IReadOnlyCollection<int> source, int size, int fill = 0)
Parameters
sourceIReadOnlyCollection<int>sizeintfillint
Returns
ResizeStringArray(IReadOnlyCollection<string?>, int, string)
public static Task<string[]> ResizeStringArray(IReadOnlyCollection<string?> source, int size, string fill = "")
Parameters
sourceIReadOnlyCollection<string>sizeintfillstring
Returns
SetINIBool(string, bool)
public static Task SetINIBool(string ini, bool value)
Parameters
Returns
SetINIFloat(string, float)
public static Task SetINIFloat(string ini, float value)
Parameters
Returns
SetINIInt(string, int)
public static Task SetINIInt(string ini, int value)
Parameters
Returns
SetINIString(string, string)
public static Task SetINIString(string ini, string value)
Parameters
Returns
StartFrameRateCapture()
public static Task StartFrameRateCapture()
Returns
Wait(float)
Waits for the specified amount of time (latent). Timer will not run during menu mode
[Obsolete("Uses the Papyrus virtual machine. Prefer IUtility.Wait.", DiagnosticId = "SKYRIMFORGE0002")]
public static Task Wait(float afSeconds)
Parameters
afSecondsfloat
Returns
WaitGameTime(float)
Waits for the specified amount of game time (latent)
public static Task WaitGameTime(float afHours)
Parameters
afHoursfloat
Returns
WaitMenuMode(float)
Waits for the specified amount of time (latent) - Timer WILL run during menu mode
public static Task WaitMenuMode(float afSeconds)
Parameters
afSecondsfloat