Skip to content

Object Reference

powerof3 edited this page Jul 18, 2024 · 6 revisions

Getters

AddAllItemsToArray

  • Adds all inventory items to array, filtering out equipped, favourited and quest items.
Form[] Function AddAllItemsToArray(ObjectReference akRef, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false) global native

AddAllItemsToList

Function AddAllItemsToList(ObjectReference akRef, Formlist akList, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false) global native

AddItemsOfTypeToArray

  • Adds inventory items matching formtype to array, filtering out equipped, favourited and quest items.
Form[] Function AddItemsOfTypeToArray(ObjectReference akRef, int aiFormType, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false) global native

AddItemsOfTypeToList

Function AddItemsOfTypeToList(ObjectReference akRef, Formlist akList, int aiFormType, bool abNoEquipped = true, bool abNoFavorited = false, bool abNoQuestItem = false) global native

FindAllReferencesOfFormType

  • Finds all references of form type in loaded cells, within radius from ref.
  • If afRadius is 0, it will get all references from all attached cells
ObjectReference[] Function FindAllReferencesOfFormType(ObjectReference akRef, int formType, float afRadius) global native

FindAllReferencesWithKeyword

  • Find all references with keyword in loaded cells, within radius from ref.
  • If afRadius is 0, it will get all references from all attached cells
ObjectReference[] Function FindAllReferencesWithKeyword(ObjectReference akRef, Form keywordOrList, float afRadius, bool abMatchAll) global native

FindAllReferencesOfType

  • Find all references matching base form/in formlist, within radius from ref.
  • If afRadius is 0, it will get all references from all attached cells
ObjectReference[] Function FindAllReferencesOfType(ObjectReference akRef, Form akFormOrList, float afRadius) global native

FindFirstItemInList

  • Gets the first item in inventory that exists in formlist.
Form Function FindFirstItemInList(ObjectReference akRef, FormList akList) global native

GetActivateChildren

ObjectReference[] Function GetActivateChildren(ObjectReference akRef) global native

GetActiveGamebryoAnimation

  • Gets currently playing animation sequence
String Function GetActiveGamebryoAnimation(ObjectReference akRef) global native

GetActorCause

  • Gets actor responsible for object.
Actor Function GetActorCause(ObjectReference akRef) global native

GetAllArtObjects

  • Get all art objects attached to this object.
Art[] Function GetAllArtObjects(ObjectReference akRef) global native

GetAllEffectShaders

  • Get all effect shaders attached to this object.
EffectShader[] Function GetAllEffectShaders(ObjectReference akRef) global native

GetClosestActorFromRef

  • Gets closest actor to ref (without returning the reference itself).
Actor Function GetClosestActorFromRef(ObjectReference akRef, bool abIgnorePlayer) global native

GetEffectShaderDuration

float Function GetEffectShaderDuration(ObjectReference akRef, EffectShader akShader) global native

GetDoorDestination

  • Gets the door which is linked to this load door ref.
ObjectReference Function GetDoorDestination(ObjectReference akRef) global native

GetLinkedChildren

  • Gets all refs linked to akRef. Keyword optional.
ObjectReference[] Function GetLinkedChildren(ObjectReference akRef, Keyword akKeyword) global native

GetMagicEffectSource

  • Gets the source of the magic effect (spell/enchantment/scroll etc) and the caster.
  • Magic effect must be present on the reference.
Form[] Function GetMagicEffectSource(ObjectReference akRef, MagicEffect akEffect) global native

GetMaterialType

Materials
Material
StoneBroken
BlockBlade1Hand
Meat
CarriageWheel
MetalLight
WoodLight
Snow
Gravel
ChainMetal
Bottle
Wood
Ash
Skin
BlockBlunt
DLC1DeerSkin
Insect
Barrel
CeramicMedium
Basket
Ice
GlassStairs
StoneStairs
Water
DraugrSkeleton
Blade1Hand
Book
Carpet
MetalSolid
Axe1Hand
BlockBlade2Hand
OrganicLarge
Amulet
WoodStairs
Mud
BoulderSmall
SnowStairs
StoneHeavy
DragonSkeleton
Trap
BowsStaves
Alduin
BlockBowsStaves
WoodAsStairs
SteelGreatSword
Grass
BoulderLarge
StoneAsStairs
Blade2Hand
BottleSmall
BoneActor
Sand
MetalHeavy
DLC1SabreCatPelt
IceForm
Dragon
Blade1HandSmall
SkinSmall
PotsPans
SkinSkeleton
Blunt1Hand
StoneStairsBroken
SkinLarge
Organic
Bone
WoodHeavy
Chain
Dirt
Ghost
SkinMetalLarge
BlockAxe
ArmorLight
ShieldLight
Coin
BlockBlunt2Hand
ShieldHeavy
ArmorHeavy
Arrow
Glass
Stone
WaterPuddle
Cloth
SkinMetalSmall
Ward
Web
TrailerSteelSword
Blunt2Hand
DLC1SwingingBridge
BoulderMedium
  • Gets the specified collision shape's havok material types as string array.
  • Returns the first material type if nodeName is empty
String[] Function GetMaterialType(ObjectReference akRef, String asNodeName = "") global native

GetMotionType

int Function GetMotionType(ObjectReference akRef) global native

GetRandomActorFromRef

  • Gets random actor near ref (without returning the reference itself).
Actor Function GetRandomActorFromRef(ObjectReference akRef, float afRadius, bool abIgnorePlayer) global native

GetQuestItems

Form[] Function GetQuestItems(ObjectReference akRef, bool abNoEquipped = false, bool abNoFavorited = false) global native

GetRefAliases

  • Get all aliases holding this ref
Alias[] Function GetRefAliases(ObjectReference akRef) global native

GetRefCount

  • Get object reference count (eg. number of stacked items when dropped from inventory)
int Function GetRefCount(ObjectReference akRef) global native

GetStoredSoulSize

  • Returns the size of the stored soul in a soulgem objectreference
int Function GetStoredSoulSize(ObjectReference akRef) global native

HasArtObject

  • Returns the number of instances of the specified art object (attached using visual effects) on the reference.
int Function HasArtObject(ObjectReference akRef, Art akArtObject, bool abActive = false) global native

HasEffectShader

  • Returns the number of instances of the specified effect shader on the reference.
int Function HasEffectShader(ObjectReference akRef, EffectShader akShader, bool abActive = false) global native

HasNiExtraData

  • Returns whether the reference has NiExtraData (attached to root 3D node). Partial name matches accepted.
bool Function HasNiExtraData(ObjectReference akRef, String asName) global native

IsCasting

  • Returns whether the reference is currently casting magic
bool Function IsCasting(ObjectReference akRef, Form akMagicItem) global native

IsLoadDoor

bool Function IsLoadDoor(ObjectReference akRef) global native

IsQuestItem

bool Function IsQuestItem(ObjectReference akRef) global native

IsRefInWater

  • Returns whether the object reference (or actor) is in water. Function may be unreliable if object bounds are incorrect
bool Function IsRefInWater(ObjectReference akRef) global native

IsRefUnderWater

  • Returns whether the object reference (or actor) is under water. Function may be unreliable if object bounds are incorrect
bool Function IsRefUnderwater(ObjectReference akRef) global native

IsVIP

  • Is a VIP (actor that is needed by quest)?
bool Function IsVIP(ObjectReference akRef) global native

Setters

ApplyMaterialShader

  • Applies material shader to reference (doesn't have to be static)
Function ApplyMaterialShader(ObjectReference akRef, MaterialObject akMatObject, float directionalThresholdAngle) global native

AddKeywordToRef

Function AddKeywordToRef(ObjectReference akRef, Keyword akKeyword) global native

MoveToNearestNavmeshLocation

  • Snaps the object to the nearest navmesh point closest to its current position in the cell.
Function MoveToNearestNavmeshLocation(ObjectReference akRef) global native

RemoveAllModItems

  • Remove all mod added items from this reference, optionally only unequipping them
Function RemoveAllModItems(ObjectReference akRef, String asModName, bool abOnlyUnequip = false) global native

RemoveKeywordFromRef

bool Function RemoveKeywordFromRef(ObjectReference akRef, Keyword akKeyword) global native

ReplaceKeywordOnRef

Function ReplaceKeywordOnRef(ObjectReference akRef, Keyword akKeywordAdd, Keyword akKeywordRemove) global native

PlayDebugShader

  • Plays debug shader on the reference, with normalised RGBA color (or white if empty)
Function PlayDebugShader(ObjectReference akRef, float[] afRGBA) global native

ScaleObject3D

  • Scales node & collision (bhkBoxShape, bhkSphereShape).
  • Entire nif will be scaled if string is empty. Collision has to be directly attached to named nodes.
  • Adds "PO3_SCALE" NiExtraData to root node.
Function ScaleObject3D(ObjectReference akRef, String asNodeName, float afScale) global native

SetBaseObject

  • Sets the base object of this reference and reloads 3D
Function SetBaseObject(ObjectReference akRef, Form akBaseObject) global native

SetCollisionLayer

Collision Layers
Collision Layer Value
kUnidentified 0
kStatic 1
kAnimStatic 2
kTransparent 3
kClutter 4
kWeapon 5
kProjectile 6
kSpell 7
kBiped 8
kTrees 9
kProps 10
kWater 11
kTrigger 12
kTerrain 13
kTrap 14
kNonCollidable 15
kCloudTrap 16
kGround 17
kPortal 18
kDebrisSmall 19
kDebrisLarge 20
kAcousticSpace 21
kActorZone 22
kProjectileZone 23
kGasTrap 24
kShellCasting 25
kTransparentWall 26
kInvisibleWall 27
kTransparentSmallAnim 28
kClutterLarge 29
kCharController 30
kStairHelper 31
kDeadBip 32
kBipedNoCC 33
kAvoidBox 34
kCollisionBox 35
kCameraSphere 36
kDoorDetection 37
kConeProjectile 38
kCamera 39
kItemPicker 40
kLOS 41
kPathingPick 42
kUnused0 43
kUnused1 44
kSpellExplosion 45
kDroppingPick 46
  • Sets object 3D root or specified node's collision layer
Function SetCollisionLayer(ObjectReference akRef, String asNodeName, int aiCollisionLayer) global native

SetDoorDestination

  • Sets the door as the new linked door
bool Function SetDoorDestination(ObjectReference akRef, ObjectReference akDoor) global native

SetEffectShaderDuration

  • Sets effectshader duration. Internal duration is set when the effectshader begins and does not change with time.
Function SetEffectShaderDuration(ObjectReference akRef, EffectShader akShader, float afTime, bool abAbsolute) global native

SetLinkedRef

  • Sets linked ref. Pass None into akTargetRef to unset the linked ref.
Function SetLinkedRef(ObjectReference akRef, ObjectReference akTargetRef, Keyword akKeyword = None) global native

SetMaterialType

  • Sets havok material type. Use oldMaterial string to select what material you want to change from to (eg. from stone to wood), and nodeName to apply it to the specific node.
  • If both are empty, every collision material will be set.
Function SetMaterialType(ObjectReference akRef, String asNewMaterial, String asOldMaterial = "", String asNodeName = "") global native

SetupBodyPartGeometry

  • Copies skin tint color from actorbase to bodypart nif
  • Bodyparts nif must have skin shaders
Function SetupBodyPartGeometry(ObjectReference akRef, actor akActor) global native

SetShaderType

Shader Types
Shader Value
kDefault 0
kEnvironmentMap 1
kGlowMap 2
kParallax 3
kFaceGen 4
kFaceGenRGBTint 5
kHairTint 6
kParallaxOcc 7
kMultiTexLand 8
kLODLand 9
kMultilayerParallax 11
kTreeAnim 12
kMultiIndexTriShapeSnow 14
kLODObjectsHD 15
kEye 16
kCloud 17
kLODLandNoise 18
kMultiTexLandLODBlend 19
  • Sets the ref's shader material type ie. Default to Cubemap
  • If texture type is -1, the reference's entire textureset is replaced using the template's textureset;
  • If texture type is 0-9 the template's textureset is still applied but reference's texture at that index will take priority.
  • Optional diffuse path can be used to filter shapes to apply the shader to, partial matches are accepted like "Draugr.dds"
  • Limitations - cannot be used on geometry with no normals (ie. body skin meshes)
Function SetShaderType(ObjectReference akRef, ObjectReference akTemplate, String asDiffusePath, int aiShaderType, int aiTextureType, bool abNoWeapons, bool abNoAlphaProperty) global native

StopAllShaders

  • Stops ALL effect shaders and art objects (visual effects) currently on this actor
Function StopAllShaders(ObjectReference akRef) global native

StopArtObject

  • Removes all instances of the art object (hit magic effect/visual effect) attached to the reference.
Function StopArtObject(ObjectReference akRef, Art akArt) global native

ToggleChildNode

  • Toggles node attached to root 3D.
Function ToggleChildNode(ObjectReference akRef, String asNodeName, bool abDisable) global native

UpdateHitEffectArtNode

  • Updates node data. Move hit effect art to new node (ie. from "MagicEffectsNode" to "NPC Head [Head]") or update translate, rotate, and scale values.
  • Translate and Rotate arrays must have three values in order to work. Rotate uses euler angles in degrees (XYZ). Scale is relative, and is multiplied by existing scale.
  • If the hit effect art is removed and reattached, it will revert back to the values in the nif.
Function UpdateHitEffectArtNode(ObjectReference akRef, Art akArt, String asNewNode, float[] afTranslate, float[] afRotate, float afRelativeScale = 1.0) global native
Clone this wiki locally
  翻译: