Jump to content

Using "HasMagicEffect" with a Spell from Another Mod


Recommended Posts

Hi!

 

My custom-voiced follower I'm working on uses "GetFormFromFile" in a script to fill aliases with the reference IDs of NPCs from other mods, which I can then use with conditions so that my character will comment on them when they are in the party without needing any master dependencies. This works fine.

 

What I'd like to do, however, is have my follower in "Mod A" comment when a particular NPC from "Mod B" has a certain magic effect active. As the magic effect I want to check for is added by Mod B, I cannot directly check for it using "HasMagicEffect" in my follower's dialogue conditions, and I cannot store the magic effect in an Alias with GetFormFromFile like I do with the Actors. Does anyone know if there is a way for me to set my idle dialogue line to only trigger if the NPC from Mod B has that magic effect active?

 

Any help would be fantastic!

 

JR

Link to comment
Share on other sites

I'm thinking you would have to use SSEedit to add Mod B as a master to Mod A and make sure everything is set up right with the form IDs. This will at least get rid of the "Error: Could not be resolved". The problem with that is will you need to redo this after every time you open Mod A in the CK and save, as the CK will remove the dependency on Mod b or any other esp used as a master.

 

It's not really want you trying to do, I know but it should work.

 

Maybe hit up Smart Blue Cat or have a peak at the guts of the Vilja and Inigo mods. They have some pretty complicated dialogue set up between the two mods.

Link to comment
Share on other sites

If you need to use the condition for HasMagicEffect then you will be required to make a master dependency.

 

The only alternative I can think of is to use a script on an alias with a conditional variable. Give the script a magic effect variable, set that up in the OnInit event to grab the form using GetFormFromFile. Then in the OnMagicEffectApply event. Have that check the effect being applied to match the one you want to watch on, and if so set the variable used as a conditional or global variable. Then have the condition on your dialogue check using GetVMScriptVariable (check the alises box) then pick the alias and the variable. This requires that the dialogue be on the same quest as the alias I believe.

 

However, I don't know of any way to detect using this type of method to reset that flag when the effect expires. A simple, albeit probably not great way, would be to use a single update timer to just clear the flag after some period. It won't get reset until the effect is then reapplied later. Or perhaps you won't need to clear the flag if it's a persistent ability like a perk.

Link to comment
Share on other sites

Thanks for trying to help, everyone! The only viable method I can think of is to use BigAndFlabby's method of having a script to check the MagicEffect, which is slightly tiresome but I can't see another way round it! At least being able to grab the actor references and save them in aliases makes conditioning with them an awful lot easier :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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