Kris Takahashi for Interesting NPCs SE (3DNPC) Borgut1337 for Papyrus Profiler SKSE Team for SKSE
Donation Points system
This mod is not opted-in to receive Donation Points
Changelogs
Version 2.0
Updated the mod to use Rogue's Gallery, further optimising the script thanks to the new Papyrus functionality provided.
As such, Rogue's Gallery is a new requirement starting with 2.0. If you don't want to use Rogue's Gallery, you can stick with 1.3.1.
Safe to update/install mid save.
Thank you wSkeever for the inspiration!
Version 1.3.1
Added a check to stop some papyrus errors. Thank you Darth Vitrial for pointing this out.
Version 1.3
Now correctly works when installing on an existing save.
If you installed a previous version on an existing save, you can use the optional file to get the script back on track. Instructions: - install the optional file as a separate mod (do not merge or replace) - load your save, wait a few seconds, make a new save - the optional file can now be removed A more detailed explanation in the mod description.
Version 1.2
Small optimisation to the script when initiating a conversation with a follower.
Version 1.1
Fixed follower dialogue topics being inaccessible for 3DNPC followers.
Version 1.0
Initial release
I recently did a quick check up on my papyrus load with the excellent Papyrus Profiler and noticed that the script barbasdialoguedetect from the mod Interesting NPCs SE (3DNPC) had quite a large number of OnUpdate calls. I investigated the script and found out that despite the name it actually has nothing to do with the eponymous dog, but rather is a general use script that detects if the player is in dialogue with an NPC that is not currently a follower. Apparently the script is used to prevent 3DNPC followers from talking while the player is in dialogue.
Every four seconds the script looks for NPCs around the player and checks if any of them are in dialogue with the player. If the player is not in dialogue this results in quite a lot of function calls. In my 5-10 minute test profile I racked around fourteen thousand, which was 11.2 % of my total function calls. You can see the results in this flamegraph:
Thanks to the new papyrus functions provided by SKSE and Rogue's Gallery I replaced the OnUpdate cycle with an event that fires whenever the dialogue menu is opened or closed. This coupled with a few other optimisation steps drastically reduced the number of function calls, in this new flamegraph they have been reduced to 0.0 % so practically nothing:
This of course means that Rogue's Gallery is a requirement for this change, and as such this can never be included in the original mod, which does not have it as a dependency.
Just a script file, no ESP. If you find a mistake in the new script or have other suggestions for improvements let me know!