From 66353bfaff2168218980f2b21c4dc0bdae50076e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 7 Sep 2020 16:24:57 -0700 Subject: [PATCH] extremely basic interop module for now only exposes guard following player --- MWSE/mods/celediel/MoreAttentiveGuards/interop.lua | 12 ++++++++++++ MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 MWSE/mods/celediel/MoreAttentiveGuards/interop.lua diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/interop.lua b/MWSE/mods/celediel/MoreAttentiveGuards/interop.lua new file mode 100644 index 0000000..a5302bb --- /dev/null +++ b/MWSE/mods/celediel/MoreAttentiveGuards/interop.lua @@ -0,0 +1,12 @@ +local this = {} + +local guard +this.setGuardFollower = function(g) + guard = g +end + +this.getGuardFollower = function() + return guard +end + +return this diff --git a/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua b/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua index 53467bc..ec9909a 100644 --- a/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua +++ b/MWSE/mods/celediel/MoreAttentiveGuards/sneak.lua @@ -1,5 +1,6 @@ local common = require("celediel.MoreAttentiveGuards.common") local config = require("celediel.MoreAttentiveGuards.config").getConfig() +local interop = require("celediel.MoreAttentiveGuards.interop") local this = {} -- {{{ variables and such @@ -74,6 +75,7 @@ local function stopFollowing(onTimer) tes3.setAIWander({reference = follower, range = wanderRange, reset = true, idles = idles}) follower = nil + interop.setGuardFollower(follower) end local function startTravel() @@ -161,6 +163,7 @@ this.onDetectSneak = function(e) if e.isDetected and not follower and not isFollowing then follower = e.detector + interop.setGuardFollower(follower) -- follow for a time startFollowing() -- else -- uncomment this for extreme debug messages @@ -187,6 +190,7 @@ this.onLoaded = function(e) dialogueTimer = nil ogPosition = nil isFollowing = false + interop.setGuardFollower(follower) end -- }}}