tes3container⚓︎
A container object that has not been cloned. Typically represents the raw information edited in the construction set.
This type inherits the following: tes3actor, tes3physicalObject, tes3object, tes3baseObject
Properties⚓︎
actorFlags
⚓︎
Read-only. A number representing the actor flags. Truly a bit field.
Returns:
result
(number)
barterGold
⚓︎
The actor's base barter gold amount. This is the amount of the barter gold an actor initially has, and also when barter gold is refreshed. The actor's current barter gold amount is held in tes3mobileActor.barterGold
.
Barter gold is reset on talking to an actor if fBarterGoldResetDelay hours have passed since the last transaction. If you want to change the base amount, for example in an investment mod, you must edit the barterGold of the baseObject.
Returns:
result
(number)
blocked
⚓︎
The blocked state of the object.
Returns:
result
(boolean)
blood
⚓︎
Friendly access to actor's blood type, in [0, 7] range. The available blood types are defined in the Morrowind.ini file, and assigned to the actor via the Construction Set.
Returns:
result
(integer)
boundingBox
⚓︎
The bounding box for the object.
Returns:
result
(tes3boundingBox)
capacity
⚓︎
The amount of weight that the container can hold.
Returns:
result
(number)
cloneCount
⚓︎
Read-only. The number of clones that exist of this actor.
Returns:
result
(number)
deleted
⚓︎
Read-only. The deleted state of the object.
Returns:
result
(boolean)
disabled
⚓︎
Read-only. The disabled state of the object.
Returns:
result
(boolean)
equipment
⚓︎
Read-only. The items currently equipped to the actor.
Returns:
result
(tes3equipmentStack[])
id
⚓︎
Read-only. The unique identifier for the object.
Returns:
result
(string)
inventory
⚓︎
Read-only. The items currently carried by the actor.
Returns:
result
(tes3inventory, tes3itemStack[])
isInstance
⚓︎
Always returns false.
Returns:
result
(boolean)
isLocationMarker
⚓︎
True if this object is an editor marker for a gameplay location. These include travel, intervention, prison, door, and interior north markers. Markers are invisible in-game.
Returns:
result
(boolean)
mesh
⚓︎
The path to the object's mesh.
Returns:
result
(string)
modified
⚓︎
The modification state of the object since the last save.
Returns:
result
(boolean)
name
⚓︎
The player-facing name for the object.
Returns:
result
(string)
nextInCollection
⚓︎
The next object in parent collection's list.
Returns:
result
(tes3object)
objectFlags
⚓︎
Read-only. The raw flags of the object.
Returns:
result
(number)
objectType
⚓︎
Read-only. The type of object. Maps to values in tes3.objectType
.
Returns:
result
(tes3.objectType)
organic
⚓︎
Determines if the container's organic flag is enabled. The name of this property comes from the Construction Set. If a container is flagged as organic, no items can be stored inside such containers. In vanilla, those are all plants, mushrooms, and ores. In addition, resupplying guild supply chests are implemented as organic and respawning containers.
Returns:
result
(boolean)
owningCollection
⚓︎
The collection responsible for holding this object.
Returns:
result
(tes3referenceList)
persistent
⚓︎
The persistent flag of the object.
Returns:
result
(boolean)
previousInCollection
⚓︎
The previous object in parent collection's list.
Returns:
result
(tes3object)
respawns
⚓︎
Determines if the container's respawn flag is enabled. Only the organic containers can have respawn flag set.
The global script variable, "MonthsToRespawn" is decremented at the end of each month. If it reaches zero at the first day of next month, it is reset to iMonthsToRespawn
(GMST) and all respawning containers are refilled.
Returns:
result
(boolean)
scale
⚓︎
The object's scale. The value range is (0, 10).
Returns:
result
(number)
sceneCollisionRoot
⚓︎
The scene graph node for this object's physics collision, if its mesh has a root collision node.
Returns:
result
(niNode)
sceneNode
⚓︎
The scene graph node for this object.
Returns:
result
(niNode)
script
⚓︎
The script that runs on the object.
Returns:
result
(tes3script)
sourceless
⚓︎
The soruceless flag of the object.
Returns:
result
(boolean)
sourceMod
⚓︎
Read-only. The filename (including the extension) of the mod that owns this object. It has nil
value if the object was anything other than loaded from an ESP or ESM file.
Returns:
result
(string)
stolenList
⚓︎
A list of actors that the object has been stolen from.
Returns:
result
(tes3baseObject[])
supportsLuaData
⚓︎
If true, references of this object can store temporary or persistent lua data.
Returns:
result
(boolean)
Methods⚓︎
__tojson
⚓︎
Serializes the object to json.
local string = myObject:__tojson()
Returns:
string
(string)
createCopy
⚓︎
Creates a copy of this object.
local newObject = myObject:createCopy({ id = ..., addToObjectList = ..., sourceless = ... })
Parameters:
params
(table)id
(string): Optional. The new object's ID. If one is not provided, a randomly generated one will be used.addToObjectList
(boolean): Default:true
. If true, the object will be added to the data handler. If this is false, the new object may not have a randomly generated ID. Do not use this without knowing the implications.sourceless
(boolean): Default:false
. If true, the object will be made sourceless, and will not be serialized to the save game. If the object is copied outside of a save game, the object will always be sourceless.
Returns:
newObject
(tes3container)
getEquipmentValue
⚓︎
Returns the combined value of all the items worn by the actor.
local value = myObject:getEquipmentValue({ useDurability = ... })
Parameters:
params
(table)useDurability
(boolean): Default:false
. If true, damaged items will have a proportionally lower value.
Returns:
value
(number): The value of each equipped item added together.
hasItemEquipped
⚓︎
Checks if the actor has provided item equipped.
local result = myObject:hasItemEquipped(item, itemData)
Parameters:
item
(tes3item, string): The item to perform a check for.itemData
(tes3itemData): Optional.
Returns:
result
(boolean)
offersService
⚓︎
Checks if the actor will offer a service in dialogue. This an offer and may still be refused by dialogue checks. To also get the result of dialogue checks, use tes3.checkMerchantOffersService()
.
local result = myObject:offersService(service)
Parameters:
service
(tes3.merchantService): Use one of the values in thetes3.merchantService.*
table.
Returns:
result
(boolean)
onInventoryClose
⚓︎
A callback function invoked when an inventory is closed. Typically not used outside of specific purposes. You may find tes3.reference
's onCloseInventory()
to be more convenient to use.
myObject:onInventoryClose(reference)
Parameters:
reference
(tes3reference)
tradesItemType
⚓︎
Checks if the actor will buy and sell items of a given object type. e.g. actor:tradesItemType(tes3.objectType.repairItem)
local result = myObject:tradesItemType(objectType)
Parameters:
objectType
(tes3.objectType): Accepts values fromtes3.objectType
namespace.
Returns:
result
(boolean)