Class ObjectReferenceScript
- Namespace
- SkyrimForge.Papyrus
- Assembly
- SkyrimForge.Game.dll
Functions and comments from ObjectReference.psc.
public static class ObjectReferenceScript
- Inheritance
-
ObjectReferenceScript
- Inherited Members
Fields
Motion_BoxIntertia
public const int Motion_BoxIntertia = 3
Field Value
Motion_Character
public const int Motion_Character = 7
Field Value
Motion_Dynamic
public const int Motion_Dynamic = 1
Field Value
Motion_Fixed
public const int Motion_Fixed = 5
Field Value
Motion_Keyframed
public const int Motion_Keyframed = 4
Field Value
Motion_SphereIntertia
public const int Motion_SphereIntertia = 2
Field Value
Motion_ThinBoxIntertia
public const int Motion_ThinBoxIntertia = 6
Field Value
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
Activate<T>(PapyrusScript<T>, IObjectReference, bool)
Have akActivator activate this reference. If abDefaultProcessingOnly is true then any block will be bypassed and no OnActivate event will be sent. The function returns true if default processing ran, and succeeded. If default processing has been blocked, will always return false.
public static Task<bool> Activate<T>(this PapyrusScript<T> self, IObjectReference akActivator, bool abDefaultProcessingOnly = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akActivatorIObjectReferenceabDefaultProcessingOnlybool
Returns
Type Parameters
T
AddDependentAnimatedObjectReference<T>(PapyrusScript<T>, IObjectReference)
Sets up a dependent animated object This function should be used only with a coder supervision. It is left undocumented because it can cause dangling pointers as well as very broken functionality for the dependent object if used improperly.
public static Task<bool> AddDependentAnimatedObjectReference<T>(this PapyrusScript<T> self, IObjectReference akDependent) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akDependentIObjectReference
Returns
Type Parameters
T
AddInventoryEventFilter<T>(PapyrusScript<T>, IForm)
Add an inventory event filter to this reference. Item added/removed events matching the specified form (or in the specified form list) will now be let through.
public static Task AddInventoryEventFilter<T>(this PapyrusScript<T> self, IForm akFilter) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akFilterIForm
Returns
Type Parameters
T
AddItem<T>(PapyrusScript<T>, IForm, int, bool)
Adds the specified base object or object reference to this object reference's container/inventory Note that you cannot add more then one copy of a reference to a container (a warning will be printed if you try)
public static Task AddItem<T>(this PapyrusScript<T> self, IForm akItemToAdd, int aiCount = 1, bool abSilent = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akItemToAddIFormaiCountintabSilentbool
Returns
Type Parameters
T
AddKeyIfNeeded<T>(PapyrusScript<T>, IObjectReference)
Should only be called by ObjectReferences that have/are containers (ie Containers and Actors). Checks to see if self has the key to ObjectWithNeededKey, and if not, creates a copy of the key and puts it in self.
public static Task AddKeyIfNeeded<T>(this PapyrusScript<T> self, IObjectReference ObjectWithNeededKey) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>ObjectWithNeededKeyIObjectReference
Returns
Type Parameters
T
AddToMap<T>(PapyrusScript<T>, bool)
Adds this reference (which is a map marker) to the map, optionally making it available for fast travel
public static Task AddToMap<T>(this PapyrusScript<T> self, bool abAllowFastTravel = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abAllowFastTravelbool
Returns
Type Parameters
T
ApplyHavokImpulse<T>(PapyrusScript<T>, float, float, float, float)
Apply an impulse to this reference
public static Task ApplyHavokImpulse<T>(this PapyrusScript<T> self, float afX, float afY, float afZ, float afMagnitude) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afXfloatafYfloatafZfloatafMagnitudefloat
Returns
Type Parameters
T
BlockActivation<T>(PapyrusScript<T>, bool)
Turns on and off blocking of normal activation - OnActivate events will still be sent
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.BlockActivation(bool).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task BlockActivation<T>(this PapyrusScript<T> self, bool abBlocked = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abBlockedbool
Returns
Type Parameters
T
CalculateEncounterLevel<T>(PapyrusScript<T>, int)
Calculate's this references encounter level based on the requested difficulty level 0 - Easy 1 - Medium 2 - Hard 3 - Very Hard 4 - None
public static Task<int> CalculateEncounterLevel<T>(this PapyrusScript<T> self, int aiDifficulty = 4) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>aiDifficultyint
Returns
Type Parameters
T
CanFastTravelToMarker<T>(PapyrusScript<T>)
Can the map marker be fast traveled to?
public static Task<bool> CanFastTravelToMarker<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
ClearDestruction<T>(PapyrusScript<T>)
Clears all effects of destruction from this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.ClearDestruction().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task ClearDestruction<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
CountLinkedRefChain<T>(PapyrusScript<T>, IPapyrusKeyword?, int)
jtucker, jduvall This function counts the number of linked refs that are in a linked Ref chain (ie object is linked to A, A is linked to B, etc. this then counts all the linked refs.) Often used in conjunction with GetNthLinkedRef() *** WARNING: Having a link ref chain that at any point loops back on itself and calling this function will result in very bad things. Don't do that!***
public static Task<int> CountLinkedRefChain<T>(this PapyrusScript<T> self, IPapyrusKeyword? apKeyword = null, int maxExpectedLinkedRefs = 100) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>apKeywordIPapyrusKeywordmaxExpectedLinkedRefsint
Returns
Type Parameters
T
CreateDetectionEvent<T>(PapyrusScript<T>, IActor, int)
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.CreateDetectionEvent(IActor, int).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task CreateDetectionEvent<T>(this PapyrusScript<T> self, IActor akOwner, int aiSoundLevel = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akOwnerIActoraiSoundLevelint
Returns
Type Parameters
T
CreateEnchantment<T>(PapyrusScript<T>, float, IReadOnlyCollection<MagicEffect>, IReadOnlyCollection<float>, IReadOnlyCollection<int>, IReadOnlyCollection<int>)
Creates a new enchantment on the item given the specified parameters all arrays must be the same size created enchantments are not purged from the save when removed or overwritten exact same enchantments are re-used by the game
public static Task CreateEnchantment<T>(this PapyrusScript<T> self, float maxCharge, IReadOnlyCollection<MagicEffect> effects, IReadOnlyCollection<float> magnitudes, IReadOnlyCollection<int> areas, IReadOnlyCollection<int> durations) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>maxChargefloateffectsIReadOnlyCollection<MagicEffect>magnitudesIReadOnlyCollection<float>areasIReadOnlyCollection<int>durationsIReadOnlyCollection<int>
Returns
Type Parameters
T
DamageObject<T>(PapyrusScript<T>, float)
Damages this object and advances the destruction stage - does not return until the object is damaged
public static Task DamageObject<T>(this PapyrusScript<T> self, float afDamage) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afDamagefloat
Returns
Type Parameters
T
DeleteWhenAble<T>(PapyrusScript<T>)
This will become a native function... it will wait until the object is not persisting, then delete itself.
public static Task DeleteWhenAble<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
Delete<T>(PapyrusScript<T>)
Delets this object
public static Task Delete<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
DisableLinkChain<T>(PapyrusScript<T>, IPapyrusKeyword?, bool)
Disables all of the references that are linked, in a chain, to this one.
public static Task DisableLinkChain<T>(this PapyrusScript<T> self, IPapyrusKeyword? apKeyword = null, bool abFadeOut = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>apKeywordIPapyrusKeywordabFadeOutbool
Returns
Type Parameters
T
DisableNoWait<T>(PapyrusScript<T>, bool)
Disables this object - fading out if requested. Does NOT wait for the fade or disable to finish
public static Task DisableNoWait<T>(this PapyrusScript<T> self, bool abFadeOut = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abFadeOutbool
Returns
Type Parameters
T
Disable<T>(PapyrusScript<T>, bool)
Disables this object - fading out if requested
public static Task Disable<T>(this PapyrusScript<T> self, bool abFadeOut = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abFadeOutbool
Returns
Type Parameters
T
DropObject<T>(PapyrusScript<T>, IForm, int)
Drops the specified object from this object's inventory
public static Task<ObjectReference?> DropObject<T>(this PapyrusScript<T> self, IForm akObject, int aiCount = 1) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akObjectIFormaiCountint
Returns
Type Parameters
T
EnableFastTravel<T>(PapyrusScript<T>, bool)
Enables the ability to fast travel to this marker - or disables it. Note that if you disable fast travel the player will see "You haven't discovered this location" as an error message
public static Task EnableFastTravel<T>(this PapyrusScript<T> self, bool abEnable = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abEnablebool
Returns
Type Parameters
T
EnableLinkChain<T>(PapyrusScript<T>, IPapyrusKeyword?)
Enables all of the references that are linked, in a chain, to this one.
public static Task EnableLinkChain<T>(this PapyrusScript<T> self, IPapyrusKeyword? apKeyword = null) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>apKeywordIPapyrusKeyword
Returns
Type Parameters
T
EnableNoWait<T>(PapyrusScript<T>, bool)
Enables this object - fading in if requested. Does NOT wait for the fade or enable to finish
public static Task EnableNoWait<T>(this PapyrusScript<T> self, bool abFadeIn = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abFadeInbool
Returns
Type Parameters
T
Enable<T>(PapyrusScript<T>, bool)
Enables this object - fading in if requested
public static Task Enable<T>(this PapyrusScript<T> self, bool abFadeIn = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abFadeInbool
Returns
Type Parameters
T
ForceAddRagdollToWorld<T>(PapyrusScript<T>)
public static Task ForceAddRagdollToWorld<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
ForceRemoveRagdollFromWorld<T>(PapyrusScript<T>)
public static Task ForceRemoveRagdollFromWorld<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetActorOwner<T>(PapyrusScript<T>)
Gets the actor that owns this object (or None if not owned by an Actor)
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetActorOwner().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<ActorBase?> GetActorOwner<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetAllForms<T>(PapyrusScript<T>, FormList)
Returns all base forms in the inventory/container into the specified FormList
public static Task GetAllForms<T>(this PapyrusScript<T> self, FormList toFill) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>toFillFormList
Returns
Type Parameters
T
GetAllItemsCount<T>(PapyrusScript<T>)
public static Task<int> GetAllItemsCount<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetAngleX<T>(PapyrusScript<T>)
Get the current X angle of this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetAngleX().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetAngleX<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetAngleY<T>(PapyrusScript<T>)
Get the current Y angle of this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetAngleY().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetAngleY<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetAngleZ<T>(PapyrusScript<T>)
Get the current Z angle of this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetAngleZ().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetAngleZ<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetAnimationVariableBool<T>(PapyrusScript<T>, string)
Get a variable from the reference's animation graph (if applicable). Bool version.
public static Task<bool> GetAnimationVariableBool<T>(this PapyrusScript<T> self, string arVariableName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestring
Returns
Type Parameters
T
GetAnimationVariableFloat<T>(PapyrusScript<T>, string)
Get a variable from the reference's animation graph (if applicable). Float version.
public static Task<float> GetAnimationVariableFloat<T>(this PapyrusScript<T> self, string arVariableName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestring
Returns
Type Parameters
T
GetAnimationVariableInt<T>(PapyrusScript<T>, string)
Get a variable from the reference's animation graph (if applicable). Int version.
public static Task<int> GetAnimationVariableInt<T>(this PapyrusScript<T> self, string arVariableName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestring
Returns
Type Parameters
T
GetBaseObject<T>(PapyrusScript<T>)
Returns the base object this reference represents
public static Task<Form?> GetBaseObject<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetContainerForms<T>(PapyrusScript<T>)
Returns all base forms from the container into a new array
public static Task<Form[]> GetContainerForms<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetCurrentDestructionStage<T>(PapyrusScript<T>)
Returns the object's current destruction stage
public static Task<int> GetCurrentDestructionStage<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetCurrentLocation<T>(PapyrusScript<T>)
Returns this reference's current location
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetCurrentLocation().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Location?> GetCurrentLocation<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetCurrentScene<T>(PapyrusScript<T>)
Returns the scene this reference is currently in - if any
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetCurrentScene().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Scene?> GetCurrentScene<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetDisplayName<T>(PapyrusScript<T>)
Returns the name of this reference this is the name that is displayed
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetDisplayFullName().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<string> GetDisplayName<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetDistance<T>(PapyrusScript<T>, IObjectReference)
Calculates the distance between this reference and another - both must either be in the same interior, or same worldspace
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetDistance(other, disabledRefs: true).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetDistance<T>(this PapyrusScript<T> self, IObjectReference akOther) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akOtherIObjectReference
Returns
Type Parameters
T
GetEditorLocation<T>(PapyrusScript<T>)
Returns this reference's editor location
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetEditorLocation().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Location?> GetEditorLocation<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetEnableParent<T>(PapyrusScript<T>)
Returns the enable parent object
public static Task<ObjectReference?> GetEnableParent<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetEnchantment<T>(PapyrusScript<T>)
Returns the player-made enchantment if there is one
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetEnchantment().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Enchantment?> GetEnchantment<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetFactionOwner<T>(PapyrusScript<T>)
Gets the faction that owns this object (or None if not owned by a Faction)
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetFactionOwner().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Faction?> GetFactionOwner<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetHeadingAngle<T>(PapyrusScript<T>, IObjectReference)
Gets the angle between this object's heading and the other object in degrees - in the range from -180 to 180
public static Task<float> GetHeadingAngle<T>(this PapyrusScript<T> self, IObjectReference akOther) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akOtherIObjectReference
Returns
Type Parameters
T
GetHeight<T>(PapyrusScript<T>)
Get the current height of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetHeight().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetHeight<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetItemCharge<T>(PapyrusScript<T>)
public static Task<float> GetItemCharge<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetItemCount<T>(PapyrusScript<T>, IForm)
Returns how many of the specified item is in this object reference's inventory
public static Task<int> GetItemCount<T>(this PapyrusScript<T> self, IForm akItem) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akItemIForm
Returns
Type Parameters
T
GetItemHealthPercent<T>(PapyrusScript<T>)
Returns the smithed health of this object reference (1.0 == 100%)
public static Task<float> GetItemHealthPercent<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetItemMaxCharge<T>(PapyrusScript<T>)
Works on any enchanted item
public static Task<float> GetItemMaxCharge<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetKey<T>(PapyrusScript<T>)
Returns the key base object that will unlock this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.Key.", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<Key?> GetKey<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetLength<T>(PapyrusScript<T>)
Get the current length of the object
public static Task<float> GetLength<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetLinkedRef<T>(PapyrusScript<T>, IPapyrusKeyword?)
Get our linked reference
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetLinkedRef(Keyword).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<ObjectReference?> GetLinkedRef<T>(this PapyrusScript<T> self, IPapyrusKeyword? apKeyword = null) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>apKeywordIPapyrusKeyword
Returns
Type Parameters
T
GetLockLevel<T>(PapyrusScript<T>)
Get the level of the lock on this object
public static Task<int> GetLockLevel<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetMass<T>(PapyrusScript<T>)
Get this object's mass
public static Task<float> GetMass<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetNthForm<T>(PapyrusScript<T>, int)
public static Task<Form?> GetNthForm<T>(this PapyrusScript<T> self, int index) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>indexint
Returns
Type Parameters
T
GetNthLinkedRef<T>(PapyrusScript<T>, int)
Returns the Nth linked ref from this reference (0 = self, 1 = GetLinkedRef, 2 = GetLinkedRef.GetLinkedRef, etc)
public static Task<ObjectReference?> GetNthLinkedRef<T>(this PapyrusScript<T> self, int aiLinkedRef) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>aiLinkedRefint
Returns
Type Parameters
T
GetNumItems<T>(PapyrusScript<T>)
public static Task<int> GetNumItems<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetNumReferenceAliases<T>(PapyrusScript<T>)
Returns the number of ref aliases holding this reference
public static Task<int> GetNumReferenceAliases<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetOpenState<T>(PapyrusScript<T>)
Gets the open state of this object. Which can be one of the following: 0 - None 1 - Open 2 - Opening 3 - Closed 4 - Closing
[Obsolete("Uses the Papyrus virtual machine. Prefer BGSOpenCloseForm.GetOpenState(IObjectReference).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<int> GetOpenState<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetParentCell<T>(PapyrusScript<T>)
Gets the cell this object is in
public static Task<Cell?> GetParentCell<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetPoison<T>(PapyrusScript<T>)
Returns the poison applied to the weapon
public static Task<Potion?> GetPoison<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetPositionX<T>(PapyrusScript<T>)
Get the current X position of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetPositionX().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetPositionX<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetPositionY<T>(PapyrusScript<T>)
Get the current Y position of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetPositionY().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetPositionY<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetPositionZ<T>(PapyrusScript<T>)
Get the current Z position of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetPositionZ().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetPositionZ<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetScale<T>(PapyrusScript<T>)
Get the current scale of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.GetScale().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<float> GetScale<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetSelfAsActor<T>(PapyrusScript<T>)
Returns self cast as an actor
public static Task<Actor?> GetSelfAsActor<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetTotalArmorWeight<T>(PapyrusScript<T>)
public static Task<float> GetTotalArmorWeight<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetTotalItemWeight<T>(PapyrusScript<T>)
public static Task<float> GetTotalItemWeight<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetTriggerObjectCount<T>(PapyrusScript<T>)
Get the number of objects inside this trigger (throws warning if not a triggger)
public static Task<int> GetTriggerObjectCount<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetVoiceType<T>(PapyrusScript<T>)
Gets the voice type for this reference. Will return None if not an actor or a talking activator
public static Task<VoiceType?> GetVoiceType<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetWidth<T>(PapyrusScript<T>)
Get the current width of the object
public static Task<float> GetWidth<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
GetWorldSpace<T>(PapyrusScript<T>)
Get this objects worldspace
public static Task<WorldSpace?> GetWorldSpace<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
HasEffectKeyword<T>(PapyrusScript<T>, IPapyrusKeyword)
Returns if this reference has an active effect coming from a magic effect with the specified keyword attached
public static Task<bool> HasEffectKeyword<T>(this PapyrusScript<T> self, IPapyrusKeyword akKeyword) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akKeywordIPapyrusKeyword
Returns
Type Parameters
T
HasNode<T>(PapyrusScript<T>, string)
Returns whether the reference has the given node
public static Task<bool> HasNode<T>(this PapyrusScript<T> self, string asNodeName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asNodeNamestring
Returns
Type Parameters
T
HasRefType<T>(PapyrusScript<T>, LocationRefType)
Returns if this reference has the specified location ref type
public static Task<bool> HasRefType<T>(this PapyrusScript<T> self, LocationRefType akRefType) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akRefTypeLocationRefType
Returns
Type Parameters
T
IgnoreFriendlyHits<T>(PapyrusScript<T>, bool)
Flags this reference as ignoring (or not ignoring) friendly hits
public static Task IgnoreFriendlyHits<T>(this PapyrusScript<T> self, bool abIgnore = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abIgnorebool
Returns
Type Parameters
T
InterruptCast<T>(PapyrusScript<T>)
Interrupts any spell-casting this object may be doing
public static Task InterruptCast<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
Is3DLoaded<T>(PapyrusScript<T>)
Returns if the 3d for this object is loaded or not
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.Is3DLoaded().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> Is3DLoaded<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsActivateChild<T>(PapyrusScript<T>, IObjectReference)
Checks to see if the passed in reference is the activate child of this one
public static Task<bool> IsActivateChild<T>(this PapyrusScript<T> self, IObjectReference akChild) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akChildIObjectReference
Returns
Type Parameters
T
IsActivationBlocked<T>(PapyrusScript<T>)
Checks to see if activation is currently blocked on this object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.IsActivationBlocked().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> IsActivationBlocked<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsContainerEmpty<T>(PapyrusScript<T>)
public static Task<bool> IsContainerEmpty<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsDeleted<T>(PapyrusScript<T>)
Is this object currently flagged for delete?
public static Task<bool> IsDeleted<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsDisabled<T>(PapyrusScript<T>)
Is this object currently disabled?
public static Task<bool> IsDisabled<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsEnabled<T>(PapyrusScript<T>)
Because Shane got tired of remembering which way to call this
public static Task<bool> IsEnabled<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsFurnitureInUse<T>(PapyrusScript<T>, bool)
Is any marker on this furniture in use?
public static Task<bool> IsFurnitureInUse<T>(this PapyrusScript<T> self, bool abIgnoreReserved = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abIgnoreReservedbool
Returns
Type Parameters
T
IsFurnitureMarkerInUse<T>(PapyrusScript<T>, int, bool)
Is a particular marker on this furniture in use?
public static Task<bool> IsFurnitureMarkerInUse<T>(this PapyrusScript<T> self, int aiMarker, bool abIgnoreReserved = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>aiMarkerintabIgnoreReservedbool
Returns
Type Parameters
T
IsHarvested<T>(PapyrusScript<T>)
public static Task<bool> IsHarvested<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsIgnoringFriendlyHits<T>(PapyrusScript<T>)
Is this object ignoring friendly hits?
public static Task<bool> IsIgnoringFriendlyHits<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsInDialogueWithPlayer<T>(PapyrusScript<T>)
Is this actor or talking activator currently talking to the player?
public static Task<bool> IsInDialogueWithPlayer<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsInInterior<T>(PapyrusScript<T>)
Returns !IsInExterior()
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.IsInInterior.", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> IsInInterior<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsInLocation<T>(PapyrusScript<T>, Location)
Convenience function to check if I'm in a location or any of its children
public static Task<bool> IsInLocation<T>(this PapyrusScript<T> self, Location akLocation) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akLocationLocation
Returns
Type Parameters
T
IsLockBroken<T>(PapyrusScript<T>)
Is the lock on this object broken?
public static Task<bool> IsLockBroken<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsLocked<T>(PapyrusScript<T>)
Is the lock on this object locked?
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.IsLocked().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> IsLocked<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsMapMarkerVisible<T>(PapyrusScript<T>)
Is the map marker visible?
public static Task<bool> IsMapMarkerVisible<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsNearPlayer<T>(PapyrusScript<T>)
Function to know if I'm near the player (whether I can be safely enabled or disabled)
public static Task<bool> IsNearPlayer<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
IsOffLimits<T>(PapyrusScript<T>)
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.IsOffLimits().", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> IsOffLimits<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
KnockAreaEffect<T>(PapyrusScript<T>, float, float)
Executes a knock effect to an area
public static Task KnockAreaEffect<T>(this PapyrusScript<T> self, float afMagnitude, float afRadius) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afMagnitudefloatafRadiusfloat
Returns
Type Parameters
T
Lock<T>(PapyrusScript<T>, bool, bool)
Lock/unlock this object. If told to lock it, it will add a lock if it doesn't have one. If locked/unlocked as the owner on a door, the adjoining cell will be made public/private as appropriate
public static Task Lock<T>(this PapyrusScript<T> self, bool abLock = true, bool abAsOwner = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abLockboolabAsOwnerbool
Returns
Type Parameters
T
MoveToIfUnloaded<T>(PapyrusScript<T>, IObjectReference, float, float, float)
Calls MoveTo if the calling ObjectReference is currently unloaded. Doesn't do anything if it IS loaded. No waiting or while loops. Returns true if it does the moveto
public static Task<bool> MoveToIfUnloaded<T>(this PapyrusScript<T> self, IObjectReference akTarget, float afXOffset = 0, float afYOffset = 0, float afZOffset = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReferenceafXOffsetfloatafYOffsetfloatafZOffsetfloat
Returns
Type Parameters
T
MoveToInteractionLocation<T>(PapyrusScript<T>, IObjectReference)
Moves this object to the position (and rotation) of the specified object's interaction position
public static Task MoveToInteractionLocation<T>(this PapyrusScript<T> self, IObjectReference akTarget) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReference
Returns
Type Parameters
T
MoveToMyEditorLocation<T>(PapyrusScript<T>)
Moves this object to its editor location
public static Task MoveToMyEditorLocation<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
MoveToNode<T>(PapyrusScript<T>, IObjectReference, string)
Moves this object to the position (and rotation) of the specified node on the specified object's 3D
public static Task MoveToNode<T>(this PapyrusScript<T> self, IObjectReference akTarget, string asNodeName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReferenceasNodeNamestring
Returns
Type Parameters
T
MoveToWhenUnloaded<T>(PapyrusScript<T>, IObjectReference, float, float, float)
DEPRECATED: DO NOT USE. Calls MoveTo if both the calling ObjectReference and the akTarget ObjectReference have current locations that are not loaded.
[Obsolete("ObjectReference.psc deprecates MoveToWhenUnloaded.", DiagnosticId = "SKYRIMFORGE0003")]
public static Task MoveToWhenUnloaded<T>(this PapyrusScript<T> self, IObjectReference akTarget, float afXOffset = 0, float afYOffset = 0, float afZOffset = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReferenceafXOffsetfloatafYOffsetfloatafZOffsetfloat
Returns
Type Parameters
T
MoveTo<T>(PapyrusScript<T>, IObjectReference, float, float, float, bool)
Moves this object to the position of the specified object, with an offset, and optionally matching its rotation
public static Task MoveTo<T>(this PapyrusScript<T> self, IObjectReference akTarget, float afXOffset = 0, float afYOffset = 0, float afZOffset = 0, bool abMatchRotation = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReferenceafXOffsetfloatafYOffsetfloatafZOffsetfloatabMatchRotationbool
Returns
Type Parameters
T
PlaceActorAtMe<T>(PapyrusScript<T>, ActorBase, int, EncounterZone?)
Create an actor at this object's location. Level mod is one of the following: 0 - Easy 1 - Medium 2 - Hard 3 - Boss 4 - None
public static Task<Actor?> PlaceActorAtMe<T>(this PapyrusScript<T> self, ActorBase akActorToPlace, int aiLevelMod = 4, EncounterZone? akZone = null) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akActorToPlaceActorBaseaiLevelModintakZoneEncounterZone?
Returns
Type Parameters
T
PlaceAtMe<T>(PapyrusScript<T>, IForm, int, bool, bool)
Create x copies of the passed in form (forcing them to persist if desired) and place them at our location, returning the last object created
public static Task<ObjectReference?> PlaceAtMe<T>(this PapyrusScript<T> self, IForm akFormToPlace, int aiCount = 1, bool abForcePersist = false, bool abInitiallyDisabled = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akFormToPlaceIFormaiCountintabForcePersistboolabInitiallyDisabledbool
Returns
Type Parameters
T
PlayAnimationAndWait<T>(PapyrusScript<T>, string, string)
Start the specified animation playing and wait for the specified event - returns true if succeeds
public static Task<bool> PlayAnimationAndWait<T>(this PapyrusScript<T> self, string asAnimation, string asEventName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asAnimationstringasEventNamestring
Returns
Type Parameters
T
PlayAnimation<T>(PapyrusScript<T>, string)
Start the specified animation playing - returns true if it succeeds
public static Task<bool> PlayAnimation<T>(this PapyrusScript<T> self, string asAnimation) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asAnimationstring
Returns
Type Parameters
T
PlayGamebryoAnimation<T>(PapyrusScript<T>, string, bool, float)
Start the specified Gamebryo animation playing - returns true if it succeeds
public static Task<bool> PlayGamebryoAnimation<T>(this PapyrusScript<T> self, string asAnimation, bool abStartOver = false, float afEaseInTime = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asAnimationstringabStartOverboolafEaseInTimefloat
Returns
Type Parameters
T
PlayImpactEffect<T>(PapyrusScript<T>, ImpactDataSet, string, float, float, float, float, bool, bool)
Play the specified impact effect - returns true if it succeeds
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.PlayImpactEffect(BGSImpactManager, ImpactDataSet, string, float, float, float, float, bool, bool).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> PlayImpactEffect<T>(this PapyrusScript<T> self, ImpactDataSet akImpactEffect, string asNodeName = "", float afPickDirX = 0, float afPickDirY = 0, float afPickDirZ = -1, float afPickLength = 512, bool abApplyNodeRotation = false, bool abUseNodeLocalRotation = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akImpactEffectImpactDataSetasNodeNamestringafPickDirXfloatafPickDirYfloatafPickDirZfloatafPickLengthfloatabApplyNodeRotationboolabUseNodeLocalRotationbool
Returns
Type Parameters
T
PlaySyncedAnimationAndWaitSS<T>(PapyrusScript<T>, string, string, IObjectReference, string, string)
Play two animations at once - one on this object, one on another object - and wait for both
public static Task<bool> PlaySyncedAnimationAndWaitSS<T>(this PapyrusScript<T> self, string asAnimation1, string asEvent1, IObjectReference akObj2, string asAnimation2, string asEvent2) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asAnimation1stringasEvent1stringakObj2IObjectReferenceasAnimation2stringasEvent2string
Returns
Type Parameters
T
PlaySyncedAnimationSS<T>(PapyrusScript<T>, string, IObjectReference, string)
Play two animations at once - one on this object, one on another object
public static Task<bool> PlaySyncedAnimationSS<T>(this PapyrusScript<T> self, string asAnimation1, IObjectReference akObj2, string asAnimation2) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asAnimation1stringakObj2IObjectReferenceasAnimation2string
Returns
Type Parameters
T
PlayTerrainEffect<T>(PapyrusScript<T>, string, string)
Play a terrain effect that is attached to the specified bone of this object.
public static Task PlayTerrainEffect<T>(this PapyrusScript<T> self, string asEffectModelName, string asAttachBoneName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asEffectModelNamestringasAttachBoneNamestring
Returns
Type Parameters
T
ProcessTrapHit<T>(PapyrusScript<T>, IObjectReference, float, float, float, float, float, float, float, float, int, float)
Tells this object to process a trap hitting it
public static Task ProcessTrapHit<T>(this PapyrusScript<T> self, IObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTrapIObjectReferenceafDamagefloatafPushbackfloatafXVelfloatafYVelfloatafZVelfloatafXPosfloatafYPosfloatafZPosfloataeMaterialintafStaggerfloat
Returns
Type Parameters
T
PushActorAway<T>(PapyrusScript<T>, IActor, float)
Pushes the passed-in actor away from this object, using the passed in knockback force to determine the speed
public static Task PushActorAway<T>(this PapyrusScript<T> self, IActor akActorToPush, float aiKnockbackForce) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akActorToPushIActoraiKnockbackForcefloat
Returns
Type Parameters
T
RampRumble<T>(PapyrusScript<T>, float, float, float)
public static Task<bool> RampRumble<T>(this PapyrusScript<T> self, float power = 0.5, float duration = 0.25, float falloff = 1600) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>powerfloatdurationfloatfallofffloat
Returns
Type Parameters
T
RemoveAllInventoryEventFilters<T>(PapyrusScript<T>)
Remove all inventory event filters from this reference - all item added/removed events will now be received
public static Task RemoveAllInventoryEventFilters<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
RemoveAllItems<T>(PapyrusScript<T>, IObjectReference?, bool, bool)
Removes all items from this container, transferring it to the other object if passed
public static Task RemoveAllItems<T>(this PapyrusScript<T> self, IObjectReference? akTransferTo = null, bool abKeepOwnership = false, bool abRemoveQuestItems = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTransferToIObjectReferenceabKeepOwnershipboolabRemoveQuestItemsbool
Returns
Type Parameters
T
RemoveAllStolenItems<T>(PapyrusScript<T>, IObjectReference)
public static Task RemoveAllStolenItems<T>(this PapyrusScript<T> self, IObjectReference akTransferTo) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTransferToIObjectReference
Returns
Type Parameters
T
RemoveDependentAnimatedObjectReference<T>(PapyrusScript<T>, IObjectReference)
Removes a previously added dependent object This function should be used only with a coder supervision. It is left undocumented because it can cause dangling pointers as well as very broken functionality for the dependent object if used improperly.
public static Task<bool> RemoveDependentAnimatedObjectReference<T>(this PapyrusScript<T> self, IObjectReference akDependent) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akDependentIObjectReference
Returns
Type Parameters
T
RemoveInventoryEventFilter<T>(PapyrusScript<T>, IForm)
Remove an inventory event filter from this reference. Item added/removed events matching the specified form (or in the specified form list) will no longer be let through.
public static Task RemoveInventoryEventFilter<T>(this PapyrusScript<T> self, IForm akFilter) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akFilterIForm
Returns
Type Parameters
T
RemoveItem<T>(PapyrusScript<T>, IForm, int, bool, IObjectReference?)
Removes the specified item from this object reference's inventory
public static Task RemoveItem<T>(this PapyrusScript<T> self, IForm akItemToRemove, int aiCount = 1, bool abSilent = false, IObjectReference? akOtherContainer = null) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akItemToRemoveIFormaiCountintabSilentboolakOtherContainerIObjectReference
Returns
Type Parameters
T
ResetInventory<T>(PapyrusScript<T>)
public static Task ResetInventory<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
Reset<T>(PapyrusScript<T>, IObjectReference?)
Resets this object, optional place the object at the new target
public static Task Reset<T>(this PapyrusScript<T> self, IObjectReference? akTarget = null) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTargetIObjectReference
Returns
Type Parameters
T
Say<T>(PapyrusScript<T>, Topic, IActor?, bool)
Has this object "say" the specified topic, as if spoken by the specified actor (if one is provided, and potentially "speaking" in the player's head.
public static Task Say<T>(this PapyrusScript<T> self, Topic akTopicToSay, IActor? akActorToSpeakAs = null, bool abSpeakInPlayersHead = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akTopicToSayTopicakActorToSpeakAsIActorabSpeakInPlayersHeadbool
Returns
Type Parameters
T
SendStealAlarm<T>(PapyrusScript<T>, IActor)
Has this object behave as if the specified actor attempted to steal it
public static Task SendStealAlarm<T>(this PapyrusScript<T> self, IActor akThief) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akThiefIActor
Returns
Type Parameters
T
SetActorCause<T>(PapyrusScript<T>, IActor)
Sets this object's actor cause to the specified actor
public static Task SetActorCause<T>(this PapyrusScript<T> self, IActor akActor) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akActorIActor
Returns
Type Parameters
T
SetActorOwner<T>(PapyrusScript<T>, ActorBase)
Sets this object's owner to the specified actor base - None means to remove ownership
public static Task SetActorOwner<T>(this PapyrusScript<T> self, ActorBase akActorBase) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akActorBaseActorBase
Returns
Type Parameters
T
SetAngle<T>(PapyrusScript<T>, float, float, float)
Set the orientation of the object (angles are in degrees)
public static Task SetAngle<T>(this PapyrusScript<T> self, float afXAngle, float afYAngle, float afZAngle) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afXAnglefloatafYAnglefloatafZAnglefloat
Returns
Type Parameters
T
SetAnimationVariableBool<T>(PapyrusScript<T>, string, bool)
Set a variable on the reference's animation graph (if applicable). Bool version.
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetAnimationVariableBool(string, bool).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task SetAnimationVariableBool<T>(this PapyrusScript<T> self, string arVariableName, bool abNewValue) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestringabNewValuebool
Returns
Type Parameters
T
SetAnimationVariableFloat<T>(PapyrusScript<T>, string, float)
Set a variable on the reference's animation graph (if applicable). Float version.
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetAnimationVariableFloat(string, float).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task SetAnimationVariableFloat<T>(this PapyrusScript<T> self, string arVariableName, float afNewValue) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestringafNewValuefloat
Returns
Type Parameters
T
SetAnimationVariableInt<T>(PapyrusScript<T>, string, int)
Set a variable on the reference's animation graph (if applicable). Int version.
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetAnimationVariableInt(string, int).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task SetAnimationVariableInt<T>(this PapyrusScript<T> self, string arVariableName, int aiNewValue) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arVariableNamestringaiNewValueint
Returns
Type Parameters
T
SetContainerAllowStolenItems<T>(PapyrusScript<T>, bool)
public static Task SetContainerAllowStolenItems<T>(this PapyrusScript<T> self, bool setAllowStolenItems) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>setAllowStolenItemsbool
Returns
Type Parameters
T
SetDestroyed<T>(PapyrusScript<T>, bool)
Sets this object as destroyed or not
public static Task SetDestroyed<T>(this PapyrusScript<T> self, bool abDestroyed = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abDestroyedbool
Returns
Type Parameters
T
SetDisplayName<T>(PapyrusScript<T>, string, bool)
Sets a reference's display name returns false if force is false and the reference is held by an alias using 'Stored Text' or 'Uses Stored Text' Text Replacement does not use this name and may be lost if forced
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetDisplayName(string, bool).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task<bool> SetDisplayName<T>(this PapyrusScript<T> self, string name, bool force = false) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>namestringforcebool
Returns
Type Parameters
T
Remarks
SkyrimForge Note: On a just-created Actor, this returns true but changes nothing until Is3DLoaded() reports it loaded. ObjectReference.SetDisplayName applies the name at once.
SetEnchantment<T>(PapyrusScript<T>, Enchantment, float)
Changes an item's player-made enchantment to something else None enchantment will remove the existing enchantment does not delete the custom enchantment, only removes it
public static Task SetEnchantment<T>(this PapyrusScript<T> self, Enchantment source, float maxCharge) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>sourceEnchantmentmaxChargefloat
Returns
Type Parameters
T
SetFactionOwner<T>(PapyrusScript<T>, Faction)
Sets this object's owner to the specified faction
public static Task SetFactionOwner<T>(this PapyrusScript<T> self, Faction akFaction) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akFactionFaction
Returns
Type Parameters
T
SetHarvested<T>(PapyrusScript<T>, bool)
public static Task SetHarvested<T>(this PapyrusScript<T> self, bool harvested) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>harvestedbool
Returns
Type Parameters
T
SetItemCharge<T>(PapyrusScript<T>, float)
public static Task SetItemCharge<T>(this PapyrusScript<T> self, float charge) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>chargefloat
Returns
Type Parameters
T
SetItemHealthPercent<T>(PapyrusScript<T>, float)
Tempering
public static Task SetItemHealthPercent<T>(this PapyrusScript<T> self, float health) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>healthfloat
Returns
Type Parameters
T
SetItemMaxCharge<T>(PapyrusScript<T>, float)
Only works on ObjectReferences that have user-enchants
public static Task SetItemMaxCharge<T>(this PapyrusScript<T> self, float maxCharge) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>maxChargefloat
Returns
Type Parameters
T
SetLockLevel<T>(PapyrusScript<T>, int)
Sets the lock level on this object. Will add an unlocked lock to it if it doesn't have one
public static Task SetLockLevel<T>(this PapyrusScript<T> self, int aiLockLevel) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>aiLockLevelint
Returns
Type Parameters
T
SetMotionType<T>(PapyrusScript<T>, int, bool)
Sets the motion type of the reference aeMotionType: The type of motion (see properties at end of file) abAllowActivate: When setting to a dynamic type, allows the simulation to be activated
public static Task SetMotionType<T>(this PapyrusScript<T> self, int aeMotionType, bool abAllowActivate = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>aeMotionTypeintabAllowActivatebool
Returns
Type Parameters
T
SetNoFavorAllowed<T>(PapyrusScript<T>, bool)
Sets this object reference as one that teammates will refuse to do favors on
public static Task SetNoFavorAllowed<T>(this PapyrusScript<T> self, bool abNoFavor = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abNoFavorbool
Returns
Type Parameters
T
SetOpen<T>(PapyrusScript<T>, bool)
Opens/closes this object
public static Task SetOpen<T>(this PapyrusScript<T> self, bool abOpen = true) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>abOpenbool
Returns
Type Parameters
T
SetPosition<T>(PapyrusScript<T>, float, float, float)
Set the position of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetPosition(float, float, float).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task SetPosition<T>(this PapyrusScript<T> self, float afX, float afY, float afZ) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afXfloatafYfloatafZfloat
Returns
Type Parameters
T
SetScale<T>(PapyrusScript<T>, float)
Set the current scale of the object
[Obsolete("Uses the Papyrus virtual machine. Prefer ObjectReference.SetScale(float).", DiagnosticId = "SKYRIMFORGE0002")]
public static Task SetScale<T>(this PapyrusScript<T> self, float afScale) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afScalefloat
Returns
Type Parameters
T
SplineTranslateToRefNode<T>(PapyrusScript<T>, IObjectReference, string, float, float, float)
Makes the reference translate to the target node's ref/orient on a spline at the given speed
public static Task SplineTranslateToRefNode<T>(this PapyrusScript<T> self, IObjectReference arTarget, string arNodeName, float afTangentMagnitude, float afSpeed, float afMaxRotationSpeed = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arTargetIObjectReferencearNodeNamestringafTangentMagnitudefloatafSpeedfloatafMaxRotationSpeedfloat
Returns
Type Parameters
T
SplineTranslateToRef<T>(PapyrusScript<T>, IObjectReference, float, float, float)
Makes the reference translate to the target ref position/orient on a spline at the given speed
public static Task SplineTranslateToRef<T>(this PapyrusScript<T> self, IObjectReference arTarget, float afTangentMagnitude, float afSpeed, float afMaxRotationSpeed = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arTargetIObjectReferenceafTangentMagnitudefloatafSpeedfloatafMaxRotationSpeedfloat
Returns
Type Parameters
T
SplineTranslateTo<T>(PapyrusScript<T>, float, float, float, float, float, float, float, float, float)
Makes the reference translate to the given position/orientation on a spline
public static Task SplineTranslateTo<T>(this PapyrusScript<T> self, float afX, float afY, float afZ, float afXAngle, float afYAngle, float afZAngle, float afTangentMagnitude, float afSpeed, float afMaxRotationSpeed = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afXfloatafYfloatafZfloatafXAnglefloatafYAnglefloatafZAnglefloatafTangentMagnitudefloatafSpeedfloatafMaxRotationSpeedfloat
Returns
Type Parameters
T
StopTranslation<T>(PapyrusScript<T>)
Stops the reference from moving
public static Task StopTranslation<T>(this PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
TetherToHorse<T>(PapyrusScript<T>, IObjectReference)
Tether a prisoner cart to the given horse.
public static Task TetherToHorse<T>(this PapyrusScript<T> self, IObjectReference akHorse) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>akHorseIObjectReference
Returns
Type Parameters
T
TranslateToRef<T>(PapyrusScript<T>, IObjectReference, float, float)
Makes the reference translate to the target ref position/orient at the given speed
public static Task TranslateToRef<T>(this PapyrusScript<T> self, IObjectReference arTarget, float afSpeed, float afMaxRotationSpeed = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>arTargetIObjectReferenceafSpeedfloatafMaxRotationSpeedfloat
Returns
Type Parameters
T
TranslateTo<T>(PapyrusScript<T>, float, float, float, float, float, float, float, float)
Makes the reference translate to the given position/orientation Note: Rotation speed is entirely dependent on the length of the path and the movement speed that is, the rotation will happen such that the reference reaches the goal orientation at the end of the translation.
public static Task TranslateTo<T>(this PapyrusScript<T> self, float afX, float afY, float afZ, float afXAngle, float afYAngle, float afZAngle, float afSpeed, float afMaxRotationSpeed = 0) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>afXfloatafYfloatafZfloatafXAnglefloatafYAnglefloatafZAnglefloatafSpeedfloatafMaxRotationSpeedfloat
Returns
Type Parameters
T
WaitForAnimationEvent<T>(PapyrusScript<T>, string)
Waits for the animation graph to send the specified event
public static Task<bool> WaitForAnimationEvent<T>(this PapyrusScript<T> self, string asEventName) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>asEventNamestring
Returns
Type Parameters
T
get_X<T>(PapyrusScript<T>)
Property to obtain the current X position of the object
public static Task<float> get_X<T>(PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
get_Y<T>(PapyrusScript<T>)
Property to obtain the current Y position of the object
public static Task<float> get_Y<T>(PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T
get_Z<T>(PapyrusScript<T>)
Property to obtain the current Z position of the object
public static Task<float> get_Z<T>(PapyrusScript<T> self) where T : notnull, IObjectReference
Parameters
selfPapyrusScript<T>
Returns
Type Parameters
T