<aside>
💡
under construction, topics can appear hovering to the right
</aside>
tutorials
quest reward
snippets: todo
basics
https://openmw.readthedocs.io/en/latest/reference/lua-scripting/overview.html
script for lua hotreloading, PLAYER:
local debug = require('openmw.debug')
local function onKeyPress(key)
if key.symbol == 'p' then
debug.reloadLua()
end
end
return { engineHandlers = { onKeyPress = onKeyPress } }
adding script in omwscripts file
<aside>
💡
openmwscripts file is a text file with definitions of loaded scripts filepaths in used datafiles and their context of running like global, menu, player, custom and game object types.
like PLAYER: csriptfolder/script.lua for players or
NPC, CREATURE: for both npcs and creatures
https://openmw.readthedocs.io/en/latest/reference/lua-scripting/overview.html#format-of-omwscripts - Format of .omwscripts
</aside>
package’s local, global, player, menu, custom, including
<aside>
💡
- Global is script that is always active from the moment that game is loaded. This can be used for great extend altho cost a bit performance but is necessary for many commands. This is for multiplayer compability and other reasons.
</aside>
<aside>
💡
- Local means that package is tied to spesific group of objects in the game, may it be npcs, players, potions, containers, armors or something else but not statics. Avable options are listed in above in omwscripts file link
</aside>
<aside>
💡
- Player script is defined in omwscripts file with PLAYER: tag and is run on player(s). This does not differ from other local scripts but in a way using player specifig functions like quest progression, input and such
</aside>
<aside>
💡
- custom is in same way defined in omwscripts file with CUSTOM: tag.
It must be placed via other global script with core package’s
GameObject:addScript(scriptPath, initData) and removed by
GameObject:removeScript(scriptPath)
</aside>
<aside>
💡
- menu script is used when dealing with game menus todo: extra info
</aside>