Table of Contents

Class FormScript

Namespace
SkyrimForge.Papyrus
Assembly
SkyrimForge.Game.dll

Functions and comments from Form.psc.

public static class FormScript
Inheritance
FormScript
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

GetFormID<T>(PapyrusScript<T>)

Returns the formID for this object

public static Task<int> GetFormID<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<int>

Type Parameters

T

GetGoldValue<T>(PapyrusScript<T>)

Obtains this form's value in gold. Will return -1 if the form doesn't have any value (like a quest)

[Obsolete("Uses the Papyrus virtual machine. Prefer Form.GetGoldValue().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<int> GetGoldValue<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<int>

Type Parameters

T

GetKeywords<T>(PapyrusScript<T>)

returns all keywords of the form

public static Task<Keyword[]> GetKeywords<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<Keyword[]>

Type Parameters

T

GetName<T>(PapyrusScript<T>)

returns the form's name, full name if possible

[Obsolete("Uses the Papyrus virtual machine. Prefer Form.GetName().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<string> GetName<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<string>

Type Parameters

T

GetNthKeyword<T>(PapyrusScript<T>, int)

returns the keyword at the specified index

public static Task<Keyword?> GetNthKeyword<T>(this PapyrusScript<T> self, int index) where T : notnull, IForm

Parameters

self PapyrusScript<T>
index int

Returns

Task<Keyword?>

Type Parameters

T

GetNumKeywords<T>(PapyrusScript<T>)

returns the number of keywords on the form

public static Task<int> GetNumKeywords<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<int>

Type Parameters

T

GetType(IForm)

Returns the typecode for this form object

public static Task<int> GetType(IForm self)

Parameters

self IForm

Returns

Task<int>

GetWeight(IForm)

returns the weight of the form

public static Task<float> GetWeight(IForm self)

Parameters

self IForm

Returns

Task<float>

GetWorldModelNthTextureSet<T>(PapyrusScript<T>, int)

Returns the Nth texture set of the world model, if the textures can be swapped

public static Task<TextureSet?> GetWorldModelNthTextureSet<T>(this PapyrusScript<T> self, int n) where T : notnull, IForm

Parameters

self PapyrusScript<T>
n int

Returns

Task<TextureSet?>

Type Parameters

T

GetWorldModelNumTextureSets<T>(PapyrusScript<T>)

Returns the number of texture sets the world model has, if its textures can be swapped

public static Task<int> GetWorldModelNumTextureSets<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<int>

Type Parameters

T

GetWorldModelPath<T>(PapyrusScript<T>)

public static Task<string> GetWorldModelPath<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<string>

Type Parameters

T

HasKeywordString<T>(PapyrusScript<T>, string)

public static Task<bool> HasKeywordString<T>(this PapyrusScript<T> self, string s) where T : notnull, IForm

Parameters

self PapyrusScript<T>
s string

Returns

Task<bool>

Type Parameters

T

HasKeyword<T>(PapyrusScript<T>, IPapyrusKeyword)

Returns if this form has the specified keyword attached

public static Task<bool> HasKeyword<T>(this PapyrusScript<T> self, IPapyrusKeyword akKeyword) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akKeyword IPapyrusKeyword

Returns

Task<bool>

Type Parameters

T

HasWorldModel<T>(PapyrusScript<T>)

Returns whether this Form has a World Model (fast)

[Obsolete("Uses the Papyrus virtual machine. Prefer Form.HasWorldModel().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> HasWorldModel<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<bool>

Type Parameters

T

IsPlayable(IForm)

Returns whether this Form is playable, only applied to Forms with the playable flag

public static Task<bool> IsPlayable(IForm self)

Parameters

self IForm

Returns

Task<bool>

PlayerKnows<T>(PapyrusScript<T>)

Is the "Known" flag set for this form?

public static Task<bool> PlayerKnows<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<bool>

Type Parameters

T

RegisterForActorAction<T>(PapyrusScript<T>, int)

public static Task RegisterForActorAction<T>(this PapyrusScript<T> self, int actionType) where T : notnull, IForm

Parameters

self PapyrusScript<T>
actionType int

Returns

Task

Type Parameters

T

RegisterForAnimationEvent<T>(PapyrusScript<T>, IObjectReference, string)

Register for the specified animation event from the specified object - returns true if it successfully registered

public static Task<bool> RegisterForAnimationEvent<T>(this PapyrusScript<T> self, IObjectReference akSender, string asEventName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akSender IObjectReference
asEventName string

Returns

Task<bool>

Type Parameters

T

RegisterForCameraState<T>(PapyrusScript<T>)

public static Task RegisterForCameraState<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

RegisterForControl<T>(PapyrusScript<T>, string)

public static Task RegisterForControl<T>(this PapyrusScript<T> self, string control) where T : notnull, IForm

Parameters

self PapyrusScript<T>
control string

Returns

Task

Type Parameters

T

RegisterForCrosshairRef<T>(PapyrusScript<T>)

public static Task RegisterForCrosshairRef<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

RegisterForKey<T>(PapyrusScript<T>, int)

public static Task RegisterForKey<T>(this PapyrusScript<T> self, int keyCode) where T : notnull, IForm

Parameters

self PapyrusScript<T>
keyCode int

Returns

Task

Type Parameters

T

RegisterForLOS<T>(PapyrusScript<T>, IActor, IObjectReference)

Register for LOS gain and lost events between the viewer and the target A loss or gain event will be sent immediately, depending on whether or not the viewer is already looking at the target or not If the viewer is not the player, the target must be another actor

public static Task RegisterForLOS<T>(this PapyrusScript<T> self, IActor akViewer, IObjectReference akTarget) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akViewer IActor
akTarget IObjectReference

Returns

Task

Type Parameters

T

RegisterForMenu<T>(PapyrusScript<T>, string)

public static Task RegisterForMenu<T>(this PapyrusScript<T> self, string menuName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
menuName string

Returns

Task

Type Parameters

T

RegisterForModEvent<T>(PapyrusScript<T>, string, string)

public static Task RegisterForModEvent<T>(this PapyrusScript<T> self, string eventName, string callbackName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
eventName string
callbackName string

Returns

Task

Type Parameters

T

RegisterForNiNodeUpdate<T>(PapyrusScript<T>)

public static Task RegisterForNiNodeUpdate<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

RegisterForSingleLOSGain<T>(PapyrusScript<T>, IActor, IObjectReference)

Register for only the first LOS gain event between the viewer and the target If the viewer is already looking at the target, an event will be received almost immediately If the viewer is not the player, the target must be another actor

public static Task RegisterForSingleLOSGain<T>(this PapyrusScript<T> self, IActor akViewer, IObjectReference akTarget) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akViewer IActor
akTarget IObjectReference

Returns

Task

Type Parameters

T

RegisterForSingleLOSLost<T>(PapyrusScript<T>, IActor, IObjectReference)

Register for only the first LOS lost event between the viewer and the target If the viewer is already not looking at the target, an event will be received almost immediately If the viewer is not the player, the target must be another actor

public static Task RegisterForSingleLOSLost<T>(this PapyrusScript<T> self, IActor akViewer, IObjectReference akTarget) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akViewer IActor
akTarget IObjectReference

Returns

Task

Type Parameters

T

RegisterForSingleUpdateGameTime<T>(PapyrusScript<T>, float)

Register for a single OnUpdateGameTime event, in afInterval hours of game time. All scripts attached to this form will get the update events

public static Task RegisterForSingleUpdateGameTime<T>(this PapyrusScript<T> self, float afInterval) where T : notnull, IForm

Parameters

self PapyrusScript<T>
afInterval float

Returns

Task

Type Parameters

T

RegisterForSingleUpdate<T>(PapyrusScript<T>, float)

Register for a single OnUpdate event, in afInterval seconds. All scripts attached to this form will get the update events Of course, this means you don't need to call UnregisterForUpdate() If you find yourself doing this: Event OnUpdate() UnregisterForUpdate() {Do some stuff} endEvent Then you should use RegisterForSingleUpdate instead

public static Task RegisterForSingleUpdate<T>(this PapyrusScript<T> self, float afInterval) where T : notnull, IForm

Parameters

self PapyrusScript<T>
afInterval float

Returns

Task

Type Parameters

T

RegisterForSleep<T>(PapyrusScript<T>)

Registers this form to receive events when the player sleeps and wakes up

public static Task RegisterForSleep<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

RegisterForTrackedStatsEvent<T>(PapyrusScript<T>)

Registers this form to receive events when tracked stats are updated

public static Task RegisterForTrackedStatsEvent<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

RegisterForUpdateGameTime<T>(PapyrusScript<T>, float)

Register for OnUpdateGameTime events, every X hours of game time, where X is the interval. All scripts attached to this form will get the update events

public static Task RegisterForUpdateGameTime<T>(this PapyrusScript<T> self, float afInterval) where T : notnull, IForm

Parameters

self PapyrusScript<T>
afInterval float

Returns

Task

Type Parameters

T

RegisterForUpdate<T>(PapyrusScript<T>, float)

Register for OnUpdate events, every X seconds, where X is the interval. All scripts attached to this form will get the update events

public static Task RegisterForUpdate<T>(this PapyrusScript<T> self, float afInterval) where T : notnull, IForm

Parameters

self PapyrusScript<T>
afInterval float

Returns

Task

Type Parameters

T

SendModEvent<T>(PapyrusScript<T>, string, string, float)

Sends custom event with given generic parameters.

public static Task SendModEvent<T>(this PapyrusScript<T> self, string eventName, string strArg = "", float numArg = 0) where T : notnull, IForm

Parameters

self PapyrusScript<T>
eventName string
strArg string
numArg float

Returns

Task

Type Parameters

T

SetGoldValue<T>(PapyrusScript<T>, int)

sets the gold value of the form

public static Task SetGoldValue<T>(this PapyrusScript<T> self, int value) where T : notnull, IForm

Parameters

self PapyrusScript<T>
value int

Returns

Task

Type Parameters

T

SetName<T>(PapyrusScript<T>, string)

sets the name of the form

public static Task SetName<T>(this PapyrusScript<T> self, string name) where T : notnull, IForm

Parameters

self PapyrusScript<T>
name string

Returns

Task

Type Parameters

T

SetPlayerKnows<T>(PapyrusScript<T>, bool)

Sets whether the player knows this form Should only be used for Magic Effects, Words of Power, and Enchantments

public static Task SetPlayerKnows<T>(this PapyrusScript<T> self, bool knows) where T : notnull, IForm

Parameters

self PapyrusScript<T>
knows bool

Returns

Task

Type Parameters

T

SetWeight(IForm, float)

sets the weight of the form

public static Task SetWeight(IForm self, float weight)

Parameters

self IForm
weight float

Returns

Task

SetWorldModelNthTextureSet<T>(PapyrusScript<T>, TextureSet, int)

Sets the world models Nth texture set, if the textures can be set

public static Task SetWorldModelNthTextureSet<T>(this PapyrusScript<T> self, TextureSet nSet, int n) where T : notnull, IForm

Parameters

self PapyrusScript<T>
nSet TextureSet
n int

Returns

Task

Type Parameters

T

SetWorldModelPath<T>(PapyrusScript<T>, string)

public static Task SetWorldModelPath<T>(this PapyrusScript<T> self, string path) where T : notnull, IForm

Parameters

self PapyrusScript<T>
path string

Returns

Task

Type Parameters

T

StartObjectProfiling<T>(PapyrusScript<T>)

Turns on profiling for this specific object and all scripts attached to it - setting doesn't persist across saves Will do nothing on release console builds, and if the Papyrus:bEnableProfiling ini setting is off

public static Task StartObjectProfiling<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

StopObjectProfiling<T>(PapyrusScript<T>)

Turns off profiling for this specific object and all scripts attached to it - setting doesn't persist across saves Will do nothing on release console builds, and if the Papyrus:bEnableProfiling ini setting is off

public static Task StopObjectProfiling<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

TempClone<T>(PapyrusScript<T>)

Returns a temporary clone of this form

public static Task<Form?> TempClone<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task<Form?>

Type Parameters

T

UnregisterForActorAction<T>(PapyrusScript<T>, int)

public static Task UnregisterForActorAction<T>(this PapyrusScript<T> self, int actionType) where T : notnull, IForm

Parameters

self PapyrusScript<T>
actionType int

Returns

Task

Type Parameters

T

UnregisterForAllControls<T>(PapyrusScript<T>)

public static Task UnregisterForAllControls<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForAllKeys<T>(PapyrusScript<T>)

public static Task UnregisterForAllKeys<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForAllMenus<T>(PapyrusScript<T>)

public static Task UnregisterForAllMenus<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForAllModEvents<T>(PapyrusScript<T>)

public static Task UnregisterForAllModEvents<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForAnimationEvent<T>(PapyrusScript<T>, IObjectReference, string)

Unregister for the specified animation event from the specified object

public static Task UnregisterForAnimationEvent<T>(this PapyrusScript<T> self, IObjectReference akSender, string asEventName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akSender IObjectReference
asEventName string

Returns

Task

Type Parameters

T

UnregisterForCameraState<T>(PapyrusScript<T>)

public static Task UnregisterForCameraState<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForControl<T>(PapyrusScript<T>, string)

public static Task UnregisterForControl<T>(this PapyrusScript<T> self, string control) where T : notnull, IForm

Parameters

self PapyrusScript<T>
control string

Returns

Task

Type Parameters

T

UnregisterForCrosshairRef<T>(PapyrusScript<T>)

public static Task UnregisterForCrosshairRef<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForKey<T>(PapyrusScript<T>, int)

public static Task UnregisterForKey<T>(this PapyrusScript<T> self, int keyCode) where T : notnull, IForm

Parameters

self PapyrusScript<T>
keyCode int

Returns

Task

Type Parameters

T

UnregisterForLOS<T>(PapyrusScript<T>, IActor, IObjectReference)

Unregister for any LOS events between the viewer and target

public static Task UnregisterForLOS<T>(this PapyrusScript<T> self, IActor akViewer, IObjectReference akTarget) where T : notnull, IForm

Parameters

self PapyrusScript<T>
akViewer IActor
akTarget IObjectReference

Returns

Task

Type Parameters

T

UnregisterForMenu<T>(PapyrusScript<T>, string)

public static Task UnregisterForMenu<T>(this PapyrusScript<T> self, string menuName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
menuName string

Returns

Task

Type Parameters

T

UnregisterForModEvent<T>(PapyrusScript<T>, string)

public static Task UnregisterForModEvent<T>(this PapyrusScript<T> self, string eventName) where T : notnull, IForm

Parameters

self PapyrusScript<T>
eventName string

Returns

Task

Type Parameters

T

UnregisterForNiNodeUpdate<T>(PapyrusScript<T>)

public static Task UnregisterForNiNodeUpdate<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForSleep<T>(PapyrusScript<T>)

Unregisters this form to receive events when the player sleeps and wakes up

public static Task UnregisterForSleep<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForTrackedStatsEvent<T>(PapyrusScript<T>)

Unregisters this form from receiving events when tracked stats are updated

public static Task UnregisterForTrackedStatsEvent<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForUpdateGameTime<T>(PapyrusScript<T>)

Unregister for OnUpdateGameTime events, all attached scripts will stop getting update game time events

public static Task UnregisterForUpdateGameTime<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T

UnregisterForUpdate<T>(PapyrusScript<T>)

Unregister for OnUpdate events, all attached scripts will stop getting update events

public static Task UnregisterForUpdate<T>(this PapyrusScript<T> self) where T : notnull, IForm

Parameters

self PapyrusScript<T>

Returns

Task

Type Parameters

T