Jump to content

Better NPC Support for Devious Devices 0.6


About This File

Better NPC Support for Devious Devices

 

An add-on for Devious Devices to improve support for NPCs.

Latest Version: 0.6 (2022-02-19), this version is for DD 5.x only
Latest Version supporting DD 4.X: 0.2 (2021-01-27)

 

Current functionality:

  • Restore missing effects after NPC is reloaded by the game engine (for example after loading screen).
  • Restore missing effects after NPC's inventory has changed (for example after player giving new equipment to follower).
  • Prevent bound NPCs from using weapons and spells in combat; they will use bound combat if enabled in Devious Devices settings.
  • Allow manipulation of some NPC devices (insert/remove panel gag plug, link/unlink DCUR rubber gloves with D-links).
  • Escape system: If enabled in MCM this allows NPCs to struggle and maybe escape their devices.


Current Limitations:

  • Restoring missing effects may take a few seconds. During that time, devices may flicker as they are being refreshed.
  • Sandboxing packages (especially of followers) might cause NPCs to use furniture even with bound hands, which will look wrong.

 

Compatibility:

  • This mod should work correctly with Devious Devices that are added by other mods.
  • This mod does not replace NPC packages outside of combat, so it should be fully compatible with NPCs that have custom AI like Paradise Halls slaves, Serana, or custom followers.
    The drawback is that their custom AI may occasionally break the bound hands animation (if they are bound), for example when sandboxing.
  • This mod might interfere with bondage furniture mods (DD Contraptions, ZAP). More testing is required.

 

Credits:

  • Everybody working on Devious Devices mods. You are the reason for this mod.
  • Especially Kimy for patiently answering my questions about the inner workings of Devious Devices, allowing me to understand why things are partially working for some NPCs without this mod, but not at all for some other NPCs.
  • Me.

 

License:
Released under CC0 license (included in the archive). My hope is that at some point in the future most of the code might end up in Devious Devices, making this mod unnecessary.

 

Github:

https://github.com/RealHandcuffs/Better-NPC-Support-for-Devious-Devices

 

Changelog:

Spoiler

Version 0.6

  • Do not apply bound idle to sleeping or unconsious NPCs
  • Prevent sleeping or unconscious NPCs from struggling
  • Script changes to allow conversion of mod to .esl

 

Version 0.6 beta 3

  • Fix lockpick escape: NPCs first need to access lock before they can pick it, just like players
  • Apply Devious Devices cooldown difficulty modifier (configured in DD MCM) to NPCs
  • Optimize escape attempt triggering code, especially for "(by device)" case

 

Version 0.6 beta 2

  • NPCs will abide by device cooldowns when trying to escape; they will only use the action with the largest chance of success, though
  • Add new struggle frequency option "(by device)", this will choose struggle frequency automatically according to worn devices
  • Make "(by device)" default struggle frequency for followers (only new games, existing games will continue to use the currently configured value)
  • NPCs can now try to escape by picking the lock of their devices, as long as they have lockpicks in their inventory (they will break on failure)
  • Add MCM setting to enable/disable escape by picking locks, default option is "Current Followers Only"
  • Some small fixes


Version 0.6 beta 1

  • Make bound NPCs behave defensively even if bound combat is enabled
  • Do not make bound NPCs behave defensively if they are followers and player is bound, too
  • Allow non-followers to use bound combat, too, if it is enabled in Devious Devices settings
  • Unequip arrows too when unequipping weapons from bound NPCs
  • Ignore disabled NPCs
  • Various optimizations
  • Build system: Support different files for classic skyrim and special edition
  • Make MCM mod name display work for esl's in special edition (this requires se-only script changes)

 

Version 0.5.1

  • Hotfix: Tighten code to reduce chance of race condition and implement additional code to mitigate the problem

 

Version 0.5

  • Same as 0.5 RC 3, other than version string

 

Version 0.5 RC 3

  • Change how the escape system recognizes NPCs that should not struggle, it now checks if their outfit contains devious devices
  • Block The Whip And Chain actors from escape system in addition to outfit check mentioned above
  • Change build scripts to support Skyrim SE, the scripts are now compiled with SE and a .bsa is built using the SE format
  • Optimize "restore original outfit" code

 

Version 0.5 RC 2

  • Small performance optimization (override DD bound NPC sandbox packages with custom script to prevent unnecessary EvaluateAA call)
  • Clean masters of esp

 

Version 0.5 RC 1

  • Change logic for unlock difficulty, use similar logic like DD does for player
  • Prevent struggling when NPC is being animated by sexlab
  • Internal changes allowing to recalculate helpless/not helples without full fixup

 

Version 0.5 beta 8

  • Interrupt escape attempts when NPCs are hit
  • Prevent struggling NPCs from moving or using furniture

 

Version 0.5 beta 7

  • Change package to contain .bsa archive instead of loose files
  • Add option to fix inconsistent devices of current followers automatically, enabled by default
  • Player teammates will not start to struggle when the player is in combat or sneaking
  • Change layout of MCM menu
  • Add more MCM settings for tweaking struggling behavior
  • Fix enable/disable NPC processing in MCM
  • Various minor fixes and improvements

 

Version 0.5 beta 6

  • Change MCM settings for player notifications to three states: None, summary only, detailed
  • Be much more restrictive about which NPCs are allowed to escape devices if they are not current follower
  • Various fixes, tweaks and internal changes to escape system and handling of devices

 

Version 0.5 beta 5

  • Tweak timing and messages of escape system
  • Fix handling of quest devices by escape system (will now struggle but always fail)
  • More MCM improvements

 

Version 0.5 beta 4

  • First version of escape system, disabled by default, needs to be enabled in MCM
  • Some bugfixes, e.g. race conditions when loading game
  • Change layout of MCM

 

Version 0.5 beta 3

  • Refactoring and small fixes

 

Version 0.5 beta 2

  • Recognize devious plugs, too (they were ignored up to now)
  • Some refactoring and additions to ExternalApi.psc

 

Version 0.5 beta 1

  • Prevent NPCs with equipped devices from becoming bard audience
  • Allow the player to manipulate NPC's panel gags by removing/inserting plug
  • Allow the player to lock NPC's DCUR rubber gloves with D-links
  • Fix unlocking NPC's DCUR locked rubber gloves (DCUR assumes it is only worn by player)

 

Version 0.4

  • Add more information to MCM: Show tracking id and equipped devices of NPC under crosshair.
  • Add DDNF_ExternalApi to support other mods getting or equipping devices.
  • Some more internal changes.

 

Version 0.4 beta 5

  • Further refactoring to improve performance and to make the mod more reactive on changes to NPC inventory by player (container menu).

 

Version 0.4 beta 4

  • Add option to clear all cached data to MCM; this can be used for example after an update to DD that changes keywords of existing devices (not expected).
  • Apply code changes to reduce the chance of race conditions leading to wrong animation sets or orphaned rendered devices.

 

Version 0.4 beta 3

  • Check keywords of all devices, not just the ones with magic effects.
  • Use StorageUtil to speed up analysis of equipped devices by caching information for each "rendered device" that is encountered.

 

Version 0.4 beta 2

  • Add special handling for panel gags.
  • One more very minor performance optimization.

 

Version 0.4 beta 1

  • Add support for unequipping "weapon on back" display armors, currently supports "All Geared Up Derivative".
  • Some minor performance optimizations.

Version 0.3

  • No changes, same as 0.3 beta 5 other than version number.

 

Version 0.3 beta 5

  • Try to prevent bound NPCs from sandboxing (most of this depends on DD NPC slots being enabled and available)
  • Add option to restore original outfit of NPCs after DD replaced it with empty outfit (false by default)

 

Version 0.3 beta 4

  • Slightly increase delay after devices are added/removed to prevent race conditions with DD (could lead to lost animations e.g. after adding gags, or removed devices staying visually applied)


Version 0.3 beta 3

  • Change handling of dummy weapon to prevent bug causing all equipped items to be unequipped

 

Version 0.3 beta 2

  • Improve the fix for corrupt devices (devices sometimes get "bad" when they are stored in a container for a long time)
  • Detect rendered devices being unequipped while NPC is loaded and try to fix the issue
  • Prevent prisoners from using bound combat even if not wearing fetters (use membership in dunPrisonerFaction)

 

Version 0.3 beta 1

  • Add option to fix the NPC under the crosshair to MCM
  • Optimization: Change handling of animations, should now recognize when animations are still applied after loading screen and not re-apply them


Version 0.2

  • Support pahe dwemer slave suit and dwemer pet suit as a soft-dependency (they needed special handling)


Version 0.2 beta 3

  • Some more small optimizations

 

Version 0.2 beta 2

  • Optimizations after testing with Devious Devices 5.1
  • Add flag for papyrus logging to MCM  

 

Version 0.2 beta 1

  • Add a simple MCM with the following options:
    - enabled/disable processing of NPCs (can be used to temporarily disable the mod)
    - frequency of NPC scanner (default: scan for NPCs every 8 seconds)
    - how fast to process NPCs (default: 3 NPCs every 3 seconds)

 

Version 0.1

  • Tweaks to improve weapon handling of bound NPCs.

 

Version 0.1 RC 3

  • Changes to improve compatibility with DDe (and possibly other mods that use non-standard ways of equipping and unequipping devices).

 

Version 0.1 RC 2

  • Optimization: Detect if an added/removed device does not change the existing animations (e.g. when gagging bound NPCs) and skip refreshing animations in that case.
  • Optimization: Refactor detection of keywords on devices, will hopefully reduce the amount of keyword checks for NPCs wearing many devices.
  • Fix: Prevent NPCs with bondage mittens from using shields.

 

Version 0.1 RC 1

  • Use a workaround to force the game to correctly hide body parts according to armor addon item slots (this fixes hands clipping out of elbowbinders).
  • When scanning devices, check for each device if it has an enchantment; if not, assume it has no special functionality (e.g. heavy bondage, different animations).
  • When unequipping and reequipping devices, skip devices that have no enchantment (they have no effect that needs to be restarted).
  • Improve handling of weapons for bound followers: They should no longer try to draw weapons, and they should no longer run with one or both arms sticking out.

 

Version 0.1 Beta 5

  • Detect concurrent modifications to a NPC while the mod is fixing up devices of the NPC and abort the fixup (fail fast).
  • Reduce number of NPCs that can be found by the scanner quest from 8 to 4 (the mod is still able to handle more, it will just take longer to find them).
  • Only allow fixing devices of a particular NPC every 5 seconds real time (slow down). This includes situations where the fixup was aborted.
  • Only allow fixing devices of 3 NPCs over a period of 3 seconds (slow down).
  • Various other small optimizations.
  • Add very minimal logging. It is off by default and can be enabled using "setpqv DDNF_NpcTracker EnablePapyrusLogging true".

 

Version 0.1 Beta 4

  • Optimize all papyrus scripts after using the built-in profiler.
  • Remember devices of NPCs as long as they are being tracked to prevent repeaded inventory scans.
  • Try to be smarter about when to re-apply animations of a NPC (zadBoundCombatScript.EvaluateAA) as doing so is expensive and slow.
  • Allow pausing the mod by using "stopquest DDNF_NpcTracker". Use "startquest DDNF_NpcTracker" to start the mod again.

 

Version 0.1 Beta 3

  • Fix: Factions for combat packages were not cleaned up when NPCs were removed from the reference alias.

 

Version 0.1 Beta 2

  • Fix: Mod can become stuck in certain situations, stopping to work.

 

Version 0.1 Beta 1

  • Refresh effects on NPC after NPC is (re)loaded by game engine.
  • Refresh effects on NPC after NPC inventory changed.
  • Sheathe weapons after bound NPC draws weapon, and try to keep them sheathed.
  • Prevent usage of weapons/spells when NPC is wearing bondage mittens or is bound.
  • Allow bound combat if enabled in DD settings and NPC's feet are free.
  • Try to fix rendered items not being equipped (e.g. compatibility problems with mods like AllGUD).
  • Try to fix the issue that giving a NPC a device is sometimes not registered by the game engine (often when the player has multiple identical devices in inventory).

 

Edited by Kharos


What's New in Version 0.6

Released

Aggregated changes from 0.5.1 to 0.6
 

  • Make bound NPCs behave defensively even if bound combat is enabled
  • Do not make bound NPCs behave defensively if they are followers and player is bound, too
  • Allow non-followers to use bound combat, too, if it is enabled in Devious Devices settings
  • Unequip arrows too when unequipping weapons from bound NPCs
  • Ignore disabled NPCs
  • Various optimizations
  • Build system: Support different files for classic skyrim and special edition
  • Make MCM mod name display work for esl's in special edition (this requires se-only script changes)
  • NPCs will abide by device cooldowns when trying to escape; they will only use the action with the largest chance of success, though
  • Add new struggle frequency option "(by device)", this will choose struggle frequency automatically according to worn devices
  • Make "(by device)" default struggle frequency for followers (only new games, existing games will continue to use the currently configured value)
  • NPCs can now try to escape by picking the lock of their devices, as long as they have lockpicks in their inventory (they will break on failure)
  • Add MCM setting to enable/disable escape by picking locks, default option is "Current Followers Only"
  • Some small fixes
  • Fix lockpick escape: NPCs first need to access lock before they can pick it, just like players
  • Apply Devious Devices cooldown difficulty modifier (configured in DD MCM) to NPCs
  • Optimize escape attempt triggering code, especially for "(by device)" case
  • Do not apply bound idle to sleeping or unconsious NPCs
  • Prevent sleeping or unconscious NPCs from struggling
  • Script changes to allow conversion of mod to .esl

Other Files from Kharos


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use