tes3bodyPartManager⚓︎
A game object which holds information about body parts.
Properties⚓︎
activeBodyParts
⚓︎
Read-only. Access to the reference's tes3bodyPartManagerActiveBodyPart
objects. It's a 2-dimensional table, with first dimension index values from tes3.activeBodyPartLayer
namespace, while its second dimension indexes are values from tes3.activeBodyPart
namespace.
Returns:
result
(table<tes3.activeBodyPartLayer, table<tes3.activeBodyPart, tes3bodyPartManagerActiveBodyPart>>)
animationPhase
⚓︎
Read-only.
Returns:
result
(number)
attachNodes
⚓︎
Read-only. The access to the reference's attach node objects. Indexes of that table are values from tes3.bodyPartAttachment
namespace.
Returns:
result
(table<tes3.bodyPartAttachment, 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.