Jump to content

Recommended Posts

Posted

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.

Posted

Make sure the object assigned to the SpellACT and Ssource properties is the same object. And if they are, make sure that whatever triggers the activation of the xmarker script is not still activating it.

Posted

Are you saying that the xmarker activator on which the script is running should also be the Ssource? Meaning I should change the line in the first script to -

 

mySpell.cast(Self, Starget01)

Posted

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.

Posted

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)

Posted

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.

  • Recently Browsing   0 members

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