Jump to content

InterruptCast not stopping spell casting


antstubell

Recommended Posts

So have this script on a xmarker activator and it casts in this case a sparks spell.

 

ObjectReference Property Ssource Auto
ObjectReference Property Starget01 Auto
Spell Property mySpell Auto

Event OnActivate(ObjectReference triggerRef)
mySpell.cast(Ssource, Starget01)
Utility.Wait(5)

EndEvent

 

 

I want to stop the cast when player enters a triggerbox, so I put this script on a triggerbox.

 

Actor Property PlayerRef Auto
ObjectReference Property SpellACT Auto

Event OnTriggerEnter(ObjectReference akActionRef)
if akActionRef == PlayerRef
SpellACT.InterruptCast()

EndIf
EndEvent

 

 

Spell still casts. What am I missing here or doing wrong?

Thanks.

Link to comment
Share on other sites

No, I am saying that whatever object you assign to the SpellACT property on the second script should also be the same object assigned to the Ssource property on the first script. You make sure those two properties have the same assigned object.

 

If after that the casting still does not stop, you need to ensure that whatever is triggering the OnActivate event on the xmarker is not re-triggering the event. This is because there are no conditions and it might be possible that it is being re-triggered and giving the illusion of not being stopped.

Link to comment
Share on other sites

But I can't select the XmarkerActivator that the script is running on as a property because it is running the script.

That was my original answer above which is true but as I said in my previous post changing the line does fix it. Thanks for your time.

mySpell.cast(Self, Starget01)

Link to comment
Share on other sites

That makes sense now. The way the script was written it was assumed that the xmarker was merely a controller for a separate object assigned to the Ssource property. If you are casting from the xmarker, then using Self, as you have figured out, is the way to go.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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