Difference between revisions of "ObjectReference Script"

532 bytes added ,  19:23, 18 June 2018
m
→‎Member Functions: Corrected issues with wiki markup and function alphabetization.
imported>ShadeMe
m (Typo fix)
imported>Homecom
m (→‎Member Functions: Corrected issues with wiki markup and function alphabetization.)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Line 42: Line 38:
*Function [[AddToMap - ObjectReference|AddToMap]](bool abAllowFastTravel)
*Function [[AddToMap - ObjectReference|AddToMap]](bool abAllowFastTravel)
**Adds this map marker to the map, optionally making it available for fast travel.
**Adds this map marker to the map, optionally making it available for fast travel.
*Function [[ApplyConveyorBelt - ObjectReference]]( string aTarget, float aLinVelX, float aLinVelY, float aLinVelZ, bool abOn, bool abReverse )
*Function [[ApplyConveyorBelt - ObjectReference|ApplyConveyorBelt]](string aTarget, float aLinVelX, float aLinVelY, float aLinVelZ, bool abOn, bool abReverse)
**Applies a conveyor belt to the reference
**Applies a conveyor belt to the reference
*Function [[ApplyFanMotor - ObjectReference|ApplyFanMotor]](string aTarget, float aAxisX, float aAxisY, float aAxisZ, float aForce, bool abOn)
*Function [[ApplyFanMotor - ObjectReference|ApplyFanMotor]](string aTarget, float aAxisX, float aAxisY, float aAxisZ, float aForce, bool abOn)
Line 64: Line 60:
*Function [[ClearDestruction - ObjectReference|ClearDestruction]]()
*Function [[ClearDestruction - ObjectReference|ClearDestruction]]()
**Clears all effects of destruction from this object.
**Clears all effects of destruction from this object.
*Function [[ConveyorBeltOn - ObjectReference]](bool abOn)
*Function [[ConveyorBeltOn - ObjectReference|ConveyorBeltOn]](bool abOn)
**Sets the On/Off state of the conveyor belt.
**Sets the On/Off state of the conveyor belt.
*int Function [[CountActorsLinkedToMe - ObjectReference|CountActorsLinkedToMe]](Keyword apLinkKeyword, Keyword apExcludeKeyword)
*int Function [[CountActorsLinkedToMe - ObjectReference|CountActorsLinkedToMe]](Keyword apLinkKeyword, Keyword apExcludeKeyword)
Line 170: Line 166:
*ObjectReference[] Function [[GetLinkedRefChain - ObjectReference|GetLinkedRefChain]](Keyword apKeyword, int iMaxExpectedLinkedRefs)
*ObjectReference[] Function [[GetLinkedRefChain - ObjectReference|GetLinkedRefChain]](Keyword apKeyword, int iMaxExpectedLinkedRefs)
**Returns an array listing every linked ref in a chain from this one.
**Returns an array listing every linked ref in a chain from this one.
*ObjectReference[] Function [[GetLinkedRefChildren - ObjectReference|GetLinkedRefChildren]](keyword apKeyword ) native
*ObjectReference[] Function [[GetLinkedRefChildren - ObjectReference|GetLinkedRefChildren]](keyword apKeyword) native
**Returns an array of linked reference children which were linked using the given keyword
**Returns an array of linked reference children which were linked using the given keyword
*int Function [[GetLockLevel - ObjectReference|GetLockLevel]]()
*int Function [[GetLockLevel - ObjectReference|GetLockLevel]]()
Line 256: Line 252:
*bool Function [[IsCreated - ObjectReference|IsCreated]]()
*bool Function [[IsCreated - ObjectReference|IsCreated]]()
**Was this object created in-game?
**Was this object created in-game?
*bool Function [[IsConveyorBeltOn - ObjectReference]]()
*bool Function [[IsConveyorBeltOn - ObjectReference|IsConveyorBeltOn]]()
**Get conveyor belt on/off state
**Get conveyor belt on/off state
*bool Function [[IsDeleted - ObjectReference|IsDeleted]]()
*bool Function [[IsDeleted - ObjectReference|IsDeleted]]()
Line 276: Line 272:
*bool Function [[IsInDialogueWithPlayer - ObjectReference|IsInDialogueWithPlayer]]()
*bool Function [[IsInDialogueWithPlayer - ObjectReference|IsInDialogueWithPlayer]]()
**Is this actor or talking activator currently talking to the player?
**Is this actor or talking activator currently talking to the player?
*bool Function [[IsInInterior - ObjectReference|IsInInterior ]] ()
*bool Function [[IsInInterior - ObjectReference|IsInInterior]]()
**Returns true if the object is in an interior cell.
**Returns true if the object is in an interior cell.
*bool Function [[IsInLocation - ObjectReference|IsInLocation]] (Location akLocation)
*bool Function [[IsInLocation - ObjectReference|IsInLocation]](Location akLocation)
**Returns true if the object is currently in that location or a child of that location.
**Returns true if the object is currently in that location or a child of that location.
*bool Function [[IsLockBroken - ObjectReference|IsLockBroken]]()
*bool Function [[IsLockBroken - ObjectReference|IsLockBroken]]()
Line 286: Line 282:
*bool Function [[IsMapMarkerVisible - ObjectReference|IsMapMarkerVisible]]()
*bool Function [[IsMapMarkerVisible - ObjectReference|IsMapMarkerVisible]]()
**Is this map marker visible to the player?
**Is this map marker visible to the player?
*bool Function [[IsNearPlayer - ObjectReference|IsNearPlayer]]()
**A quick-and-dirty function to tell if this object is safe to enable or disable
*bool Function [[IsOwnedBy - ObjectReference|IsOwnedBy]](Actor akOwner)
*bool Function [[IsOwnedBy - ObjectReference|IsOwnedBy]](Actor akOwner)
**Is this ref owned by the given actor?
**Is this ref owned by the given actor?
*bool Function [[IsNearPlayer - ObjectReference|IsNearPlayer]]()
**A quick-and-dirty function to tell if this object is safe to enable or disable
*bool Function [[IsPowered - ObjectReference|IsPowered]]()
*bool Function [[IsPowered - ObjectReference|IsPowered]]()
**Is this object currently powered?
**Is this object currently powered?
Line 340: Line 336:
*bool Function [[PlayGamebryoAnimation - ObjectReference|PlayGamebryoAnimation]](string asAnimation, bool abStartOver, float afEaseInTime)
*bool Function [[PlayGamebryoAnimation - ObjectReference|PlayGamebryoAnimation]](string asAnimation, bool abStartOver, float afEaseInTime)
**Plays a legacy nif file based animation
**Plays a legacy nif file based animation
*bool Function [[PlayImpactEffect - ObjectReference|PlayImpactEffect]] (ImpactDataSet akImpactEffect, string asNodeName, float afPickDirX, float afPickDirY, float afPickDirZ, float afPickLength, bool abApplyNodeRotation, bool abUseNodeLocalRotation)
*bool Function [[PlayImpactEffect - ObjectReference|PlayImpactEffect]](ImpactDataSet akImpactEffect, string asNodeName, float afPickDirX, float afPickDirY, float afPickDirZ, float afPickLength, bool abApplyNodeRotation, bool abUseNodeLocalRotation)
**Plays an impact effect.
**Plays an impact effect.
*bool Function [[PlaySyncedAnimationAndWaitSS - ObjectReference|PlaySyncedAnimationAndWaitSS]](string asAnimation1, string asEvent1, ObjectReference akObj2, string asAnimation2, string asEvent2)
*bool Function [[PlaySyncedAnimationAndWaitSS - ObjectReference|PlaySyncedAnimationAndWaitSS]](string asAnimation1, string asEvent1, ObjectReference akObj2, string asAnimation2, string asEvent2)
Line 346: Line 342:
*bool Function [[PlaySyncedAnimationSS - ObjectReference|PlaySyncedAnimationSS]](string asAnimation1, ObjectReference akObj2, string asAnimation2)
*bool Function [[PlaySyncedAnimationSS - ObjectReference|PlaySyncedAnimationSS]](string asAnimation1, ObjectReference akObj2, string asAnimation2)
**Plays two animations simultaneously.
**Plays two animations simultaneously.
*Function [[PlayTerrainEffect - ObjectReference | PlayTerrainEffect]] (string asEffectModelName, string asAttachBoneName)
*Function [[PlayTerrainEffect - ObjectReference|PlayTerrainEffect]](string asEffectModelName, string asAttachBoneName)
**Plays a terrain effect.
**Plays a terrain effect.
*Function [[PreloadExteriorCell - ObjectReference | PreloadExteriorCell]] ()
*Function [[PreloadExteriorCell - ObjectReference|PreloadExteriorCell]]()
**Preloads the single exterior cell containing the ref.
**Preloads the single exterior cell containing the ref.
*Function [[PreloadTargetArea - ObjectReference | PreloadTargetArea]] ()
*Function [[PreloadTargetArea - ObjectReference|PreloadTargetArea]]()
**Preloads the target area for the ref.
**Preloads the target area for the ref.
*Function [[ProcessTrapHit - ObjectReference|ProcessTrapHit]](ObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger)
*Function [[ProcessTrapHit - ObjectReference|ProcessTrapHit]](ObjectReference akTrap, float afDamage, float afPushback, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, float afStagger)
Line 363: Line 359:
*Function [[RemoveAllItems - ObjectReference|RemoveAllItems]](ObjectReference akTransferTo, bool abKeepOwnership)
*Function [[RemoveAllItems - ObjectReference|RemoveAllItems]](ObjectReference akTransferTo, bool abKeepOwnership)
**Removes all items from this container, optionall transferring them to another one.
**Removes all items from this container, optionall transferring them to another one.
*Function [[RemoveAllMods - ObjectReference|RemoveAllMods]]()
**Removes every single mod attached to this reference. (Warning: For some actors/items this will leave no rendering geometry at all!)
*Function [[RemoveAllModsFromInventoryItem - ObjectReference|RemoveAllModsFromInventoryItem]](Form akItem)
**Removes every single mod attach to an item in this reference's inventory. Note: Some items won't have any geometry if you do this (handmade guns, for example).
*Function [[RemoveComponents - ObjectReference|RemoveComponents]](Component akComponent, int aiCount, bool abSilent = false) native
*Function [[RemoveComponents - ObjectReference|RemoveComponents]](Component akComponent, int aiCount, bool abSilent = false) native
**Removes components from the container, scrapping as necessary and returning change.
**Removes components from the container, scrapping as necessary and returning change.
*Function [[RemoveItem - ObjectReference|RemoveItem]](Form akItemToRemove, int aiCount, bool abSilent, ObjectReference akOtherContainer)
*Function [[RemoveItem - ObjectReference|RemoveItem]](Form akItemToRemove, int aiCount, bool abSilent, ObjectReference akOtherContainer)
**Removes the passed in item from this object's inventory.
**Removes the passed in item from this object's inventory.
*Function Function [[RemoveItemByComponent - ObjectReference|RemoveItemByComponent]](Form akComponentToRemove, int aiCount, bool abSilent, ObjectReference akOtherContainer)
*Function [[RemoveItemByComponent - ObjectReference|RemoveItemByComponent]](Form akComponentToRemove, int aiCount, bool abSilent, ObjectReference akOtherContainer)
**Removes items from this object's inventory containing at least the number of components specified, potentially more.
**Removes items from this object's inventory containing at least the number of components specified, potentially more.
*Function [[RemoveKeyword - ObjectReference|RemoveKeyword]](Keyword akKeyword)
*Function [[RemoveKeyword - ObjectReference|RemoveKeyword]](Keyword akKeyword)
**Removes specified [[Keyword Script|Keyword]] from this reference's list of keywords. Returns true if successfully removed.
**Removes specified [[Keyword Script|Keyword]] from this reference's list of keywords. Returns true if successfully removed.
*Function [[RemoveAllMods - ObjectReference|RemoveAllMods]]()
**Removes every single mod attached to this reference (warning, for some actors/items this will leave no rendering geometry at all!)
*Function [[RemoveAllModsFromInventoryItem - ObjectReference|RemoveAllModsFromInventoryItem]](Form akItem)
**Removes every single mod attach to an item in this reference's inventory. Note that some items won't have any geometry if you do this (ie, handmade guns)
*Function [[RemoveMod - ObjectReference|RemoveMod]](ObjectMod akMod)
*Function [[RemoveMod - ObjectReference|RemoveMod]](ObjectMod akMod)
**Remove the requested mod from the reference
**Remove the requested mod from the reference
Line 389: Line 385:
*Function [[ResumeAudio - ObjectReference|ResumeAudio]]()
*Function [[ResumeAudio - ObjectReference|ResumeAudio]]()
** Resumes paused audio on this reference.
** Resumes paused audio on this reference.
*Function [[ReverseConveyorBelt - ObjectReference]](bool abReverse)
*Function [[ReverseConveyorBelt - ObjectReference|ReverseConveyorBelt]](bool abReverse)
** Sets reverse state of conveyor belt
** Sets reverse state of conveyor belt
*Function [[Say - ObjectReference|Say]](Topic akTopicToSay, Actor akActorToSpeakAs, bool abSpeakInPlayersHead, ObjectReference akTarget)
*Function [[Say - ObjectReference|Say]](Topic akTopicToSay, Actor akActorToSpeakAs, bool abSpeakInPlayersHead, ObjectReference akTarget)
Line 417: Line 413:
*Function [[SetAttractionActive - ObjectReference|SetAttractionActive]](Keyword apKeyword, bool abActive)
*Function [[SetAttractionActive - ObjectReference|SetAttractionActive]](Keyword apKeyword, bool abActive)
**Enable/disable this object from sending attraction story manager events.
**Enable/disable this object from sending attraction story manager events.
*Function [[SetConveyorBeltVelocity - ObjectReference]]( float aLinVelX, float aLinVelY, float aLinVelZ )
*Function [[SetConveyorBeltVelocity - ObjectReference|SetConveyorBeltVelocity]](float aLinVelX, float aLinVelY, float aLinVelZ)
**Sets local-space linear velocity of the conveyor belt
**Sets local-space linear velocity of the conveyor belt
*Function [[SetDestroyed - ObjectReference|SetDestroyed]](bool abDestroyed)
*Function [[SetDestroyed - ObjectReference|SetDestroyed]](bool abDestroyed)
Line 483: Line 479:


== F4SE Member Functions ==
== F4SE Member Functions ==
*MatSwap:RemapData[] Function [[ApplyMaterialSwap - ObjectReference|ApplyMaterialSwap]](MatSwap mSwap, bool renameMaterial = false)
**Applies a material swap to this reference, optionally renaming the material.
*ObjectReference Function [[AttachWire - ObjectReference|AttachWire]](ObjectReference akRef, Form akSpline = None)
*ObjectReference Function [[AttachWire - ObjectReference|AttachWire]](ObjectReference akRef, Form akSpline = None)
**Attach akSpline between two ObjectReferences, and return the created spline.
**Attach akSpline between two ObjectReferences, and return the created spline.
Line 506: Line 505:
*float Function [[GetInventoryWeight - ObjectReference|GetInventoryWeight]]()
*float Function [[GetInventoryWeight - ObjectReference|GetInventoryWeight]]()
**Returns inventory weight for this reference.
**Returns inventory weight for this reference.
*MatSwap Function [[GetMaterialSwap - ObjectReference|GetMaterialSwap]]()
**Gets the material swap for this reference.
*Function [[SetMaterialSwap - ObjectReference|SetMaterialSwap]](MatSwap mSwap)
**Sets the material swap for this reference.


*bool Function [[TransmitConnectedPower - ObjectReference|TransmitConnectedPower]]()
*bool Function [[TransmitConnectedPower - ObjectReference|TransmitConnectedPower]]()
Line 595: Line 600:
*Event [[OnWorkshopObjectRepaired - ObjectReference|OnWorkshopObjectRepaired]](ObjectReference akReference)
*Event [[OnWorkshopObjectRepaired - ObjectReference|OnWorkshopObjectRepaired]](ObjectReference akReference)
**Event received when a damaged workshop item is repaired
**Event received when a damaged workshop item is repaired
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
Anonymous user