Create a remote cast reference through a spell effect

Post » Sun Nov 18, 2012 5:33 am

I'm trying to use the method described in the topic title to implement two different spells. One, would be cast on a target actor, turning them into a player ally for 30 secs. A second effect, also timed for 30 seconds, would contain a script that has the Function OnEffectFinish call using the actor under the effect as a cast reference. This effect would basically be an aoe "self-destruct" damage affect. This seems possible as I see all the functions required in place, but I don' know if its actually possible.

The 2nd spell I am looking to create would have a targeted spell which creates an object reference( this reference could be any mesh but I want to use the fx of healing spell) then, the object reference uses the remotecast function to cast a 10 sec duration aoe damage spell.

Can someone help me out with this?

I'm writing up the code right now, but as I have often encountered, when things go wrong they solution seems a bit impossible. I'd like to know if this sounds doable before I invest too much time/effort.
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Sun Nov 18, 2012 1:56 pm

Scriptname PeryiteEffectScript extends activemagiceffect SPELL Property WYDPeryiteExplode  Auto Event OnEffectFinish(Actor akTarget,Actor akCaster);actor target = activemagiceffect.GetTargetActor()WYDPeryiteExplode.Cast(akTarget)EndEvent

Here's the code I am using. This code is in the magic effect for the ontarget spell. The duration is 15 seconds, after 15 secs the target of the magic effect (akTarget) should cast a secondary spell on self called by the property WYDPeryiteExplode.
User avatar
Latino HeaT
 
Posts: 3402
Joined: Thu Nov 08, 2007 6:21 pm

Post » Sun Nov 18, 2012 1:42 am

wiki says "Cast" is for non-actors ... there's a guy with a big fox, on here, somewhere, who would probably benefit from that bit of knowledge.

But I assume you are talking about using this on an Actor?

In which case, Packages are better - http://www.creationkit.com/Procedure_UseMagic

(What you want to do should work, other than that)


... be aware of the last note on the linked page! ...
User avatar
Charity Hughes
 
Posts: 3408
Joined: Sat Mar 17, 2007 3:22 pm

Post » Sun Nov 18, 2012 2:58 am

wiki says "Cast" is for non-actors ... there's a guy with a big fox, on here, somewhere, who would probably benefit from that bit of knowledge.

But I assume you are talking about using this on an Actor?

In which case, Packages are better - http://www.creationkit.com/Procedure_UseMagic

(What you want to do should work, other than that)


... be aware of the last note on the linked page! ...

I don't neccesariily need the actor to actually cast it, its more so using them as the epicenter of an explosion. The concept behind the spell is that the player turns an enemy into an ally(trying to figure out what effect archetype does this). So ideally that actor runs into another group of enemies and then after they fight for a little while the effect wears off and at the effect finish an aoe explosion is cast on them. Right now the explosion does actually take place, but it seems the OnEffectFinish event I am using is a bit imprecise. If I could use a timer utilty of sorts it would work much better.


Scriptname PeryiteEffectScript extends activemagiceffectSPELL Property WYDPeryiteExplode  AutoEvent OnEffectStart(Actor akTarget,Actor akCaster)akTarget.AddToFaction(CharmFaction)akCaster.StopCombat()akTarget.StopCombat()EndEventEvent OnEffectFinish(Actor akTarget,Actor akCaster)akTarget.RemoveFromFaction(CharmFaction)WYDPeryiteExplode.Cast(akTarget)EndEvent;MagicEffect Property SacrificeProp  AutoFaction Property CharmFaction  Auto  

I think this is going to work for at least the first effect. I'll take a look at some of the other functions under the ActiveMagicEffect script header and hope that one of them provides for a more reliable time-frame.


Edit: Okay so the script works and the timeframe is not an issue at all. I need to get rid of the stop combat call because it makes it so the enemy won't attack anything(even things attacking me or him). I also need to figure out how to do two things to the actor casting the spell, kill them, and force the fx that turns an actor to ashes. I assume that the former can be done by attaching an on self damage effect to the explosion spell( although the explosion spell is supposed to be on self but with an area). The latter, I can probably get an idea of how to do it by looking into what makes the thralls turn to ash once they are killed.
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Sun Nov 18, 2012 3:14 am

Going to try to use akTarget.Kill() to kill the actor casting the spell. Magic effects don't seem to want to damage the health of the casting actor. Also, I did find out how to turn the actor to ash on death.

I'll come back to this thread in a few days when I have time to work on implementing the spell that creates a "light" object and then uses the same tactics I created here to explode it. I'm going to try and combine Mage Light and an aoe spell the same way I combined a Charm spell and an aoe spell.
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Sun Nov 18, 2012 3:13 am

One last thing before I'm off for the night,

If I remove the akTarget.StopCombat() function from the script then the actor added to the charm faction continues to attack me, but if I leave it in, the actor ceases to reenter combat as an ally. Can't think of a suitable workaround.
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am


Return to V - Skyrim