Jump to content

[LE] How to force a reference alias to act as an object and not an actor? (If filled with an actor)


corrado33

Recommended Posts

Found a problem with a recent script of mine. Technically the script works fine if you run it with the alias filled with a container. BUT, if the alias is filled with an actor, it doesn't work. This sounds weird, but bear with me. The quest alias is filled upon transferring a special item into a container. However, if you place the special item in an NPC's inventory.... it doesn't work. Now, I know this sounds stupid, but what a lot of "cloud chest" mods do it simply make an NPC be the "chest." So if you wanted to use my mod with one of those mods, it wouldn't work. This annoys me... mainly because this was the main thing "I" wanted to do with the script. (Specifically, the "Dwarven Luggage" mod acts like this, and I've been... accustomed to using it.) Specifically, if you put the object in any chest that is called by casting a spell (whether it be the dwarven luggage spell or the "deep storage" spell from apokalypse (however you spell it.)

 

The problem is that I call the "onClose" function to launch my script to prevent the sorting script from running until you close the chest/container. I don't... want it to run on the "onItemAdded" event because I think that'd be annoying. Although it may work. It's quite literally the only event I can get to fire when I put the special object in a "cloud" chest. I COULD run it X seconds after the last "onItemAdded" event, but I'm not a huge fan of arbitrary values/times like that.

 

So the question is "Can I force a quest alias filled with an actor to behave as a container/object?" I tried LITERALLY every objectreference event (yes, I copied and pasted every single one from the wiki into my script), none of them fire when accessing the cloud inventory. (Although the "OnMagicEffectApplied" or whatever will fire, but then I'd have to know the specific magic effect.... which is... geeze....maybe possible, but not pretty.)

 

I feel stupid coming here for every problem, but the reference for skyrim scripting is honestly... awful. Or I'm just dumb. :wink:

Edited by corrado33
Link to comment
Share on other sites

The trick, in general, is to not fight the game engine. That way lays headaches. In this particular case, I'd use SKSE to look for a MenuClose event. I have actually found that using an OnItemAdded event to queue an OnUpdate event is also just fine, because the sorting doesn't need to begin immediately.

Link to comment
Share on other sites

The trick, in general, is to not fight the game engine. That way lays headaches. In this particular case, I'd use SKSE to look for a MenuClose event. I have actually found that using an OnItemAdded event to queue an OnUpdate event is also just fine, because the sorting doesn't need to begin immediately.

 

Ah freaking hell that's perfect. OnMenuClose should be.... perfect. Thank you... so much. I was banging my head against the wiki looking for a way to make this work in a... non ugly way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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