option to disable interaction based on disposition

This commit is contained in:
Lilian Jónsdóttir 2020-10-10 13:05:30 -07:00
parent 272a7be414
commit c63ed5e4eb
3 changed files with 20 additions and 3 deletions

View file

@ -29,6 +29,7 @@ local defaultConfig = {
minimumOccupancy = 4, minimumOccupancy = 4,
homelessWanderersToPublicHouses = false, -- move NPCs to public houses if they don't have a home homelessWanderersToPublicHouses = false, -- move NPCs to public houses if they don't have a home
disableInteraction = true, disableInteraction = true,
minimumTrespassDisposition = 50, -- if player's disposition with NPC is less than this value, interaction is disabled
-- door settings -- door settings
lockDoors = true, lockDoors = true,
waistWorks = common.waist.interior, waistWorks = common.waist.interior,

View file

@ -122,11 +122,16 @@ local function onActivated(e)
return return
end end
if tes3.player.data.NPCsGoHome.intruding and not checks.isIgnoredNPC(e.target) then local npc = e.target
tes3.messageBox(string.format("%s: Get out before I call the guards!", e.target.object.name))
if tes3.player.data.NPCsGoHome.intruding and not checks.isIgnoredNPC(npc) then
if npc.disposition and npc.disposition <= config.minimumTrespassDisposition then
log(common.logLevels.medium, "Disabling dialogue with %s because trespass and disposition:%s", npc.object.name, npc.disposition)
tes3.messageBox(string.format("%s: Get out before I call the guards!", npc.object.name))
return false return false
end end
end end
end
local function onLoaded() local function onLoaded()
tes3.player.data.NPCsGoHome = tes3.player.data.NPCsGoHome or {} tes3.player.data.NPCsGoHome = tes3.player.data.NPCsGoHome or {}

View file

@ -64,6 +64,17 @@ category:createYesNoButton({
variable = createTableVar("disableInteraction") variable = createTableVar("disableInteraction")
}) })
category:createSlider({
label = "NPC Disposition at which dialogue is prevented.",
description = "If the player's disposition with an NPC is less than this value, dialogue will be prevented " ..
"(if configured to do so). Set to 0 to disable disposition checking, and disable dialogue for all NPCs when applicable.",
min = 0,
max = 100,
step = 5,
jump = 10,
variable = createTableVar("minimumTrespassDisposition "),
})
category:createDropdown({ category:createDropdown({
label = "Treat Canton waistworks as exteriors, public spaces, or neither", label = "Treat Canton waistworks as exteriors, public spaces, or neither",
description = "If canton cells are treated as exterior, inside NPCs will be disabled, and doors will be locked.\n" .. description = "If canton cells are treated as exterior, inside NPCs will be disabled, and doors will be locked.\n" ..