Thursday, May 3, 2012

CK: Mark and Recall Spell

RandomNoob: I made and tested this script for someone's Mark and Recall spell. The markers I used were XmarkerHeading objects. I was able to move them to and from whatever cell they were in, whether or not they were loaded, with no problems.
Scriptname Example extends ActiveMagicEffect

GlobalVariable Property MyGlobal Auto
ObjectReference Property Marker01 Auto
ObjectReference Property Marker02 Auto
Activator Property Portal Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    if (akTarget.IsInInterior())
            Debug.MessageBox("You cannot use this spell inside an interior cell.")
            Return
    endif
    ObjectReference PortalRef = akTarget.PlaceAtMe(Portal)
    Utility.Wait(2)
    if (MyGlobal.Value)
            MyGlobal.SetValue(0.0)
            Marker01.MoveTo(akTarget)
            akTarget.MoveTo(Marker02)
    else
            MyGlobal.SetValue(1.0)
            Marker02.MoveTo(akTarget)
            akTarget.MoveTo(Marker01)
    endif
    PortalRef.MoveTo(akTarget)
    Utility.Wait(3.5)
    PortalRef.Disable()
    PortalRef.Delete()
EndEvent
This script was posted to make a point yet it's handy in it's own respect. Source: Anyone know how to move objects from non-parented cells?

No comments:

Post a Comment