Difference between revisions of "ObjectReference Script"

2,024 bytes added ,  19:23, 18 June 2018
m
→‎Member Functions: Corrected issues with wiki markup and function alphabetization.
imported>Qazaaq
(Added F4SE member)
imported>Homecom
m (→‎Member Functions: Corrected issues with wiki markup and function alphabetization.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Line 13: Line 9:


== Properties ==
== Properties ==
*float X [read-only]: The current X position of the reference.
*Position
*float Y [read-only]: The current Y position of the reference.
**float X [read-only]: The current X position of the reference.
*float Z [read-only]: The current Z position of the reference.
**float Y [read-only]: The current Y position of the reference.
**float Z [read-only]: The current Z position of the reference.
*Motion
**int Motion_Fixed [0]:
**int Motion_Dynamic [1]:
**int Motion_Keyframed [2]:
 
== F4SE Structs ==
*Struct [[ConnectPoint Struct - ObjectReference|ConnectPoint]]
**A structure that holds property information about a connect point on a 3D model.


== Global Functions ==
== Global Functions ==
Line 30: Line 35:
**Adds passed in [[Keyword Script|Keyword]] to this reference's list of keywords.
**Adds passed in [[Keyword Script|Keyword]] to this reference's list of keywords.
*Function [[AddTextReplacementData - ObjectReference|AddTextReplacementData]](string asTokenLabel, Form akForm)
*Function [[AddTextReplacementData - ObjectReference|AddTextReplacementData]](string asTokenLabel, Form akForm)
**Adds this map marker to the map, optionally making it available for fast travel.
**Adds an association between the given string and the given form for text replacement usage.
*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 55: 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 161: 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 247: 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 267: 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 277: 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 331: 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 337: 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 354: 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 380: 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 408: 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 474: 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)
**Attach akSpline between two ObjectReferences, and return the created spline.
*ObjectReference Function [[CreateWire - ObjectReference|CreateWire]](ObjectReference akRef, Form akSpline = None)
**Attach akSpline between two ObjectReferences, then enable and return the created spline.
*ObjectMod[] Function [[GetAllMods - ObjectReference|GetAllMods]]()
*ObjectMod[] Function [[GetAllMods - ObjectReference|GetAllMods]]()
**Returns all the mods for this reference.
**Returns all the mods for this reference.
*ConnectPoint[] Function [[GetConnectPoints - ObjectReference|GetConnectPoints]]()
**Returns all the connect points for this reference's 3D model.
*ObjectReference[] Function [[GetConnectedObjects - ObjectReference|GetConnectedObjects]]()
**Returns the ObjectReferences this object is connected to.
*string Function [[GetDisplayName - ObjectReference|GetDisplayName]]()
**Returns the display name for this reference.
*Form[] Function [[GetInventoryItems - ObjectReference|GetInventoryItems]]()
**Returns all the inventory items for this reference.
*float Function [[GetInventoryWeight - ObjectReference|GetInventoryWeight]]()
**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]]()
**Links power to items connected by attach point.


== Events ==
== Events ==
Line 562: 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