Package openmw.typesΒΆ
openmw.types
defines functions for specific types of game objects.
Usage:
local types = require('openmw.types')
Type types
Type Activator
Activator.createRecordDraft(activator) |
Creates a #ActivatorRecord without adding it to the world database. |
Activator.objectIsInstance(object) |
Whether the object is an Activator. |
Activator.record(objectOrRecordId) |
Returns the read-only #ActivatorRecord of an activator |
Activator.records |
A read-only list of all #ActivatorRecords in the world database. |
Type ActivatorRecord
ActivatorRecord.id |
Record id |
ActivatorRecord.model |
VFS path to the model |
ActivatorRecord.mwscript |
MWScript on this activator (can be empty) |
ActivatorRecord.name |
Human-readable name |
Type Actor
Actor.EQUIPMENT_SLOT |
Available #EQUIPMENT_SLOT values. |
Actor.STANCE | |
Actor.activeEffects(actor) |
Return the active magic effects (#ActorActiveEffects) currently affecting the given actor. |
Actor.activeSpells(actor) |
Return the active spells (#ActorActiveSpells) currently affecting the given actor. |
Actor.canMove(object) |
Returns true if the object is an actor and is able to move. |
Actor.getCurrentSpeed(actor) |
Current speed. |
Actor.getEquipment(actor, slot) |
Get equipment. |
Actor.getPathfindingAgentBounds(actor) |
Agent bounds to be used for pathfinding functions. |
Actor.getRunSpeed(actor) |
Speed of running. |
Actor.getSelectedSpell(actor) |
Get currently selected spell |
Actor.getStance(actor) |
Returns the current stance (whether a weapon/spell is readied), see the list of #STANCE values. |
Actor.getWalkSpeed(actor) |
Speed of walking. |
Actor.hasEquipped(actor, item) |
Returns |
Actor.inventory(actor) |
Actor inventory. |
Actor.isOnGround(actor) |
Is the actor standing on ground. |
Actor.isSwimming(actor) |
Is the actor in water. |
Actor.objectIsInstance(object) |
Whether the object is an actor. |
Actor.setEquipment(actor, equipment) |
Set equipment. |
Actor.setSelectedSpell(actor, spell) |
Set selected spell |
Actor.setStance(actor, stance) |
Sets the current stance (whether a weapon/spell is readied), see the list of #STANCE values. |
Actor.spells(actor) |
Return the spells (#ActorSpells) of the given actor. |
Actor.stats |
The actor's stats. |
Type ActorActiveEffects
ActorActiveEffects:getEffect(string, string) |
Get a specific active effect on the actor. |
Type ActorActiveSpells
ActorActiveSpells:isSpellActive(spellOrId) |
Get whether a specific spell is active on the actor. |
Type ActorSpells
ActorSpells:add(spellOrId) |
Add spell (only in global scripts or on self). |
ActorSpells:clear() |
Remove all spells (only in global scripts or on self). |
ActorSpells:remove(spellOrId) |
Remove spell (only in global scripts or on self). |
Type ActorStats
ActorStats.attributes | |
ActorStats.dynamic | |
ActorStats.level(actor) |
Level (returns #LevelStat) |
Type Apparatus
Apparatus.TYPE | |
Apparatus.baseType | |
Apparatus.objectIsInstance(object) |
Whether the object is an Apparatus. |
Apparatus.record(objectOrRecordId) |
Returns the read-only #ApparatusRecord of an apparatus |
Apparatus.records |
A read-only list of all #ApparatusRecords in the world database. |
Type ApparatusRecord
ApparatusRecord.icon |
VFS path to the icon |
ApparatusRecord.id |
The record ID of the apparatus |
ApparatusRecord.model |
VFS path to the model |
ApparatusRecord.mwscript |
MWScript on this apparatus (can be empty) |
ApparatusRecord.name |
The name of the apparatus |
ApparatusRecord.quality |
The quality of the apparatus |
ApparatusRecord.type |
The type of apparatus. See Apparatus.TYPE |
ApparatusRecord.value | |
ApparatusRecord.weight |
Type ApparatusTYPE
ApparatusTYPE.Alembic | |
ApparatusTYPE.Calcinator | |
ApparatusTYPE.MortarPestle | |
ApparatusTYPE.Retort |
Type Armor
Armor.TYPE | |
Armor.baseType | |
Armor.createRecordDraft(armor) |
Creates a #ArmorRecord without adding it to the world database. |
Armor.objectIsInstance(object) |
Whether the object is an Armor. |
Armor.record(objectOrRecordId) |
Returns the read-only #ArmorRecord of an Armor |
Armor.records |
A read-only list of all #ArmorRecords in the world database. |
Type ArmorRecord
ArmorRecord.baseArmor |
The base armor rating of this armor |
ArmorRecord.enchant |
The enchantment ID of this armor (can be empty) |
ArmorRecord.enchantCapacity | |
ArmorRecord.health | |
ArmorRecord.icon |
VFS path to the icon |
ArmorRecord.id |
Record id |
ArmorRecord.model |
VFS path to the model |
ArmorRecord.mwscript |
MWScript on this armor (can be empty) |
ArmorRecord.name |
Human-readable name |
ArmorRecord.type |
See Armor.TYPE |
ArmorRecord.value | |
ArmorRecord.weight |
Type ArmorTYPE
Type AttributeStat
AttributeStat.base |
The actor's base attribute value. |
AttributeStat.damage |
The amount the attribute has been damaged. |
AttributeStat.modified |
The actor's current attribute value (read-only.) |
AttributeStat.modifier |
The attribute's modifier. |
Type AttributeStats
AttributeStats.agility(actor) |
Agility (returns #AttributeStat) |
AttributeStats.endurance(actor) |
Endurance (returns #AttributeStat) |
AttributeStats.intelligence(actor) |
Intelligence (returns #AttributeStat) |
AttributeStats.luck(actor) |
Luck (returns #AttributeStat) |
AttributeStats.personality(actor) |
Personality (returns #AttributeStat) |
AttributeStats.speed(actor) |
Speed (returns #AttributeStat) |
AttributeStats.strength(actor) |
Strength (returns #AttributeStat) |
AttributeStats.willpower(actor) |
Willpower (returns #AttributeStat) |
Type Book
Book.SKILL |
DEPRECATED, use openmw.core#SKILL |
Book.baseType | |
Book.createRecordDraft(book) |
Creates a #BookRecord without adding it to the world database. |
Book.objectIsInstance(object) |
Whether the object is a Book. |
Book.record(objectOrRecordId) |
Returns the read-only #BookRecord of a book |
Book.records |
A read-only list of all #BookRecords in the world database. |
Type BookRecord
BookRecord.enchant |
The enchantment ID of this book (can be empty) |
BookRecord.enchantCapacity | |
BookRecord.icon |
VFS path to the icon |
BookRecord.id |
The record ID of the book |
BookRecord.isScroll | |
BookRecord.model |
VFS path to the model |
BookRecord.mwscript |
MWScript on this book (can be empty) |
BookRecord.name |
Name of the book |
BookRecord.skill |
The skill that this book teaches. See openmw.core#SKILL |
BookRecord.text |
The text content of the book |
BookRecord.value | |
BookRecord.weight |
Type BookSKILL
BookSKILL.acrobatics |
"acrobatics" |
BookSKILL.alchemy |
"alchemy" |
BookSKILL.alteration |
"alteration" |
BookSKILL.armorer |
"armorer" |
BookSKILL.athletics |
"athletics" |
BookSKILL.axe |
"axe" |
BookSKILL.block |
"block" |
BookSKILL.bluntWeapon |
"bluntweapon" |
BookSKILL.conjuration |
"conjuration" |
BookSKILL.destruction |
"destruction" |
BookSKILL.enchant |
"enchant" |
BookSKILL.handToHand |
"handtohand" |
BookSKILL.heavyArmor |
"heavyarmor" |
BookSKILL.illusion |
"illusion" |
BookSKILL.lightArmor |
"lightarmor" |
BookSKILL.longBlade |
"longblade" |
BookSKILL.marksman |
"marksman" |
BookSKILL.mediumArmor |
"mediumarmor" |
BookSKILL.mercantile |
"mercantile" |
BookSKILL.mysticism |
"mysticism" |
BookSKILL.restoration |
"restoration" |
BookSKILL.security |
"security" |
BookSKILL.shortBlade |
"shortblade" |
BookSKILL.sneak |
"sneak" |
BookSKILL.spear |
"spear" |
BookSKILL.speechcraft |
"speechcraft" |
BookSKILL.unarmored |
"unarmored" |
Type Clothing
Clothing.TYPE | |
Clothing.baseType | |
Clothing.createRecordDraft(clothing) |
Creates a #ClothingRecord without adding it to the world database. |
Clothing.objectIsInstance(object) |
Whether the object is a Clothing. |
Clothing.record(objectOrRecordId) |
Returns the read-only #ClothingRecord of a Clothing |
Clothing.records |
A read-only list of all #ClothingRecords in the world database. |
Type ClothingRecord
ClothingRecord.enchant |
The enchantment ID of this clothing (can be empty) |
ClothingRecord.enchantCapacity | |
ClothingRecord.icon |
VFS path to the icon |
ClothingRecord.id |
Record id |
ClothingRecord.model |
VFS path to the model |
ClothingRecord.mwscript |
MWScript on this clothing (can be empty) |
ClothingRecord.name |
Name of the clothing |
ClothingRecord.type |
See Clothing.TYPE |
ClothingRecord.value | |
ClothingRecord.weight |
Type ClothingTYPE
ClothingTYPE.Amulet | |
ClothingTYPE.Belt | |
ClothingTYPE.LGlove | |
ClothingTYPE.Pants | |
ClothingTYPE.RGlove | |
ClothingTYPE.Ring | |
ClothingTYPE.Robe | |
ClothingTYPE.Shirt | |
ClothingTYPE.Shoes | |
ClothingTYPE.Skirt |
Type Container
Container.capacity(object) |
Returns the capacity of a container |
Container.content(object) |
Container content. |
Container.encumbrance(object) |
Returns the total weight of everything in a container |
Container.objectIsInstance(object) |
Whether the object is a Container. |
Container.record(objectOrRecordId) |
Returns the read-only #ContainerRecord of a container |
Container.records |
A read-only list of all #ContainerRecords in the world database. |
Type ContainerRecord
ContainerRecord.id |
Record id |
ContainerRecord.model |
VFS path to the model |
ContainerRecord.mwscript |
MWScript on this container (can be empty) |
ContainerRecord.name |
Human-readable name |
ContainerRecord.weight |
capacity of this container |
Type Creature
Creature.baseType | |
Creature.objectIsInstance(object) |
Whether the object is a creature. |
Creature.record(objectOrRecordId) |
Returns the read-only #CreatureRecord of a creature |
Creature.records |
A read-only list of all #CreatureRecords in the world database. |
Type CreatureRecord
CreatureRecord.baseCreature |
Record id of a base creature, which was modified to create this one |
CreatureRecord.id |
The record ID of the creature |
CreatureRecord.model |
VFS path to the creature's model |
CreatureRecord.mwscript | |
CreatureRecord.name | |
CreatureRecord.soulValue |
The soul value of the creature record |
Type Door
Door.destCell(object) |
Destination cell (only if a teleport door). |
Door.destPosition(object) |
Destination (only if a teleport door). |
Door.destRotation(object) |
Destination rotation (only if a teleport door). |
Door.isTeleport(object) |
Whether the door is a teleport. |
Door.objectIsInstance(object) |
Whether the object is a Door. |
Door.record(objectOrRecordId) |
Returns the read-only #DoorRecord of a door |
Door.records |
A read-only list of all #DoorRecords in the world database. |
Type DoorRecord
DoorRecord.closeSound |
VFS path to the sound of closing |
DoorRecord.id |
Record id |
DoorRecord.model |
VFS path to the model |
DoorRecord.mwscript |
MWScript on this door (can be empty) |
DoorRecord.name |
Human-readable name |
DoorRecord.openSound |
VFS path to the sound of opening |
Type DynamicStat
DynamicStat.base | |
DynamicStat.current | |
DynamicStat.modifier |
Type DynamicStats
DynamicStats.fatigue(actor) |
Fatigue (returns #DynamicStat) |
DynamicStats.health(actor) |
Health (returns #DynamicStat) |
DynamicStats.magicka(actor) |
Magicka (returns #DynamicStat) |
Type EQUIPMENT_SLOT
Type ESM4Door
ESM4Door.destCell(object) |
Destination cell (only if a teleport door). |
ESM4Door.destPosition(object) |
Destination (only if a teleport door). |
ESM4Door.destRotation(object) |
Destination rotation (only if a teleport door). |
ESM4Door.isTeleport(object) |
Whether the door is a teleport. |
ESM4Door.objectIsInstance(object) |
Whether the object is a ESM4Door. |
ESM4Door.record(objectOrRecordId) |
Returns the read-only #ESM4DoorRecord of a door |
ESM4Door.records() |
Returns a read-only list of all #ESM4DoorRecords in the world database. |
Type ESM4DoorRecord
ESM4DoorRecord.id |
Record id |
ESM4DoorRecord.model |
VFS path to the model |
ESM4DoorRecord.name |
Human-readable name |
Type Ingredient
Ingredient.baseType | |
Ingredient.objectIsInstance(object) |
Whether the object is an Ingredient. |
Ingredient.record(objectOrRecordId) |
Returns the read-only #IngredientRecord of a Ingredient |
Ingredient.records |
A read-only list of all #IngredientRecords in the world database. |
Type IngredientRecord
IngredientRecord.icon |
VFS path to the icon |
IngredientRecord.id |
Record id |
IngredientRecord.model |
VFS path to the model |
IngredientRecord.mwscript |
MWScript on this potion (can be empty) |
IngredientRecord.name |
Human-readable name |
IngredientRecord.value | |
IngredientRecord.weight |
Type Item
Item.objectIsInstance(object) |
Whether the object is an item. |
Type LevelStat
LevelStat.current |
The actor's current level. |
LevelStat.progress |
The NPC's level progress (read-only.) |
Type Light
Light.baseType | |
Light.objectIsInstance(object) |
Whether the object is a Light. |
Light.record(objectOrRecordId) |
Returns the read-only #LightRecord of a Light |
Light.records |
A read-only list of all #LightRecords in the world database. |
Type LightRecord
LightRecord.color | |
LightRecord.duration | |
LightRecord.icon |
VFS path to the icon |
LightRecord.id |
Record id |
LightRecord.isCarriable | |
LightRecord.model |
VFS path to the model |
LightRecord.mwscript |
MWScript on this light (can be empty) |
LightRecord.name |
Human-readable name |
LightRecord.radius | |
LightRecord.sound |
VFS path to the sound |
LightRecord.value | |
LightRecord.weight |
Type Lockpick
Lockpick.baseType | |
Lockpick.objectIsInstance(object) |
Whether the object is a Lockpick. |
Lockpick.record(objectOrRecordId) |
Returns the read-only #LockpickRecord of a lockpick |
Lockpick.records |
A read-only list of all #LockpickRecords in the world database. |
Type LockpickRecord
LockpickRecord.icon |
VFS path to the icon |
LockpickRecord.id |
The record ID of the lockpick |
LockpickRecord.maxCondition |
The maximum number of uses of this lockpick |
LockpickRecord.model |
VFS path to the model |
LockpickRecord.mwscript |
MWScript on this lockpick (can be empty) |
LockpickRecord.name |
The name of the lockpick |
LockpickRecord.quality |
The quality of the lockpick |
LockpickRecord.value | |
LockpickRecord.weight |
Type Miscellaneous
Miscellaneous.baseType | |
Miscellaneous.createRecordDraft(miscellaneous) |
Creates a #MiscellaneousRecord without adding it to the world database. |
Miscellaneous.getSoul(object) |
Returns the read-only soul of a miscellaneous item |
Miscellaneous.objectIsInstance(object) |
Whether the object is a Miscellaneous. |
Miscellaneous.record(objectOrRecordId) |
Returns the read-only #MiscellaneousRecord of a miscellaneous item |
Miscellaneous.records |
A read-only list of all #MiscellaneousRecords in the world database. |
Miscellaneous.setSoul(object, soulId) |
Sets the soul of a miscellaneous item, intended for soul gem objects; Must be used in a global script. |
Type MiscellaneousRecord
MiscellaneousRecord.icon |
VFS path to the icon |
MiscellaneousRecord.id |
The record ID of the miscellaneous item |
MiscellaneousRecord.isKey | |
MiscellaneousRecord.model |
VFS path to the model |
MiscellaneousRecord.mwscript |
MWScript on this miscellaneous item (can be empty) |
MiscellaneousRecord.name |
The name of the miscellaneous item |
MiscellaneousRecord.value | |
MiscellaneousRecord.weight |
Type NPC
NPC.baseType | |
NPC.isWerewolf(actor) |
Whether the NPC or player is in the werewolf form at the moment. |
NPC.objectIsInstance(object) |
Whether the object is an NPC or a Player. |
NPC.record(objectOrRecordId) |
Returns the read-only #NpcRecord of an NPC |
NPC.records |
A read-only list of all #NpcRecords in the world database. |
NPC.stats |
Type NpcRecord
NpcRecord.class |
Name of the NPC's class (e. g. Acrobat) |
NpcRecord.hair |
Path to the hair body part model |
NpcRecord.head |
Path to the head body part model |
NpcRecord.id |
The record ID of the NPC |
NpcRecord.isMale |
The gender setting of the NPC |
NpcRecord.mwscript |
MWScript that is attached to this NPC |
NpcRecord.name | |
NpcRecord.race |
Type NpcStats
NpcStats.skills |
Type Player
Player.baseType | |
Player.objectIsInstance(object) |
Whether the object is a player. |
Type Potion
Potion.baseType | |
Potion.createRecordDraft(potion) |
Creates a #PotionRecord without adding it to the world database. |
Potion.objectIsInstance(object) |
Whether the object is a Potion. |
Potion.record(objectOrRecordId) |
Returns the read-only #PotionRecord of a potion |
Potion.records |
A read-only list of all #PotionRecords in the world database. |
Type PotionRecord
PotionRecord.icon |
VFS path to the icon |
PotionRecord.id |
Record id |
PotionRecord.model |
VFS path to the model |
PotionRecord.mwscript |
MWScript on this potion (can be empty) |
PotionRecord.name |
Human-readable name |
PotionRecord.value | |
PotionRecord.weight |
Type Probe
Probe.baseType | |
Probe.objectIsInstance(object) |
Whether the object is a Probe. |
Probe.record(objectOrRecordId) |
Returns the read-only #ProbeRecord of a probe |
Probe.records |
A read-only list of all #ProbeRecords in the world database. |
Type ProbeRecord
ProbeRecord.icon |
VFS path to the icon |
ProbeRecord.id |
The record ID of the probe |
ProbeRecord.maxCondition |
The maximum number of uses of this probe |
ProbeRecord.model |
VFS path to the model |
ProbeRecord.mwscript |
MWScript on this probe (can be empty) |
ProbeRecord.name |
The name of the probe |
ProbeRecord.quality |
The quality of the probe |
ProbeRecord.value | |
ProbeRecord.weight |
Type Repair
Repair.baseType | |
Repair.objectIsInstance(object) |
Whether the object is a Repair. |
Repair.record(objectOrRecordId) |
Returns the read-only #RepairRecord of a repair tool |
Repair.records |
A read-only list of all #RepairRecords in the world database. |
Type RepairRecord
RepairRecord.icon |
VFS path to the icon |
RepairRecord.id |
The record ID of the repair tool |
RepairRecord.maxCondition |
The maximum number of uses of this repair tool |
RepairRecord.model |
VFS path to the model |
RepairRecord.mwscript |
MWScript on this repair tool (can be empty) |
RepairRecord.name |
The name of the repair tool |
RepairRecord.quality |
The quality of the repair tool |
RepairRecord.value | |
RepairRecord.weight |
Type STANCE
STANCE.Nothing |
Default stance |
STANCE.Spell |
Magic stance |
STANCE.Weapon |
Weapon stance |
Type SkillStat
SkillStat.base |
The NPC's base skill value. |
SkillStat.damage |
The amount the skill has been damaged. |
SkillStat.modified |
The NPC's current skill value (read-only.) |
SkillStat.modifier |
The skill's modifier. |
SkillStat.progress |
[0-1] The NPC's skill progress. |
Type SkillStats
Type Static
Static.objectIsInstance(object) |
Whether the object is a Static. |
Static.record(objectOrRecordId) |
Returns the read-only #StaticRecord of a Static |
Static.records |
A read-only list of all #StaticRecords in the world database. |
Type StaticRecord
StaticRecord.id |
Record id |
StaticRecord.model |
VFS path to the model |
Type Weapon
Weapon.TYPE | |
Weapon.baseType | |
Weapon.createRecordDraft(weapon) |
Creates a #WeaponRecord without adding it to the world database. |
Weapon.objectIsInstance(object) |
Whether the object is a Weapon. |
Weapon.record(objectOrRecordId) |
Returns the read-only #WeaponRecord of a weapon |
Weapon.records |
A read-only list of all #WeaponRecords in the world database. |
Type WeaponRecord
WeaponRecord.chopMaxDamage | |
WeaponRecord.chopMinDamage | |
WeaponRecord.enchant | |
WeaponRecord.enchantCapacity | |
WeaponRecord.health | |
WeaponRecord.icon |
VFS path to the icon |
WeaponRecord.id |
Record id |
WeaponRecord.isMagical | |
WeaponRecord.isSilver | |
WeaponRecord.model |
VFS path to the model |
WeaponRecord.mwscript |
MWScript on this weapon (can be empty) |
WeaponRecord.name |
Human-readable name |
WeaponRecord.reach | |
WeaponRecord.slashMaxDamage | |
WeaponRecord.slashMinDamage | |
WeaponRecord.speed | |
WeaponRecord.thrustMaxDamage | |
WeaponRecord.thrustMinDamage | |
WeaponRecord.type |
See Weapon.TYPE |
WeaponRecord.value | |
WeaponRecord.weight |
Type WeaponTYPE
Type types
Field(s)
- #Activator types.Activator
-
#Activator functions
- #Actor types.Actor
-
Common #Actor functions for Creature, NPC, and Player.
- #Apparatus types.Apparatus
-
#Apparatus functions
- #Armor types.Armor
-
#Armor functions
- #Book types.Book
-
#Book functions
- #Clothing types.Clothing
-
#Clothing functions
- #Container types.Container
-
#Container functions
- #Creature types.Creature
-
#Creature functions
- #Door types.Door
-
#Door functions
- #ESM4Activator types.ESM4Activator
-
Functions for #ESM4Activator objects
- #ESM4Ammunition types.ESM4Ammunition
-
Functions for #ESM4Ammunition objects
- #ESM4Armor types.ESM4Armor
-
Functions for #ESM4Armor objects
- #ESM4Book types.ESM4Book
-
Functions for #ESM4Book objects
- #ESM4Clothing types.ESM4Clothing
-
Functions for #ESM4Clothing objects
- #ESM4Door types.ESM4Door
-
Functions for #ESM4Door objects
- #ESM4Ingredient types.ESM4Ingredient
-
Functions for #ESM4Ingredient objects
- #ESM4Light types.ESM4Light
-
Functions for #ESM4Light objects
- #ESM4Miscellaneous types.ESM4Miscellaneous
-
Functions for #ESM4Miscellaneous objects
- #ESM4Potion types.ESM4Potion
-
Functions for #ESM4Potion objects
- #ESM4Static types.ESM4Static
-
Functions for #ESM4Static objects
- #ESM4Weapon types.ESM4Weapon
-
Functions for #ESM4Weapon objects
- #Ingredient types.Ingredient
-
#Ingredient functions
- #Item types.Item
-
#Item functions (all pickable items that can be placed to an inventory or container)
- #Light types.Light
-
#Light functions
- #Lockpick types.Lockpick
-
#Lockpick functions
- #Miscellaneous types.Miscellaneous
-
Functions for #Miscellaneous objects
- #Player types.Player
-
#Player functions
- #Potion types.Potion
-
#Potion functions
- #Probe types.Probe
-
#Probe functions
- #Repair types.Repair
-
#Repair functions
- #Static types.Static
-
Functions for #Static objects
- #Weapon types.Weapon
-
#Weapon functions
Type Activator
Field(s)
- Activator.createRecordDraft(activator)
-
Creates a #ActivatorRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#ActivatorRecord activator
: A Lua table with the fields of a ActivatorRecord.
Return value
#ActivatorRecord: A strongly typed Activator record.
-
- Activator.objectIsInstance(object)
-
Whether the object is an Activator.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Activator.record(objectOrRecordId)
-
Returns the read-only #ActivatorRecord of an activator
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ActivatorRecord> Activator.records
-
A read-only list of all #ActivatorRecords in the world database.
Type ActivatorRecord
Field(s)
- #string ActivatorRecord.id
-
Record id
- #string ActivatorRecord.model
-
VFS path to the model
- #string ActivatorRecord.mwscript
-
MWScript on this activator (can be empty)
- #string ActivatorRecord.name
-
Human-readable name
Type ActiveEffect
Type Actor
Common functions for Creature, NPC, and Player.
Field(s)
- #EQUIPMENT_SLOT Actor.EQUIPMENT_SLOT
-
Available #EQUIPMENT_SLOT values.
Used in
Actor.equipment(obj)
andActor.setEquipment(obj, eqp)
.
- Actor.activeEffects(actor)
-
Return the active magic effects (#ActorActiveEffects) currently affecting the given actor.
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- Actor.activeSpells(actor)
-
Return the active spells (#ActorActiveSpells) currently affecting the given actor.
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- Actor.canMove(object)
-
Returns true if the object is an actor and is able to move.
For dead, paralyzed, or knocked down actors it returns false.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Actor.getCurrentSpeed(actor)
-
Current speed.
Parameter
-
openmw.core#GameObject actor
:
Return value
#number:
-
- Actor.getEquipment(actor, slot)
-
Get equipment.
Has two overloads: 1) With a single argument: returns a table
slot
-> openmw.core#GameObject of currently equipped items. See #EQUIPMENT_SLOT. Returns empty table if the actor doesn't have equipment slots. 2) With two arguments: returns an item equipped to the given slot.Parameters
-
openmw.core#GameObject actor
: -
#number slot
: Optional number of the equipment slot
Return value
-
- Actor.getPathfindingAgentBounds(actor)
-
Agent bounds to be used for pathfinding functions.
Parameter
-
openmw.core#GameObject actor
:
Return value
#table: with
shapeType
andhalfExtents
-
- Actor.getRunSpeed(actor)
-
Speed of running.
For dead actors it still returns a positive value.
Parameter
-
openmw.core#GameObject actor
:
Return value
#number:
-
- Actor.getSelectedSpell(actor)
-
Get currently selected spell
Parameter
-
openmw.core#GameObject actor
:
Return value
openmw.core#Spell, nil
-
- Actor.getStance(actor)
-
Returns the current stance (whether a weapon/spell is readied), see the list of #STANCE values.
Parameter
-
openmw.core#GameObject actor
:
Return value
#number:
-
- Actor.getWalkSpeed(actor)
-
Speed of walking.
For dead actors it still returns a positive value.
Parameter
-
openmw.core#GameObject actor
:
Return value
#number:
-
- Actor.hasEquipped(actor, item)
-
Returns
true
if the item is equipped on the actor.Parameters
-
openmw.core#GameObject actor
: -
openmw.core#GameObject item
:
Return value
#boolean:
-
- Actor.inventory(actor)
-
Actor inventory.
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- Actor.isOnGround(actor)
-
Is the actor standing on ground.
Can be called only from a local script.
Parameter
-
openmw.core#GameObject actor
:
Return value
#boolean:
-
- Actor.isSwimming(actor)
-
Is the actor in water.
Can be called only from a local script.
Parameter
-
openmw.core#GameObject actor
:
Return value
#boolean:
-
- Actor.objectIsInstance(object)
-
Whether the object is an actor.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Actor.setEquipment(actor, equipment)
-
Set equipment.
Keys in the table are equipment slots (see #EQUIPMENT_SLOT). Each value can be either a
GameObject
or recordId. Raises an error if the actor doesn't have equipment slots and table is not empty. Can be used only in local scripts and only on self.Parameters
-
openmw.core#GameObject actor
: -
#EquipmentTable equipment
:
Usage:
local self = require('openmw.self') local Actor = require('openmw.types').Actor Actor.setEquipment(self, {}) -- unequip all
-
- Actor.setSelectedSpell(actor, spell)
-
Set selected spell
Parameters
-
openmw.core#GameObject actor
: -
openmw.core#Spell spell
: Spell (can be nil)
-
- Actor.setStance(actor, stance)
-
Sets the current stance (whether a weapon/spell is readied), see the list of #STANCE values.
Can be used only in local scripts on self.
Parameters
-
openmw.core#GameObject actor
: -
#number stance
:
-
- Actor.spells(actor)
-
Return the spells (#ActorSpells) of the given actor.
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- #ActorStats Actor.stats
-
The actor's stats.
Type ActorActiveEffects
Read-only list of effects currently affecting the actor.
Usages:
-- print active effects for _, effect in pairs(Actor.activeEffects(self)) do print('Active Effect: '..effect.id..', attribute='..tostring(effect.affectedAttribute)..', skill='..tostring(effect.affectedSkill)..', magnitude='..tostring(effect.magnitude)) end
-- Check for a specific effect local effect = Actor.activeEffects(self):getEffect(core.magic.EFFECT_TYPE.Telekinesis) if effect then print(effect.id..', attribute='..tostring(effect.affectedAttribute)..', skill='..tostring(effect.affectedSkill)..', magnitude='..tostring(effect.magnitude)) else print('No Telekinesis effect') end
-- Check for a specific effect targeting a specific attribute. local effect = Actor.activeEffects(self):getEffect(core.magic.EFFECT_TYPE.FortifyAttribute, core.ATTRIBUTE.Luck) if effect then print(effect.id..', attribute='..tostring(effect.affectedAttribute)..', skill='..tostring(effect.affectedSkill)..', magnitude='..tostring(effect.magnitude)) else print('No Fortify Luck effect') end
Field(s)
- ActorActiveEffects:getEffect(string, string)
-
Get a specific active effect on the actor.
Parameters
-
string
: effect ID -
string
: Optional skill or attribute ID
Return value
#ActiveEffect: if such an effect is active, nil otherwise
-
Type ActorActiveSpells
Read-only list of spells currently affecting the actor.
Usages:
-- print active spells for _, spell in pairs(Actor.activeSpells(self)) do print('Active Spell: '..tostring(spell)) end
-- Check for a specific spell if Actor.activeSpells(self):isSpellActive('bound longbow') then print('Player has bound longbow') else print('Player does not have bound longbow') end
Field(s)
- ActorActiveSpells:isSpellActive(spellOrId)
-
Get whether a specific spell is active on the actor.
Parameter
-
#any spellOrId
: openmw.core#Spell or string spell id
Return value
true if spell is active, false otherwise
-
Type ActorSpells
List of spells with additional functions add/remove/clear (modification are allowed only in global scripts or on self).
Usages:
-- print available spells local mySpells = types.Actor.spells(self) for _, spell in pairs(mySpells) do print(spell.id) end
-- print available spells (equivalent) local mySpells = types.Actor.spells(self) for i = 1, #mySpells do print(mySpells[i].id) end
-- add ALL spells that exist in the world local mySpells = types.Actor.spells(self) for _, spell in pairs(core.magic.spells) do if spell.type == core.magic.SPELL_TYPE.Spell then mySpells:add(spell) end end
-- add specific spell types.Actor.spells(self):add('thunder fist')
-- check specific spell local mySpells = types.Actor.spells(self) if mySpells['thunder fist'] then print('I have thunder fist') end
Field(s)
- ActorSpells:add(spellOrId)
-
Add spell (only in global scripts or on self).
Parameter
-
#any spellOrId
: openmw.core#Spell or string spell id
-
- ActorSpells:clear()
-
Remove all spells (only in global scripts or on self).
- ActorSpells:remove(spellOrId)
-
Remove spell (only in global scripts or on self).
Parameter
-
#any spellOrId
: openmw.core#Spell or string spell id
-
Type ActorStats
Field(s)
- ActorStats.level(actor)
-
Level (returns #LevelStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
Type Apparatus
Extends #Item
Field(s)
- Apparatus.objectIsInstance(object)
-
Whether the object is an Apparatus.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Apparatus.record(objectOrRecordId)
-
Returns the read-only #ApparatusRecord of an apparatus
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ApparatusRecord> Apparatus.records
-
A read-only list of all #ApparatusRecords in the world database.
Type ApparatusRecord
Field(s)
- #string ApparatusRecord.icon
-
VFS path to the icon
- #string ApparatusRecord.id
-
The record ID of the apparatus
- #string ApparatusRecord.model
-
VFS path to the model
- #string ApparatusRecord.mwscript
-
MWScript on this apparatus (can be empty)
- #string ApparatusRecord.name
-
The name of the apparatus
- #number ApparatusRecord.quality
-
The quality of the apparatus
- #number ApparatusRecord.type
-
The type of apparatus. See Apparatus.TYPE
- #number ApparatusRecord.value
- #number ApparatusRecord.weight
Type ApparatusTYPE
Apparatus.TYPE
Field(s)
- #number ApparatusTYPE.Alembic
- #number ApparatusTYPE.Calcinator
- #number ApparatusTYPE.MortarPestle
- #number ApparatusTYPE.Retort
Type Armor
Extends #Item
Field(s)
- Armor.createRecordDraft(armor)
-
Creates a #ArmorRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#ArmorRecord armor
: A Lua table with the fields of a ArmorRecord.
Return value
#ArmorRecord: A strongly typed Armor record.
-
- Armor.objectIsInstance(object)
-
Whether the object is an Armor.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Armor.record(objectOrRecordId)
-
Returns the read-only #ArmorRecord of an Armor
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ArmorRecord> Armor.records
-
A read-only list of all #ArmorRecords in the world database.
Type ArmorRecord
Field(s)
- #number ArmorRecord.baseArmor
-
The base armor rating of this armor
- #string ArmorRecord.enchant
-
The enchantment ID of this armor (can be empty)
- #number ArmorRecord.enchantCapacity
- #number ArmorRecord.health
- #string ArmorRecord.icon
-
VFS path to the icon
- #string ArmorRecord.id
-
Record id
- #string ArmorRecord.model
-
VFS path to the model
- #string ArmorRecord.mwscript
-
MWScript on this armor (can be empty)
- #string ArmorRecord.name
-
Human-readable name
- #number ArmorRecord.type
-
See Armor.TYPE
- #number ArmorRecord.value
- #number ArmorRecord.weight
Type ArmorTYPE
Armor.TYPE
Field(s)
- #number ArmorTYPE.Boots
- #number ArmorTYPE.Cuirass
- #number ArmorTYPE.Greaves
- #number ArmorTYPE.Helmet
- #number ArmorTYPE.LBracer
- #number ArmorTYPE.LGauntlet
- #number ArmorTYPE.LPauldron
- #number ArmorTYPE.RBracer
- #number ArmorTYPE.RGauntlet
- #number ArmorTYPE.RPauldron
- #number ArmorTYPE.Shield
Type AttributeStat
Field(s)
- #number AttributeStat.base
-
The actor's base attribute value.
- #number AttributeStat.damage
-
The amount the attribute has been damaged.
- #number AttributeStat.modified
-
The actor's current attribute value (read-only.)
- #number AttributeStat.modifier
-
The attribute's modifier.
Type AttributeStats
Field(s)
- AttributeStats.agility(actor)
-
Agility (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.endurance(actor)
-
Endurance (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.intelligence(actor)
-
Intelligence (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.luck(actor)
-
Luck (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.personality(actor)
-
Personality (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.speed(actor)
-
Speed (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.strength(actor)
-
Strength (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- AttributeStats.willpower(actor)
-
Willpower (returns #AttributeStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
Type Book
Extends #Item
Field(s)
- #BookSKILL Book.SKILL
-
DEPRECATED, use openmw.core#SKILL
- Book.createRecordDraft(book)
-
Creates a #BookRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#BookRecord book
: A Lua table with the fields of a BookRecord.
Return value
#BookRecord: A strongly typed Book record.
-
- Book.objectIsInstance(object)
-
Whether the object is a Book.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Book.record(objectOrRecordId)
-
Returns the read-only #BookRecord of a book
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#BookRecord> Book.records
-
A read-only list of all #BookRecords in the world database.
Type BookRecord
Field(s)
- #string BookRecord.enchant
-
The enchantment ID of this book (can be empty)
- #number BookRecord.enchantCapacity
- #string BookRecord.icon
-
VFS path to the icon
- #string BookRecord.id
-
The record ID of the book
- #boolean BookRecord.isScroll
- #string BookRecord.model
-
VFS path to the model
- #string BookRecord.mwscript
-
MWScript on this book (can be empty)
- #string BookRecord.name
-
Name of the book
- #string BookRecord.skill
-
The skill that this book teaches. See openmw.core#SKILL
- #string BookRecord.text
-
The text content of the book
- #number BookRecord.value
- #number BookRecord.weight
Type BookSKILL
Book.SKILL
Field(s)
- #string BookSKILL.acrobatics
-
"acrobatics"
- #string BookSKILL.alchemy
-
"alchemy"
- #string BookSKILL.alteration
-
"alteration"
- #string BookSKILL.armorer
-
"armorer"
- #string BookSKILL.athletics
-
"athletics"
- #string BookSKILL.axe
-
"axe"
- #string BookSKILL.block
-
"block"
- #string BookSKILL.bluntWeapon
-
"bluntweapon"
- #string BookSKILL.conjuration
-
"conjuration"
- #string BookSKILL.destruction
-
"destruction"
- #string BookSKILL.enchant
-
"enchant"
- #string BookSKILL.handToHand
-
"handtohand"
- #string BookSKILL.heavyArmor
-
"heavyarmor"
- #string BookSKILL.illusion
-
"illusion"
- #string BookSKILL.lightArmor
-
"lightarmor"
- #string BookSKILL.longBlade
-
"longblade"
- #string BookSKILL.marksman
-
"marksman"
- #string BookSKILL.mediumArmor
-
"mediumarmor"
- #string BookSKILL.mercantile
-
"mercantile"
- #string BookSKILL.mysticism
-
"mysticism"
- #string BookSKILL.restoration
-
"restoration"
- #string BookSKILL.security
-
"security"
- #string BookSKILL.shortBlade
-
"shortblade"
- #string BookSKILL.sneak
-
"sneak"
- #string BookSKILL.spear
-
"spear"
- #string BookSKILL.speechcraft
-
"speechcraft"
- #string BookSKILL.unarmored
-
"unarmored"
Type Clothing
Extends #Item
Field(s)
- Clothing.createRecordDraft(clothing)
-
Creates a #ClothingRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#ClothingRecord clothing
: A Lua table with the fields of a ClothingRecord.
Return value
#ClothingRecord: A strongly typed clothing record.
-
- Clothing.objectIsInstance(object)
-
Whether the object is a Clothing.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Clothing.record(objectOrRecordId)
-
Returns the read-only #ClothingRecord of a Clothing
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ClothingRecord> Clothing.records
-
A read-only list of all #ClothingRecords in the world database.
Type ClothingRecord
Field(s)
- #string ClothingRecord.enchant
-
The enchantment ID of this clothing (can be empty)
- #number ClothingRecord.enchantCapacity
- #string ClothingRecord.icon
-
VFS path to the icon
- #string ClothingRecord.id
-
Record id
- #string ClothingRecord.model
-
VFS path to the model
- #string ClothingRecord.mwscript
-
MWScript on this clothing (can be empty)
- #string ClothingRecord.name
-
Name of the clothing
- #number ClothingRecord.type
-
See Clothing.TYPE
- #number ClothingRecord.value
- #number ClothingRecord.weight
Type ClothingTYPE
Clothing.TYPE
Field(s)
- #number ClothingTYPE.Amulet
- #number ClothingTYPE.Belt
- #number ClothingTYPE.LGlove
- #number ClothingTYPE.Pants
- #number ClothingTYPE.RGlove
- #number ClothingTYPE.Ring
- #number ClothingTYPE.Robe
- #number ClothingTYPE.Shirt
- #number ClothingTYPE.Shoes
- #number ClothingTYPE.Skirt
Type Container
Field(s)
- Container.capacity(object)
-
Returns the capacity of a container
Parameter
-
openmw.core#GameObject object
:
Return value
#number:
-
- Container.content(object)
-
Container content.
Parameter
-
openmw.core#GameObject object
:
Return value
-
- Container.encumbrance(object)
-
Returns the total weight of everything in a container
Parameter
-
openmw.core#GameObject object
:
Return value
#number:
-
- Container.objectIsInstance(object)
-
Whether the object is a Container.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Container.record(objectOrRecordId)
-
Returns the read-only #ContainerRecord of a container
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ContainerRecord> Container.records
-
A read-only list of all #ContainerRecords in the world database.
Type ContainerRecord
Field(s)
- #string ContainerRecord.id
-
Record id
- #string ContainerRecord.model
-
VFS path to the model
- #string ContainerRecord.mwscript
-
MWScript on this container (can be empty)
- #string ContainerRecord.name
-
Human-readable name
- #number ContainerRecord.weight
-
capacity of this container
Type Creature
Extends #Actor
Field(s)
- Creature.objectIsInstance(object)
-
Whether the object is a creature.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Creature.record(objectOrRecordId)
-
Returns the read-only #CreatureRecord of a creature
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#CreatureRecord> Creature.records
-
A read-only list of all #CreatureRecords in the world database.
Type CreatureRecord
Field(s)
- #string CreatureRecord.baseCreature
-
Record id of a base creature, which was modified to create this one
- #string CreatureRecord.id
-
The record ID of the creature
- #string CreatureRecord.model
-
VFS path to the creature's model
- #string CreatureRecord.mwscript
- #string CreatureRecord.name
- #number CreatureRecord.soulValue
-
The soul value of the creature record
Type Door
Field(s)
- Door.destCell(object)
-
Destination cell (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- Door.destPosition(object)
-
Destination (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- Door.destRotation(object)
-
Destination rotation (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- Door.isTeleport(object)
-
Whether the door is a teleport.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Door.objectIsInstance(object)
-
Whether the object is a Door.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Door.record(objectOrRecordId)
-
Returns the read-only #DoorRecord of a door
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#DoorRecord> Door.records
-
A read-only list of all #DoorRecords in the world database.
Type DoorRecord
Field(s)
- #string DoorRecord.closeSound
-
VFS path to the sound of closing
- #string DoorRecord.id
-
Record id
- #string DoorRecord.model
-
VFS path to the model
- #string DoorRecord.mwscript
-
MWScript on this door (can be empty)
- #string DoorRecord.name
-
Human-readable name
- #string DoorRecord.openSound
-
VFS path to the sound of opening
Type DynamicStat
Field(s)
- #number DynamicStat.base
- #number DynamicStat.current
- #number DynamicStat.modifier
Type DynamicStats
Field(s)
- DynamicStats.fatigue(actor)
-
Fatigue (returns #DynamicStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- DynamicStats.health(actor)
-
Health (returns #DynamicStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- DynamicStats.magicka(actor)
-
Magicka (returns #DynamicStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
Type EQUIPMENT_SLOT
Field(s)
- #number EQUIPMENT_SLOT.Ammunition
- #number EQUIPMENT_SLOT.Amulet
- #number EQUIPMENT_SLOT.Belt
- #number EQUIPMENT_SLOT.Boots
- #number EQUIPMENT_SLOT.CarriedLeft
- #number EQUIPMENT_SLOT.CarriedRight
- #number EQUIPMENT_SLOT.Cuirass
- #number EQUIPMENT_SLOT.Greaves
- #number EQUIPMENT_SLOT.Helmet
- #number EQUIPMENT_SLOT.LeftGauntlet
- #number EQUIPMENT_SLOT.LeftPauldron
- #number EQUIPMENT_SLOT.LeftRing
- #number EQUIPMENT_SLOT.Pants
- #number EQUIPMENT_SLOT.RightGauntlet
- #number EQUIPMENT_SLOT.RightPauldron
- #number EQUIPMENT_SLOT.RightRing
- #number EQUIPMENT_SLOT.Robe
- #number EQUIPMENT_SLOT.Shirt
- #number EQUIPMENT_SLOT.Skirt
Type ESM4Activator
Type ESM4Ammunition
Type ESM4Armor
Type ESM4Book
Type ESM4Clothing
Type ESM4Door
Field(s)
- ESM4Door.destCell(object)
-
Destination cell (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- ESM4Door.destPosition(object)
-
Destination (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- ESM4Door.destRotation(object)
-
Destination rotation (only if a teleport door).
Parameter
-
openmw.core#GameObject object
:
Return value
-
- ESM4Door.isTeleport(object)
-
Whether the door is a teleport.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- ESM4Door.objectIsInstance(object)
-
Whether the object is a ESM4Door.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- ESM4Door.record(objectOrRecordId)
-
Returns the read-only #ESM4DoorRecord of a door
Parameter
-
#any objectOrRecordId
:
Return value
-
- ESM4Door.records()
-
Returns a read-only list of all #ESM4DoorRecords in the world database.
Return value
Type ESM4DoorRecord
Field(s)
- #string ESM4DoorRecord.id
-
Record id
- #string ESM4DoorRecord.model
-
VFS path to the model
- #string ESM4DoorRecord.name
-
Human-readable name
Type ESM4Ingredient
Type ESM4Light
Type ESM4Miscellaneous
Type ESM4Potion
Type ESM4Static
Type ESM4Weapon
Type EquipmentTable
Map from values of #EQUIPMENT_SLOT to items openmw.core#GameObjects
EquipmentTable
is a map of #number
to openmw.core#GameObject
.
Type Ingredient
Extends #Item
Field(s)
- Ingredient.objectIsInstance(object)
-
Whether the object is an Ingredient.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Ingredient.record(objectOrRecordId)
-
Returns the read-only #IngredientRecord of a Ingredient
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#IngredientRecord> Ingredient.records
-
A read-only list of all #IngredientRecords in the world database.
Type IngredientRecord
Field(s)
- #string IngredientRecord.icon
-
VFS path to the icon
- #string IngredientRecord.id
-
Record id
- #string IngredientRecord.model
-
VFS path to the model
- #string IngredientRecord.mwscript
-
MWScript on this potion (can be empty)
- #string IngredientRecord.name
-
Human-readable name
- #number IngredientRecord.value
- #number IngredientRecord.weight
Type Item
Functions for pickable items that can be placed to an inventory or container
Field(s)
- Item.objectIsInstance(object)
-
Whether the object is an item.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
Type LevelStat
Field(s)
- #number LevelStat.current
-
The actor's current level.
- #number LevelStat.progress
-
The NPC's level progress (read-only.)
Type Light
Extends #Item
Field(s)
- Light.objectIsInstance(object)
-
Whether the object is a Light.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Light.record(objectOrRecordId)
-
Returns the read-only #LightRecord of a Light
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#LightRecord> Light.records
-
A read-only list of all #LightRecords in the world database.
Type LightRecord
Field(s)
- #number LightRecord.color
- #number LightRecord.duration
- #string LightRecord.icon
-
VFS path to the icon
- #string LightRecord.id
-
Record id
- #boolean LightRecord.isCarriable
- #string LightRecord.model
-
VFS path to the model
- #string LightRecord.mwscript
-
MWScript on this light (can be empty)
- #string LightRecord.name
-
Human-readable name
- #number LightRecord.radius
- #string LightRecord.sound
-
VFS path to the sound
- #number LightRecord.value
- #number LightRecord.weight
Type Lockpick
Extends #Item
Field(s)
- Lockpick.objectIsInstance(object)
-
Whether the object is a Lockpick.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Lockpick.record(objectOrRecordId)
-
Returns the read-only #LockpickRecord of a lockpick
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#LockpickRecord> Lockpick.records
-
A read-only list of all #LockpickRecords in the world database.
Type LockpickRecord
Field(s)
- #string LockpickRecord.icon
-
VFS path to the icon
- #string LockpickRecord.id
-
The record ID of the lockpick
- #number LockpickRecord.maxCondition
-
The maximum number of uses of this lockpick
- #string LockpickRecord.model
-
VFS path to the model
- #string LockpickRecord.mwscript
-
MWScript on this lockpick (can be empty)
- #string LockpickRecord.name
-
The name of the lockpick
- #number LockpickRecord.quality
-
The quality of the lockpick
- #number LockpickRecord.value
- #number LockpickRecord.weight
Type Miscellaneous
Extends #Item
Field(s)
- Miscellaneous.createRecordDraft(miscellaneous)
-
Creates a #MiscellaneousRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#MiscellaneousRecord miscellaneous
: A Lua table with the fields of a MiscellaneousRecord.
Return value
#MiscellaneousRecord: A strongly typed Miscellaneous record.
-
- Miscellaneous.getSoul(object)
-
Returns the read-only soul of a miscellaneous item
Parameter
-
openmw.core#GameObject object
:
Return value
#string:
-
- Miscellaneous.objectIsInstance(object)
-
Whether the object is a Miscellaneous.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Miscellaneous.record(objectOrRecordId)
-
Returns the read-only #MiscellaneousRecord of a miscellaneous item
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#MiscellaneousRecord> Miscellaneous.records
-
A read-only list of all #MiscellaneousRecords in the world database.
- Miscellaneous.setSoul(object, soulId)
-
Sets the soul of a miscellaneous item, intended for soul gem objects; Must be used in a global script.
Parameters
-
openmw.core#GameObject object
: -
#string soulId
: Record ID for the soul of the creature to use
-
Type MiscellaneousRecord
Field(s)
- #string MiscellaneousRecord.icon
-
VFS path to the icon
- #string MiscellaneousRecord.id
-
The record ID of the miscellaneous item
- #boolean MiscellaneousRecord.isKey
- #string MiscellaneousRecord.model
-
VFS path to the model
- #string MiscellaneousRecord.mwscript
-
MWScript on this miscellaneous item (can be empty)
- #string MiscellaneousRecord.name
-
The name of the miscellaneous item
- #number MiscellaneousRecord.value
- #number MiscellaneousRecord.weight
Type NPC
Extends #Actor
Field(s)
- NPC.isWerewolf(actor)
-
Whether the NPC or player is in the werewolf form at the moment.
Parameter
-
openmw.core#GameObject actor
:
Return value
#boolean:
-
- NPC.objectIsInstance(object)
-
Whether the object is an NPC or a Player.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- NPC.record(objectOrRecordId)
-
Returns the read-only #NpcRecord of an NPC
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#NpcRecord> NPC.records
-
A read-only list of all #NpcRecords in the world database.
Type NpcRecord
Field(s)
- #string NpcRecord.class
-
Name of the NPC's class (e. g. Acrobat)
- #string NpcRecord.hair
-
Path to the hair body part model
- #string NpcRecord.head
-
Path to the head body part model
- #string NpcRecord.id
-
The record ID of the NPC
- #bool NpcRecord.isMale
-
The gender setting of the NPC
- #string NpcRecord.mwscript
-
MWScript that is attached to this NPC
- #string NpcRecord.name
- #string NpcRecord.race
Type NpcStats
Field(s)
Type Player
Extends #NPC
Field(s)
- Player.objectIsInstance(object)
-
Whether the object is a player.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
Type Potion
Extends #Item
Field(s)
- Potion.createRecordDraft(potion)
-
Creates a #PotionRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#PotionRecord potion
: A Lua table with the fields of a PotionRecord.
Return value
#PotionRecord: A strongly typed Potion record.
-
- Potion.objectIsInstance(object)
-
Whether the object is a Potion.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Potion.record(objectOrRecordId)
-
Returns the read-only #PotionRecord of a potion
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#PotionRecord> Potion.records
-
A read-only list of all #PotionRecords in the world database.
Type PotionRecord
Field(s)
- #string PotionRecord.icon
-
VFS path to the icon
- #string PotionRecord.id
-
Record id
- #string PotionRecord.model
-
VFS path to the model
- #string PotionRecord.mwscript
-
MWScript on this potion (can be empty)
- #string PotionRecord.name
-
Human-readable name
- #number PotionRecord.value
- #number PotionRecord.weight
Type Probe
Extends #Item
Field(s)
- Probe.objectIsInstance(object)
-
Whether the object is a Probe.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Probe.record(objectOrRecordId)
-
Returns the read-only #ProbeRecord of a probe
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#ProbeRecord> Probe.records
-
A read-only list of all #ProbeRecords in the world database.
Type ProbeRecord
Field(s)
- #string ProbeRecord.icon
-
VFS path to the icon
- #string ProbeRecord.id
-
The record ID of the probe
- #number ProbeRecord.maxCondition
-
The maximum number of uses of this probe
- #string ProbeRecord.model
-
VFS path to the model
- #string ProbeRecord.mwscript
-
MWScript on this probe (can be empty)
- #string ProbeRecord.name
-
The name of the probe
- #number ProbeRecord.quality
-
The quality of the probe
- #number ProbeRecord.value
- #number ProbeRecord.weight
Type Repair
Extends #Item
Field(s)
- Repair.objectIsInstance(object)
-
Whether the object is a Repair.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Repair.record(objectOrRecordId)
-
Returns the read-only #RepairRecord of a repair tool
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#RepairRecord> Repair.records
-
A read-only list of all #RepairRecords in the world database.
Type RepairRecord
Field(s)
- #string RepairRecord.icon
-
VFS path to the icon
- #string RepairRecord.id
-
The record ID of the repair tool
- #number RepairRecord.maxCondition
-
The maximum number of uses of this repair tool
- #string RepairRecord.model
-
VFS path to the model
- #string RepairRecord.mwscript
-
MWScript on this repair tool (can be empty)
- #string RepairRecord.name
-
The name of the repair tool
- #number RepairRecord.quality
-
The quality of the repair tool
- #number RepairRecord.value
- #number RepairRecord.weight
Type STANCE
Field(s)
- #number STANCE.Nothing
-
Default stance
- #number STANCE.Spell
-
Magic stance
- #number STANCE.Weapon
-
Weapon stance
Type SkillStat
Field(s)
- #number SkillStat.base
-
The NPC's base skill value.
- #number SkillStat.damage
-
The amount the skill has been damaged.
- #number SkillStat.modified
-
The NPC's current skill value (read-only.)
- #number SkillStat.modifier
-
The skill's modifier.
- #number SkillStat.progress
-
[0-1] The NPC's skill progress.
Type SkillStats
Field(s)
- SkillStats.acrobatics(actor)
-
Acrobatics (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.alchemy(actor)
-
Alchemy (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.alteration(actor)
-
Alteration (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.armorer(actor)
-
Armorer (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.athletics(actor)
-
Athletics (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.axe(actor)
-
Axe (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.block(actor)
-
Block (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.bluntweapon(actor)
-
Blunt Weapon (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.conjuration(actor)
-
Conjuration (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.destruction(actor)
-
Destruction (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.enchant(actor)
-
Enchant (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.handtohand(actor)
-
Hand To Hand (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.heavyarmor(actor)
-
Heavy Armor (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.illusion(actor)
-
Illusion (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.lightarmor(actor)
-
Light Armor (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.longblade(actor)
-
Long Blade (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.marksman(actor)
-
Marksman (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.mediumarmor(actor)
-
Medium Armor (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.mercantile(actor)
-
Mercantile (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.mysticism(actor)
-
Mysticism (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.restoration(actor)
-
Restoration (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.security(actor)
-
Security (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.shortblade(actor)
-
Short Blade (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.sneak(actor)
-
Sneak (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.spear(actor)
-
Spear (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.speechcraft(actor)
-
Speechcraft (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
- SkillStats.unarmored(actor)
-
Unarmored (returns #SkillStat)
Parameter
-
openmw.core#GameObject actor
:
Return value
-
Type Static
Field(s)
- Static.objectIsInstance(object)
-
Whether the object is a Static.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Static.record(objectOrRecordId)
-
Returns the read-only #StaticRecord of a Static
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#StaticRecord> Static.records
-
A read-only list of all #StaticRecords in the world database.
Type StaticRecord
Field(s)
- #string StaticRecord.id
-
Record id
- #string StaticRecord.model
-
VFS path to the model
Type Weapon
Extends #Item
Field(s)
- Weapon.createRecordDraft(weapon)
-
Creates a #WeaponRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#WeaponRecord weapon
: A Lua table with the fields of a WeaponRecord.
Return value
#WeaponRecord: A strongly typed Weapon record.
-
- Weapon.objectIsInstance(object)
-
Whether the object is a Weapon.
Parameter
-
openmw.core#GameObject object
:
Return value
#boolean:
-
- Weapon.record(objectOrRecordId)
-
Returns the read-only #WeaponRecord of a weapon
Parameter
-
#any objectOrRecordId
:
Return value
-
- #list<#WeaponRecord> Weapon.records
-
A read-only list of all #WeaponRecords in the world database.
Type WeaponRecord
Field(s)
- #number WeaponRecord.chopMaxDamage
- #number WeaponRecord.chopMinDamage
- #string WeaponRecord.enchant
- #number WeaponRecord.enchantCapacity
- #number WeaponRecord.health
- #string WeaponRecord.icon
-
VFS path to the icon
- #string WeaponRecord.id
-
Record id
- #boolean WeaponRecord.isMagical
- #boolean WeaponRecord.isSilver
- #string WeaponRecord.model
-
VFS path to the model
- #string WeaponRecord.mwscript
-
MWScript on this weapon (can be empty)
- #string WeaponRecord.name
-
Human-readable name
- #number WeaponRecord.reach
- #number WeaponRecord.slashMaxDamage
- #number WeaponRecord.slashMinDamage
- #number WeaponRecord.speed
- #number WeaponRecord.thrustMaxDamage
- #number WeaponRecord.thrustMinDamage
- #number WeaponRecord.type
-
See Weapon.TYPE
- #number WeaponRecord.value
- #number WeaponRecord.weight
Type WeaponTYPE
Weapon.TYPE
Field(s)
- #number WeaponTYPE.Arrow
- #number WeaponTYPE.AxeOneHand
- #number WeaponTYPE.AxeTwoHand
- #number WeaponTYPE.BluntOneHand
- #number WeaponTYPE.BluntTwoClose
- #number WeaponTYPE.BluntTwoWide
- #number WeaponTYPE.Bolt
- #number WeaponTYPE.LongBladeOneHand
- #number WeaponTYPE.LongBladeTwoHand
- #number WeaponTYPE.MarksmanBow
- #number WeaponTYPE.MarksmanCrossbow
- #number WeaponTYPE.MarksmanThrown
- #number WeaponTYPE.ShortBladeOneHand
- #number WeaponTYPE.SpearTwoWide