Editing ObjectReference Script

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Line 9: Line 13:


== Properties ==
== Properties ==
*Position
*float X [read-only]: The current X position of the reference.
**float X [read-only]: The current X position of the reference.
*float Y [read-only]: The current Y 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.
**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 35: Line 30:
**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 an association between the given string and the given form for text replacement usage.
**Adds this map marker to the map, optionally making it available for fast travel.
*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|ApplyConveyorBelt]](string aTarget, float aLinVelX, float aLinVelY, float aLinVelZ, bool abOn, bool abReverse)
*Function [[ApplyConveyorBelt - ObjectReference]]( 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 51: Line 46:
**Attaches this reference to the specified parent
**Attaches this reference to the specified parent
*Function [[BlockActivation - ObjectReference|BlockActivation]](bool abBlocked, bool abHideActivateText)
*Function [[BlockActivation - ObjectReference|BlockActivation]](bool abBlocked, bool abHideActivateText)
**Blocks (or un-blocks) normal activation processing for this reference, potentially also hiding activate text.
**Blocks (or unblocks) normal activation processing for this reference, potentially also hiding activate text.
*int Function [[CalculateEncounterLevel - ObjectReference|CalculateEncounterLevel]](int aiDifficulty)
*int Function [[CalculateEncounterLevel - ObjectReference|CalculateEncounterLevel]](int aiDifficulty)
**Calculate this object's encounter level, using the specified difficulty.
**Calculate this object's encounter level, using the specified difficulty.
Line 60: Line 55:
*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|ConveyorBeltOn]](bool abOn)
*Function [[ConveyorBeltOn - ObjectReference]](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 86: Line 81:
*Function [[Drop - ObjectReference|Drop]](bool abSilent)
*Function [[Drop - ObjectReference|Drop]](bool abSilent)
**Drops this object from the container that it is in.
**Drops this object from the container that it is in.
*ObjectReference Function [[DropFirstObject - ObjectReference|DropFirstObject]](bool abInitiallyDisabled)
*ObjectReference Function [[DropFirstObject - ObjectReference|DropFirstObject]]()
**Drops the "first" object in the container.
**Drops the "first" object in the container.
*Function [[DropObject - ObjectReference|DropObject]](Form akObject, int aiCount)
*Function [[DropObject - ObjectReference|DropObject]](Form akObject, int aiCount)
Line 166: Line 161:
*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 252: Line 247:
*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|IsConveyorBeltOn]]()
*bool Function [[IsConveyorBeltOn - ObjectReference]]()
**Get conveyor belt on/off state
**Get conveyor belt on/off state
*bool Function [[IsDeleted - ObjectReference|IsDeleted]]()
*bool Function [[IsDeleted - ObjectReference|IsDeleted]]()
Line 272: Line 267:
*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 282: Line 277:
*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 [[IsOwnedBy - ObjectReference|IsOwnedBy]](Actor akOwner)
**Is this ref owned by the given actor?
*bool Function [[IsNearPlayer - ObjectReference|IsNearPlayer]]()
*bool Function [[IsNearPlayer - ObjectReference|IsNearPlayer]]()
**A quick-and-dirty function to tell if this object is safe to enable or disable
**A quick-and-dirty function to tell if this object is safe to enable or disable
*bool Function [[IsOwnedBy - ObjectReference|IsOwnedBy]](Actor akOwner)
**Is this ref owned by the given actor?
*bool Function [[IsPowered - ObjectReference|IsPowered]]()
*bool Function [[IsPowered - ObjectReference|IsPowered]]()
**Is this object currently powered?
**Is this object currently powered?
Line 320: Line 315:
*Function [[OpenWorkshopSettlementMenu - ObjectReference|OpenWorkshopSettlementMenu]](Keyword akActionKW, Message astrConfirm, Location aLocToHighlight)
*Function [[OpenWorkshopSettlementMenu - ObjectReference|OpenWorkshopSettlementMenu]](Keyword akActionKW, Message astrConfirm, Location aLocToHighlight)
**Opens the workshop caravan menu for this workshop object.
**Opens the workshop caravan menu for this workshop object.
*Function [[OpenWorkshopSettlementMenuEx - ObjectReference|OpenWorkshopSettlementMenuEx]](Keyword akActionKW, Message astrConfirm, Location aLocToHighlight, FormList akIncludeKeywordList, FormList akExcludeKeywordList, bool abExcludeZeroPopulation, bool abOnlyOwnedWorkshops, bool abTurnOffHeader, bool abOnlyPotentialVassalSettlements, bool abDisableReservedByQuests)
*Function [[OpenWorkshopSettlementMenuEx - ObjectReference|OpenWorkshopSettlementMenuEx]](Keyword akActionKW, Message astrConfirm, Location aLocToHighlight, Keyword akFilterKW)
**Opens the workshop caravan menu for this workshop object.
**Opens the workshop caravan menu for this workshop object.
*Function [[PauseAudio - ObjectReference|PauseAudio]]()
*Function [[PauseAudio - ObjectReference|PauseAudio]]()
Line 336: Line 331:
*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 342: Line 337:
*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 352: Line 347:
*Function [[PushActorAway - ObjectReference|PushActorAway]](Actor akActorToPush, int aiKnockbackDamage)
*Function [[PushActorAway - ObjectReference|PushActorAway]](Actor akActorToPush, int aiKnockbackDamage)
**Pushes the other actor away from this object as if hit by the specified amount of knockback damage.
**Pushes the other actor away from this object as if hit by the specified amount of knockback damage.
*int Function [[RaidTargetsAvailable - ObjectReference|RaidTargetsAvailable]](Keyword akActionKW, Message astrConfirm, Location aLocToHighlight, FormList akIncludeKeywordList, FormList akExcludeKeywordList, bool abExcludeZeroPopulation, bool abOnlyOwnedWorkshops, bool abTurnOffHeader, bool abOnlyPotentialVassalSettlements, bool abDisableReservedByQuests) native
*bool Function [[RampRumble - ObjectReference|RampRumble]](float power, float duration, float falloff)
*bool Function [[RampRumble - ObjectReference|RampRumble]](float power, float duration, float falloff)
**Shakes cam/controller based on distance from player
**Shakes cam/controller based on distance from player
Line 359: Line 353:
*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 [[RemoveItemByComponent - ObjectReference|RemoveItemByComponent]](Form akComponentToRemove, int aiCount, bool abSilent, ObjectReference akOtherContainer)
*Function 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 385: Line 379:
*Function [[ResumeAudio - ObjectReference|ResumeAudio]]()
*Function [[ResumeAudio - ObjectReference|ResumeAudio]]()
** Resumes paused audio on this reference.
** Resumes paused audio on this reference.
*Function [[ReverseConveyorBelt - ObjectReference|ReverseConveyorBelt]](bool abReverse)
*Function [[ReverseConveyorBelt - ObjectReference]](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 413: Line 407:
*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|SetConveyorBeltVelocity]](float aLinVelX, float aLinVelY, float aLinVelZ)
*Function [[SetConveyorBeltVelocity - ObjectReference]]( 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 477: Line 471:
*Function [[WaitForWorkshopResourceRecalc - ObjectReference|WaitForWorkshopResourceRecalc]]()
*Function [[WaitForWorkshopResourceRecalc - ObjectReference|WaitForWorkshopResourceRecalc]]()
**Waits for resource recalculation on this workshop to finish.
**Waits for resource recalculation on this workshop to finish.
== 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]]()
**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 600: Line 557:
*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]]

Please note that all contributions to the Fallout4 CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see FalloutCK:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)