Package openmw.content

Allows for manipulation of the data loaded from content files while the game is first started.

Records can be created and deleted using this package as if a content file had done so.

load

Usage

local content = require('openmw.content')

Type content

content.RANGE

openmw.core#SpellRange: Magic ranges

content.activators

#ActivatorContent: Activator manipulation.

content.apparatuses

#ApparatusContent: Apparatus manipulation.

content.attributes

#AttributeContent: Attribute manipulation.

content.books

#BookContent: Book manipulation.

content.classes

#ClassContent: Class manipulation.

content.doors

#DoorContent: Door manipulation.

content.enchantments

#EnchantmentContent: Enchantment manipulation.

content.factions

#FactionContent: Faction manipulation.

content.gameSettings

#GMSTContent: GMST manipulation.

content.globals

#GlobalContent: Global variable manipulation.

content.ingredients

#IngredientContent: Ingredient manipulation.

content.levelledCreatures

#LevCreatureContent: Levelled creature manipulation.

content.levelledItems

#LevItemContent: Levelled item manipulation.

content.lights

#LightContent: Light manipulation.

content.lockpicks

#LockpickContent: Lockpick manipulation.

content.magicEffects

#MagicEffectContent: Magic effect manipulation.

content.miscs

#MiscContent: Misc manipulation.

content.potions

#PotionContent: Potion manipulation.

content.probes

#ProbeContent: Probe manipulation.

content.races

#RaceContent: Race manipulation.

content.repairs

#RepairContent: Repair item manipulation.

content.skills

#SkillContent: Skill manipulation.

content.sounds

#SoundContent: Sound manipulation.

content.spells

#SpellContent: Spell manipulation.

content.statics

#StaticContent: Static manipulation.

Type ActivatorContent

Type ApparatusContent

Type AttributeContent

Type BookContent

Type ClassContent

Type DoorContent

Type EnchantmentContent

Type FactionContent

Type GMSTContent

GMSTContent.getFallbacks()

Returns a table containing all fallback values defined in openmw.cfg.

GMSTContent.records

A mutable list of all game settings.

Type GlobalContent

GlobalContent.records

A mutable list of all global mwscript variables.

Type IngredientContent

Type LevCreatureContent

Type LevItemContent

Type LightContent

Type LockpickContent

Type MagicEffectContent

Type MiscContent

Type PotionContent

Type ProbeContent

Type RaceContent

Type RepairContent

Type SkillContent

Type SoundContent

Type SpellContent

Type StaticContent

Type content

Field(s)

openmw.core#SpellRange content.RANGE

openmw.core#SpellRange: Magic ranges

#ActivatorContent content.activators

#ActivatorContent: Activator manipulation.

#ApparatusContent content.apparatuses

#ApparatusContent: Apparatus manipulation.

#AttributeContent content.attributes

#AttributeContent: Attribute manipulation.

#BookContent content.books

#BookContent: Book manipulation.

#ClassContent content.classes

#ClassContent: Class manipulation.

#DoorContent content.doors

#DoorContent: Door manipulation.

#EnchantmentContent content.enchantments

#EnchantmentContent: Enchantment manipulation.

#FactionContent content.factions

#FactionContent: Faction manipulation.

#GMSTContent content.gameSettings

#GMSTContent: GMST manipulation.

#GlobalContent content.globals

#GlobalContent: Global variable manipulation.

#IngredientContent content.ingredients

#IngredientContent: Ingredient manipulation.

#LevCreatureContent content.levelledCreatures

#LevCreatureContent: Levelled creature manipulation.

#LevItemContent content.levelledItems

#LevItemContent: Levelled item manipulation.

#LightContent content.lights

#LightContent: Light manipulation.

#LockpickContent content.lockpicks

#LockpickContent: Lockpick manipulation.

#MagicEffectContent content.magicEffects

#MagicEffectContent: Magic effect manipulation.

#MiscContent content.miscs

#MiscContent: Misc manipulation.

#PotionContent content.potions

#PotionContent: Potion manipulation.

#ProbeContent content.probes

#ProbeContent: Probe manipulation.

#RaceContent content.races

#RaceContent: Race manipulation.

#RepairContent content.repairs

#RepairContent: Repair item manipulation.

#SkillContent content.skills

#SkillContent: Skill manipulation.

#SoundContent content.sounds

#SoundContent: Sound manipulation.

#SpellContent content.spells

#SpellContent: Spell manipulation.

#StaticContent content.statics

#StaticContent: Static manipulation.

Type ActivatorContent

Field(s)

#list<openmw.types#ActivatorRecord> ActivatorContent.records

A mutable list of all openmw.types#ActivatorRecords.

Usage

content.activators.records.MyActivator = { mwscript = 'float', model = 'meshes/w/w_chitin_arrow.nif', name = 'Quest marker' }

Type ApparatusContent

Field(s)

openmw.types#ApparatusTYPE ApparatusContent.TYPE

openmw.types#ApparatusTYPE: Apparatus types

#list<openmw.types#ApparatusRecord> ApparatusContent.records

A mutable list of all openmw.types#ApparatusRecords.

Record IDs are immutable.

Usages

  • content.apparatuses.records.MyAlembic = { name = 'Industrial Alembic', model = 'meshes/a/alembic.nif', icon = 'icons/a/alembic.dds', type = content.apparatuses.TYPE.Alembic, quality = 2.5, weight = 4, value = 300 }
  • content.apparatuses.records.BetterAlembic = { template = content.apparatuses.records.MyAlembic, quality = 10 }

Type AttributeContent

Field(s)

#list<openmw.core#AttributeRecord> AttributeContent.records

A mutable list of all openmw.core#AttributeRecords.

Usage

content.attributes.records.MyAttribute = { name = 'Toddhood', description = 'n% of the power to reach Bethesda.', werewolfValue = 100 }

Type BookContent

Field(s)

#list<openmw.types#BookRecord> BookContent.records

A mutable list of all openmw.types#BookRecords.

Usage

content.books.records.MyBook = { template = content.books.records['bk_lustyargonianmaid'], text = content.books.records['bk_BoethiahPillowBook'].text }

Type ClassContent

Field(s)

#list<openmw.types#ClassRecord> ClassContent.records

A mutable list of all openmw.types#ClassRecords.

Usage

content.classes.records.MyClass = { name = 'Nightbonk', template = content.classes.records['Nightblade'], majorSkills = { 'BluntWeapon', 'Mysticism', 'Illusion', 'Alteration', 'Sneak' } }

Type DoorContent

Field(s)

#list<openmw.types#DoorRecord> DoorContent.records

A mutable list of all openmw.types#DoorRecords.

Usage

content.doors.records.MyDoor = { template = content.doors.records['door_dwrv_double00'], mwscript = 'blockedDoor', name = 'Overly Heavy Dwemer Door' }

Type EnchantmentContent

Field(s)

openmw.core#EnchantmentType EnchantmentContent.TYPE

openmw.core#EnchantmentType: Enchantment types

#list<openmw.core#Enchantment> EnchantmentContent.records

A mutable list of all openmw.core#Enchantments.

Usage

content.enchantments.records.MyEnchantment = { type = content.enchantments.TYPE.CastOnUse, charge = 1, cost = 1, effects = { { id = 'FortifySkill', affectedSkill = 'enchant', duration = 5, magnitudeMin = 50, magnitudeMax = 100 } } }

Type FactionContent

Field(s)

#list<openmw.core#FactionRecord> FactionContent.records

A mutable list of all openmw.core#FactionRecords.

Usage

content.factions.records.MyFaction = { name = 'Peons', hidden = false, reactions = { Hlaalu = -1, Telvanni = 1 }, attributes = { 'Luck', 'Willpower' }, skills = { 'Destruction', 'HeavyArmor' }, ranks = { { name = 'Peon' }, { name = 'Minion', attributeValues = { 50, 50 }, primarySkillValue = 100 } } }

Type GMSTContent

Field(s)

GMSTContent.getFallbacks()

Returns a table containing all fallback values defined in openmw.cfg.

Return value

#table:

#map<#string,#any> GMSTContent.records

A mutable list of all game settings.

Usage

content.gameSettings.records.fJumpAcrobaticsBase = 1024

Type GlobalContent

Field(s)

#map<#string,#number> GlobalContent.records

A mutable list of all global mwscript variables.

Usage

content.globals.records.MyVariable = 42

Type IngredientContent

Field(s)

#list<openmw.types#IngredientRecord> IngredientContent.records

A mutable list of all openmw.types#IngredientRecords.

Note that ingredient effects only have the id, affectedAttribute, and affectedSkill properties.

Usage

content.ingredients.records.MyIngredient = { template = content.ingredients.records['ingred_ectoplasm_01'], name = 'Soylent', effects = { { id = 'vampirism' } } }

Type LevCreatureContent

Field(s)

#list<openmw.types#CreatureLevelledListRecord> LevCreatureContent.records

A mutable list of all openmw.types#CreatureLevelledListRecords.

Usage

content.levelledCreatures.records.MyLevCreature = { calculateFromAllLevels = true, chanceNone = 0.5, creatures = { { id = 'scrib', level = 1 }, { id = 'fargoth', level = 2 } } }

Type LevItemContent

Field(s)

#list<openmw.types#ItemLevelledListRecord> LevItemContent.records

A mutable list of all openmw.types#ItemLevelledListRecords.

Usage

content.levelledItems.records.MyLevItem = { calculateForEach = true, calculateFromAllLevels = true, items = { { id = 'keening', level = 1 }, { id = 'sunder', level = 1 } } }

Type LightContent

Field(s)

#list<openmw.types#LightRecord> LightContent.records

A mutable list of all openmw.types#LightRecords.

Usage

content.lights.records.MyLight = { template = content.lights.records['torch'], duration = -1, name = 'Infinite Torch' }

Type LockpickContent

Field(s)

#list<openmw.types#LockpickRecord> LockpickContent.records

A mutable list of all openmw.types#LockpickRecords.

Usage

content.lockpicks.records.MyLockpick = { template = content.lockpicks.records['skeleton_key'], name = 'Digipick' }

Type MagicEffectContent

Field(s)

#list<openmw.core#MagicEffect> MagicEffectContent.records

A mutable list of all openmw.core#MagicEffects.

Usage

content.magicEffects.records.MyMagicEffect = { template = content.magicEffects.records['summonscamp'], name = 'Summon Nothing' }

Type MiscContent

Field(s)

#list<openmw.types#MiscellaneousRecord> MiscContent.records

A mutable list of all openmw.types#MiscellaneousRecords.

Usage

content.miscs.records.MyMisc = { template = content.miscs.records['gold_001'], mwscript = 'BILL_MarksSpiritSummon', weight = 5 }

Type PotionContent

Field(s)

#list<openmw.types#PotionRecord> PotionContent.records

A mutable list of all openmw.types#PotionRecords.

Usage

content.potions.records.MyPotion = { template = content.potions.records['p_dispel_s'], name = 'Too Strong', effects = { { id = 'FireDamage', duration = 10, range = content.RANGE.Self, magnitudeMin = 100 } } }

Type ProbeContent

Field(s)

#list<openmw.types#ProbeRecord> ProbeContent.records

A mutable list of all openmw.types#ProbeRecords.

Usage

content.probes.records.MyProbe = { template = content.probes.records['probe_bent'], quality = 5, name = 'Alien Probe' }

Type RaceContent

Field(s)

#list<openmw.types#RaceRecord> RaceContent.records

A mutable list of all openmw.types#RaceRecords.

Usage

content.races.records.MyRace = { template = content.races.records['wood elf'], name = 'Sheep Elf', height = { male = 2, female = 2 }, weight = { male = 2, female = 2 } }

Type RepairContent

Field(s)

#list<openmw.types#RepairRecord> RepairContent.records

A mutable list of all openmw.types#RepairRecords.

Usage

content.repairs.records.MyRepair = { template = content.repairs.records['hammer_repair'], name = 'Hammer Time' }

Type SkillContent

Field(s)

#list<openmw.core#SkillRecord> SkillContent.records

A mutable list of all openmw.core#SkillRecords.

Usage

content.skills.records.MySkill = { name = 'C++', werewolfValue = 0, attribute = 'MyAttribute', specialization = 'magic' }

Type SoundContent

Field(s)

#list<openmw.core#SoundRecord> SoundContent.records

A mutable list of all openmw.core#SoundRecords.

Usage

content.sounds.records.MySound = { template = content.sounds.records['MournDayAmb'], fileName = 'sound/fx/funny.wav' }

Type SpellContent

Field(s)

openmw.core#SpellType SpellContent.TYPE

openmw.core#SpellType: Spell types

#list<openmw.core#Spell> SpellContent.records

A mutable list of all openmw.core#Spells.

Usage

content.spells.records.MySpell = { name = 'Enchantment?', type = content.spells.TYPE.Spell, cost = 1000, starterSpellFlag = true, isAutocalc = true, effects = { { id = 'FortifyAttribute', affectedAttribute = 'intelligence', duration = 5, magnitudeMin = 5, magnitudeMax = 10 } } }

Type StaticContent

Field(s)

#list<openmw.types#StaticRecord> StaticContent.records

A mutable list of all openmw.types#StaticRecords.

Usage

content.statics.records.MyStatic = { model = 'meshes/b/B_N_Wood Elf_M_Head_02.nif' }