<aside> 🎯
This script simply gives random clothing under certain value when the quest hit’s the certain stage. In this example talking about fargoth’s ring first time with him
the local player script is used for quest stage and
the global for defining, creatng and giving the item </aside>
<aside> 🔥
<aside> ⚙
sjek_tutorials.omwscripts
PLAYER: quest_local.lua GLOBAL: quest_global.lua# scripts to load on quest reward
PLAYER: quest_local.lua
GLOBAL: quest_global.lua
</aside>
<aside> ⚠️
You can then put this file somewhere into selected data files or make a new folder and select it in the launcher.
omwcscripts file should show up in the data files tab. you can select it active now or any stage of script making for testing.
<aside> ✅
onQuestUpdate enginehandlerat the bottom of the script-- or placing the code inside --[[ code ]]-- this happens registering the handler in a script with a return
return { engineHandlers = { onQuestUpdate = onQuestUpdate } }
</aside>
<aside> 🎸
MS_FargothRing and stage 10local questid = { MS_FargothRing = 10 } -- quest and stage
local function onQuestUpdate( questid )
-- do stuff
end
</aside>
so code can be looking like this atm
local questid = { MS_FargothRing = 10 }
local function onQuestUpdate( questid )
end
return { engineHandlers = { onQuestUpdate = onQuestUpdate } }
-- commented out code, single line
-- [[ commented out code, can be multiline ]]
<aside> ♻️
now let’s bring in some requires on top of the script
-- for prefencing the player
local self = require('openmw.self')
-- and for sending the event
local core = require('openmw.core')
</aside>