tes3bodyPartManager⚓︎
A game object which holds information about body parts.
Properties⚓︎
animationPhase
⚓︎
Read-only.
Returns:
result
(number)
attachNodes
⚓︎
Read-only. An array-style table with access to the reference's attach node objects.
Note
This array is 1-indexed. The array indices correspond to the tes3.bodyPartAttachment
table plus 1 to account for Lua's 1-based array indexing. In other words bodyPartManager.attachNodes[tes3.bodyPartAttachment.leftHand + 1]
returns the tes3bodyPartManagerAttachNode
object corresponding to the left hand.
Returns:
result
(tes3bodyPartManagerAttachNode[])
reference
⚓︎
Read-only. The access to the reference this body part manager operates for.
Returns:
result
(tes3reference)
Methods⚓︎
getActiveBodyPart
⚓︎
The method fetches the active body part at a given layer and position. This gives access to the associated scene node, equipped item, and base body part.
local result = myObject:getActiveBodyPart(layer, index)
Parameters:
layer
(tes3.activeBodyPartLayer): A value fromtes3.activeBodyPartLayer
namespace.index
(tes3.activeBodyPart): A value fromtes3.activeBodyPart
namespace.
Returns:
result
(tes3bodyPartManagerActiveBodyPart)
getActiveBodyPartForItem
⚓︎
The method fetches active body part of a actor for the given item.
local result = myObject:getActiveBodyPartForItem(item)
Parameters:
item
(tes3item): The item to fetch the active body part for.
Returns:
result
(tes3bodyPartManagerActiveBodyPart)
removeActiveBodyPart
⚓︎
Removes an active body part and optionally sets override data that can be used prevent other items using the same location.
myObject:removeActiveBodyPart(layer, index, setOverride, overrideData)
Parameters:
layer
(tes3.activeBodyPartLayer): A value fromtes3.activeBodyPartLayer
namespace.index
(tes3.activeBodyPart): A value fromtes3.activeBodyPart
namespace.setOverride
(boolean): Default:true
. A flag which controls whether the override data should be written.overrideData
(number): Default:0
. Use -1 to prevent other items from appearing in the same location.
removeEquippedLayers
⚓︎
The method removes all currently equipped layers from the actor.
myObject:removeEquippedLayers()
setBodyPartByIdForObject
⚓︎
The method sets a new body part for a given object.
myObject:setBodyPartByIdForObject(item, index, bodyPartId, isFirstPerson)
Parameters:
item
(tes3item): The item that the body part is from.index
(tes3.activeBodyPart): A value fromtes3.activeBodyPart
namespace.bodyPartId
(string): The unique ID of thetes3bodyPart
object to set as a new body part for given object.isFirstPerson
(boolean): Default:false
. A flag which must be set if the target reference is the first person player.
setBodyPartForObject
⚓︎
The method sets an active body part slot with an item and bodyPart. Triggers bodyPart
event.
myObject:setBodyPartForObject(item, index, bodyPart, isFirstPerson)
Parameters:
item
(tes3item): The item that the body part is from.index
(tes3.activeBodyPart): A value fromtes3.activeBodyPart
namespace.bodyPart
(tes3bodyPart): Thetes3bodyPart
object to set as a new body part for given object.isFirstPerson
(boolean): Default:false
. A flag which must be set if the target reference is the first person player.
updateForReference
⚓︎
The method updates all body parts for a given reference.
myObject:updateForReference(reference)
Parameters:
reference
(tes3reference): The reference whose body parts will be updated.