Jump to content

OnMagicEffectApply Script seemingly not working


Soulfacade

Recommended Posts

I recently published the mod The Wizard's Grotto (link: http://skyrim.nexusmods.com/mods/37310//?), which includes two activators, a pedestal and a stone cairn, that run the following script

 

Scriptname WizGrotSpellOpen extends ObjectReference


Actor Property PlayerREF Auto

VisualEffect Property DoorGlow Auto

Keyword Property WizGrotSpellKey Auto

ObjectReference Property GrottoDoor01 Auto


Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)

if akEffect.HasKeyword(WizGrotSpellKey)
if (GrottoDoor01.GetOpenState() == 3)
DoorGlow.Play(GrottoDoor01, afTime = 3, akFacingObject = playerREF)
GrottoDoor01.SetOpen(true)
Utility.Wait(5.0)
endif
if (GrottoDoor01.GetOpenState() ==1)
GrottoDoor01.SetOpen(false)
Utility.Wait(5.0)
endif
endif
EndEvent

 

 

The goal of the script is to cause the door to the building to open when the pedestal or cairn is hit with a specific spell, and that a spell animation is played on the door while it is opening. I've set all the properties to the correct objects and have personally never had any issue with it. I've probably used the spell on the activators hundreds of times in testing and every single time it has functioned as intended (so long as there wasnt any solid object between the pc and the activator. Yet, despite this it seems that there are a great many people for whom the process is simply not functioning at all. Case in point:

 

 

 

 

The spell itself is has the keyword I set in the properties window "WizGrotSpellKey" is a "Dispel" archetype concentration spell that is aimed. The only thing I can think of that would cause the activators not to register the spell is the fact that it does not use an impactdataset. However, I'd like a second opinion before I go and upload yet ANOTHER version of the mod.

 

Again, despite the lack of an impact data set the spell activtion has worked for me personally, litterally every time, and I've tested it with everything from an almost totally unmodded skyrim (SKSE and sky UI along with my mod and the tribunal robes mod) to using a host of visual enhancement mods (textures/enb, water, mesh, etc...) the spell activation has opened the doors as intended. Hence why its both vexing and perplexing to me that people are experiencing this issue.

 

The possibilities I've narrowed it down to:

 

1. Some other mod interfering. This seems unlikely as it's a totally new cell with a totally new script and a totally new spell.

 

2.The afforemention lack of an impactdataset as it sits this seems like the likeliest culprit, but I have no real way of knowing short of finding someone to test for me.

 

3. The use of the ultility.wait (?) It's the only thing in the script that's not necessary, and in fact probably does nothing useful since the effect will only occur if the door is either fully closed or fully open anyway.

 

4. Maybe I have to do something other than just compile the script? This is the first time I've worked with script, so I'm unsure as to whether or not the uncompiled text version needs to be packaged externally with the esp and put somewhere in the users data folder. I don't believe that to be the case but it's just speculation on my end.

 

At any rate, I'd like to figure out whether its on my end, or if thre is a mod that could interfere with it, so I can tell users what to look out for.

Edited by Soulfacade
Link to comment
Share on other sites

I see exactly your problem.

 

You have packaged only the ESP file. Users need at minimum the PEX files within the correct directory structure. The PSC files are nice for others to learn how your mod works (and perhaps assist you in error corrections). Packing your resource files into a BSA archive is a good idea.

http://www.creationkit.com/Archive

Link to comment
Share on other sites

  • Recently Browsing   0 members

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