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
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>indexint
Returns
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
selfPapyrusScript<T>
Returns
Type Parameters
T
GetType(IForm)
Returns the typecode for this form object
public static Task<int> GetType(IForm self)
Parameters
selfIForm
Returns
GetWeight(IForm)
returns the weight of the form
public static Task<float> GetWeight(IForm self)
Parameters
selfIForm
Returns
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
selfPapyrusScript<T>nint
Returns
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
selfPapyrusScript<T>
Returns
Type Parameters
T
GetWorldModelPath<T>(PapyrusScript<T>)
public static Task<string> GetWorldModelPath<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>sstring
Returns
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
selfPapyrusScript<T>akKeywordIPapyrusKeyword
Returns
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
selfPapyrusScript<T>
Returns
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
selfIForm
Returns
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
selfPapyrusScript<T>
Returns
Type Parameters
T
RegisterForActorAction<T>(PapyrusScript<T>, int)
public static Task RegisterForActorAction<T>(this PapyrusScript<T> self, int actionType) where T : notnull, IForm
Parameters
selfPapyrusScript<T>actionTypeint
Returns
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
selfPapyrusScript<T>akSenderIObjectReferenceasEventNamestring
Returns
Type Parameters
T
RegisterForCameraState<T>(PapyrusScript<T>)
public static Task RegisterForCameraState<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
RegisterForControl<T>(PapyrusScript<T>, string)
public static Task RegisterForControl<T>(this PapyrusScript<T> self, string control) where T : notnull, IForm
Parameters
selfPapyrusScript<T>controlstring
Returns
Type Parameters
T
RegisterForCrosshairRef<T>(PapyrusScript<T>)
public static Task RegisterForCrosshairRef<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
RegisterForKey<T>(PapyrusScript<T>, int)
public static Task RegisterForKey<T>(this PapyrusScript<T> self, int keyCode) where T : notnull, IForm
Parameters
selfPapyrusScript<T>keyCodeint
Returns
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
selfPapyrusScript<T>akViewerIActorakTargetIObjectReference
Returns
Type Parameters
T
RegisterForMenu<T>(PapyrusScript<T>, string)
public static Task RegisterForMenu<T>(this PapyrusScript<T> self, string menuName) where T : notnull, IForm
Parameters
selfPapyrusScript<T>menuNamestring
Returns
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
selfPapyrusScript<T>eventNamestringcallbackNamestring
Returns
Type Parameters
T
RegisterForNiNodeUpdate<T>(PapyrusScript<T>)
public static Task RegisterForNiNodeUpdate<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>akViewerIActorakTargetIObjectReference
Returns
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
selfPapyrusScript<T>akViewerIActorakTargetIObjectReference
Returns
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
selfPapyrusScript<T>afIntervalfloat
Returns
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
selfPapyrusScript<T>afIntervalfloat
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>afIntervalfloat
Returns
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
selfPapyrusScript<T>afIntervalfloat
Returns
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
selfPapyrusScript<T>eventNamestringstrArgstringnumArgfloat
Returns
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
selfPapyrusScript<T>valueint
Returns
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
selfPapyrusScript<T>namestring
Returns
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
selfPapyrusScript<T>knowsbool
Returns
Type Parameters
T
SetWeight(IForm, float)
sets the weight of the form
public static Task SetWeight(IForm self, float weight)
Parameters
Returns
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
selfPapyrusScript<T>nSetTextureSetnint
Returns
Type Parameters
T
SetWorldModelPath<T>(PapyrusScript<T>, string)
public static Task SetWorldModelPath<T>(this PapyrusScript<T> self, string path) where T : notnull, IForm
Parameters
selfPapyrusScript<T>pathstring
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForActorAction<T>(PapyrusScript<T>, int)
public static Task UnregisterForActorAction<T>(this PapyrusScript<T> self, int actionType) where T : notnull, IForm
Parameters
selfPapyrusScript<T>actionTypeint
Returns
Type Parameters
T
UnregisterForAllControls<T>(PapyrusScript<T>)
public static Task UnregisterForAllControls<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForAllKeys<T>(PapyrusScript<T>)
public static Task UnregisterForAllKeys<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForAllMenus<T>(PapyrusScript<T>)
public static Task UnregisterForAllMenus<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForAllModEvents<T>(PapyrusScript<T>)
public static Task UnregisterForAllModEvents<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>akSenderIObjectReferenceasEventNamestring
Returns
Type Parameters
T
UnregisterForCameraState<T>(PapyrusScript<T>)
public static Task UnregisterForCameraState<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForControl<T>(PapyrusScript<T>, string)
public static Task UnregisterForControl<T>(this PapyrusScript<T> self, string control) where T : notnull, IForm
Parameters
selfPapyrusScript<T>controlstring
Returns
Type Parameters
T
UnregisterForCrosshairRef<T>(PapyrusScript<T>)
public static Task UnregisterForCrosshairRef<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
UnregisterForKey<T>(PapyrusScript<T>, int)
public static Task UnregisterForKey<T>(this PapyrusScript<T> self, int keyCode) where T : notnull, IForm
Parameters
selfPapyrusScript<T>keyCodeint
Returns
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
selfPapyrusScript<T>akViewerIActorakTargetIObjectReference
Returns
Type Parameters
T
UnregisterForMenu<T>(PapyrusScript<T>, string)
public static Task UnregisterForMenu<T>(this PapyrusScript<T> self, string menuName) where T : notnull, IForm
Parameters
selfPapyrusScript<T>menuNamestring
Returns
Type Parameters
T
UnregisterForModEvent<T>(PapyrusScript<T>, string)
public static Task UnregisterForModEvent<T>(this PapyrusScript<T> self, string eventName) where T : notnull, IForm
Parameters
selfPapyrusScript<T>eventNamestring
Returns
Type Parameters
T
UnregisterForNiNodeUpdate<T>(PapyrusScript<T>)
public static Task UnregisterForNiNodeUpdate<T>(this PapyrusScript<T> self) where T : notnull, IForm
Parameters
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
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
selfPapyrusScript<T>
Returns
Type Parameters
T