gooser Posted April 28, 2014 Posted April 28, 2014 Poking around other people's mods I've noticed at least in one case the eschewment of using OnEffectFinish. Instead they declare some quest variables in the script to capture akTarget and akCaster coming into the EffectStart event, and then setup an RegisterForSingleUpdate and do their processing in OnUpdate() event handler. I've noticed some problems with timing getting my magic effects to properly call OnEffectFinish when I expect them do, so I wonder if using RegisterForSingleUpdate(...) is more reliable? Thanks
Fotogen Posted April 28, 2014 Posted April 28, 2014 On NPCs magic effects sometimes just vanish without a trace. They do stick while NPC is near Player (in same cell), but once they are not, Skyrim will drop all not-set-in-CK spells/abilities/magic stuff. I use RegisterForSingleUpdate because it alows me to have variable duration. For SexlabUtil1 I use magic effects, because I know Skyrim will drop them at one point and I want that. Avoid using magic effects for something that is very important or something that can break quest/game/character. Its OK for temporary, less important things. For things thats OK if they work or not. Most realiable way to track things would be Quest Alias.
gooser Posted April 28, 2014 Author Posted April 28, 2014 Hi Fotogen. Funny I was looking through your code last night and saw your commented out OnEffectFinish lines so I wondered. The only npcs that matter in my case are followers of the PC. If the player can tell the follower to wait here or go separate ways then the magic effects might still disappear then? I'm trying to improve an existing effect that can get cast on an NPC for degrading wear and tear. If the player were to dismiss the follower and that follower were to head back home I would want the degrade to continue. What's the best way to make this reliably happen?
Fotogen Posted April 29, 2014 Posted April 29, 2014 Hi Fotogen. Funny I was looking through your code last night and saw your commented out OnEffectFinish lines so I wondered. The only npcs that matter in my case are followers of the PC. If the player can tell the follower to wait here or go separate ways then the magic effects might still disappear then? I'm trying to improve an existing effect that can get cast on an NPC for degrading wear and tear. If the player were to dismiss the follower and that follower were to head back home I would want the degrade to continue. What's the best way to make this reliably happen? When NPC is not close to Player, magic effect may disapear. This can happen even if you just enter (or exit) a house or inn. If you just need to track a small number or counter, you could use faction (rank) or give NPC a token (some item). You could also use StorageUtil functions. You'd also need an array (container) of NPCs. You would need some sort of OnUpdate event, someting to count down(or up) numbers. Best way (but also most work) would be a separate, dedicated quest. Quest can be always active, can have script (and other things). NPC(s) would be quest aliases. And quest alias can also have script attached (and other things).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.