Table of Contents

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

PapyrusScriptDispatcher

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

numFrames int

Returns

Task<string>

CreateBoolArray(int, bool)

public static Task<bool[]> CreateBoolArray(int size, bool fill = false)

Parameters

size int
fill bool

Returns

Task<bool[]>

CreateFloatArray(int, float)

public static Task<float[]> CreateFloatArray(int size, float fill = 0)

Parameters

size int
fill float

Returns

Task<float[]>

CreateFormArray(int, IForm?)

public static Task<Form?[]> CreateFormArray(int size, IForm? fill = null)

Parameters

size int
fill IForm

Returns

Task<Form?[]>

CreateIntArray(int, int)

public static Task<int[]> CreateIntArray(int size, int fill = 0)

Parameters

size int
fill int

Returns

Task<int[]>

CreateStringArray(int, string)

public static Task<string[]> CreateStringArray(int size, string fill = "")

Parameters

size int
fill string

Returns

Task<string[]>

EndFrameRateCapture()

public static Task EndFrameRateCapture()

Returns

Task

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

afGameTime float

Returns

Task<string>

GetAverageFrameRate()

public static Task<float> GetAverageFrameRate()

Returns

Task<float>

GetBudgetCount()

public static Task<int> GetBudgetCount()

Returns

Task<int>

GetBudgetName(int)

public static Task<string> GetBudgetName(int aiBudgetNumber)

Parameters

aiBudgetNumber int

Returns

Task<string>

GetCurrentBudget(int)

public static Task<int> GetCurrentBudget(int aiBudgetNumber)

Parameters

aiBudgetNumber int

Returns

Task<int>

GetCurrentGameTime()

Obtains the current game time in terms of game days passed (same as the global variable)

public static Task<float> GetCurrentGameTime()

Returns

Task<float>

GetCurrentMemory()

Must be called first, it sets up the memory stats used by the other functions

public static Task<int> GetCurrentMemory()

Returns

Task<int>

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

Task<float>

GetINIBool(string)

public static Task<bool> GetINIBool(string ini)

Parameters

ini string

Returns

Task<bool>

GetINIFloat(string)

public static Task<float> GetINIFloat(string ini)

Parameters

ini string

Returns

Task<float>

GetINIInt(string)

public static Task<int> GetINIInt(string ini)

Parameters

ini string

Returns

Task<int>

GetINIString(string)

public static Task<string> GetINIString(string ini)

Parameters

ini string

Returns

Task<string>

GetMaxFrameRate()

public static Task<float> GetMaxFrameRate()

Returns

Task<float>

GetMinFrameRate()

public static Task<float> GetMinFrameRate()

Returns

Task<float>

IsInMenuMode()

Returns whether the game is currently in menu mode or not

public static Task<bool> IsInMenuMode()

Returns

Task<bool>

OverBudget(int)

public static Task<bool> OverBudget(int aiBudgetNumber)

Parameters

aiBudgetNumber int

Returns

Task<bool>

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

afMin float
afMax float

Returns

Task<float>

RandomInt(int, int)

Generates a random integer between aiMin and aiMax (inclusive)

public static Task<int> RandomInt(int aiMin = 0, int aiMax = 100)

Parameters

aiMin int
aiMax int

Returns

Task<int>

ResizeBoolArray(IReadOnlyCollection<bool>, int, bool)

public static Task<bool[]> ResizeBoolArray(IReadOnlyCollection<bool> source, int size, bool fill = false)

Parameters

source IReadOnlyCollection<bool>
size int
fill bool

Returns

Task<bool[]>

ResizeFloatArray(IReadOnlyCollection<float>, int, float)

public static Task<float[]> ResizeFloatArray(IReadOnlyCollection<float> source, int size, float fill = 0)

Parameters

source IReadOnlyCollection<float>
size int
fill float

Returns

Task<float[]>

ResizeFormArray<TForm>(IReadOnlyCollection<TForm>, int, IForm?)

public static Task<Form?[]> ResizeFormArray<TForm>(IReadOnlyCollection<TForm> source, int size, IForm? fill = null) where TForm : IForm

Parameters

source IReadOnlyCollection<TForm>
size int
fill IForm

Returns

Task<Form?[]>

Type Parameters

TForm

ResizeIntArray(IReadOnlyCollection<int>, int, int)

public static Task<int[]> ResizeIntArray(IReadOnlyCollection<int> source, int size, int fill = 0)

Parameters

source IReadOnlyCollection<int>
size int
fill int

Returns

Task<int[]>

ResizeStringArray(IReadOnlyCollection<string?>, int, string)

public static Task<string[]> ResizeStringArray(IReadOnlyCollection<string?> source, int size, string fill = "")

Parameters

source IReadOnlyCollection<string>
size int
fill string

Returns

Task<string[]>

SetINIBool(string, bool)

public static Task SetINIBool(string ini, bool value)

Parameters

ini string
value bool

Returns

Task

SetINIFloat(string, float)

public static Task SetINIFloat(string ini, float value)

Parameters

ini string
value float

Returns

Task

SetINIInt(string, int)

public static Task SetINIInt(string ini, int value)

Parameters

ini string
value int

Returns

Task

SetINIString(string, string)

public static Task SetINIString(string ini, string value)

Parameters

ini string
value string

Returns

Task

StartFrameRateCapture()

public static Task StartFrameRateCapture()

Returns

Task

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

afSeconds float

Returns

Task

WaitGameTime(float)

Waits for the specified amount of game time (latent)

public static Task WaitGameTime(float afHours)

Parameters

afHours float

Returns

Task

WaitMenuMode(float)

Waits for the specified amount of time (latent) - Timer WILL run during menu mode

public static Task WaitMenuMode(float afSeconds)

Parameters

afSeconds float

Returns

Task