Jump to content

[LE] Identifying Quest Items on an NPC Inventory via Script


Myst42

Recommended Posts

0.16s is a fairly long duration. Can I see your full OnEffectFinish() code?

 

Right now my immediate thought would be to create a wrapper function for Stop() on a quest, so that it can be relied on to run regardless of whether the magic effect that called into it still exists or not, and so that you can make the call from the ActiveMagicEffect non-latent and execute all your other stuff without having to wait on the 3D stuff.

 

I'm not certain exactly where you'd go from there. Could stuff them into an alias and listen for an OnLoad() event, which doesn't involve polling but is limited by the number of aliases you create.

Link to comment
Share on other sites

didn't try it myself but maybe the RemoveAllitems will help?

 

Function RemoveAllItems(ObjectReference akTransferTo = None, bool abKeepOwnership = false, bool abRemoveQuestItems = false) native

 

My idea was to use some background containers to filter the questitems on death. don't know if it works though, never used the flag "abRemoveQuestItems" before.

Link to comment
Share on other sites

I gave this a bit more thought and I think I have a solution: as the first effect closes out, use AddSpell to add an Ability to the Actor it is on. That Ability has a single MagicEffect, on which is a script that, OnEffectStart(), checks a. if the Actor still has the trigger effect and then, if it does not, b. if the object's 3D is loaded. If the effect is gone and the object's 3D is loaded, purge your effects and remove the Ability from the Actor; otherwise, do nothing. OnEffectStart() should fire every time the Actor loads in.

 

This gives you a scalable, non-polling solution that doesn't make references persistent.

Link to comment
Share on other sites

  • 2 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...