I have an activemagiceffect script. When the effect lands, I want to retrieve the reference of the actor it lands on. I then want to cast to a second script, which is a quest script, to "store" the actor's reference. Then, when the player casts a second spell with a third script (another activemagiceffect script) I want to retrieve the variable with the actor's reference to use it in the second activemagiceffect script.
I am very confused about how the casting works for this. So far, this is what I have come up with, but obviously doesn't work. Can someone point me in the right direction or at least help me understand this a little better?
Magic Effect script 1 (The magic effect that is finding the Actor Reference)
Scriptname ESG_SaveActorToQuest extends activemagiceffectEvent OnEffectStart(Actor akTarget, Actor akCaster) ESG_MyQuestScript.StoreActor(akTarget)EndEventQuest script (The quest script that is storing the Actor Reference)
Scriptname ESG_MyQuestScript extends questActor StoredActorFunction StoreActor(Actor NewActor) StoredActor = NewActorEndFunctionActor Function RetrieveActor() Return StoredActorEndFuntionMagic Effect script 2 (The magic effect that is retrieving the Actor Reference from the script and casting a new spell from the player to the actor.)
Scriptname ESG_GetActorAndCastAtIt extends activemagiceffectSpell Property SpellToCast AutoActor ActorToCastAtEvent OnEffectStart(Actor akTarget, Actor akCaster) ActorToCastAt = ESG_MyQuestScript.RetrieveActor()SpellToCast.Cast(akCaster, ActorToCastAt)EndEvent
