How to use RemoteCast?

Post » Thu Jun 21, 2012 1:59 pm

I have a number of spells I'm making where the effects come down from the sky. To accomplish this, I set upt the following script.

Scriptname CallLightningScript extends activemagiceffect STATIC Property XMarker autoSpell Property LightningBolt autoevent OnEffectStart(Actor Target, Actor Caster)   ObjectReference XMarkSpot = Target.PlaceAtMe(XMarker, 0, 300, 0)   LightningBolt.RemoteCast(XMarkSpot, Caster, Target)   self.dispel()endEvent

but it isnt doing anything. What is wrong here?
User avatar
Wanda Maximoff
 
Posts: 3493
Joined: Mon Jun 12, 2006 7:05 am

Post » Thu Jun 21, 2012 12:18 pm

If the cast type is “targeted” then it will only fire where the object reference is aiming. Try adding a rotation to face downwards.
I've had a few problems getting spells cast from an object with RemoteCast() in the end I use ActorBase references and just use the invisable race, only problem with that is they are effected by Gravity :-)
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Wed Jun 20, 2012 11:54 pm

You are best off making the spell aimed. I have had no problems firing off aimed spells from activators. As a bonus, activators do not have to face the target to shoot a spell at it, so you don't need to worry about rotation. Some actors are this way too, but not all, so it is generally best to put an activator at the hand node of an actor and then remotecast from that too.

Self spells generally do not work when cast from activators, but they can be successfully cast from actors with remotecast. This can be handy for applying spells to actors with the player taking the blame while not requiring that the player physically aim at the target. Works great for spells that do things like buff a companion or minion, so you dont have to aim at the minion, you just cast it and the minion gets the buff.

Havent testest target location yet. I would assume it works the same as aimed, only it "intercepts" the first actor encountered on a straight path from the caster to the target using a hitscan method.

Unsure of the rest.

Also, the spell that you are remotecasting will return akCaster as the actor you are assigning blame to in the RemoteCast() function.

So, say spell A causes an activator to remotecast Spell B with the player getting blame for it. If you put a script on spell B, it will return the player as akCaster for OnEffectStart() and OnEffectFinish()

Remotecast seems to ignore perks. Best to just script-in the perk bonuses, or use conditions. So if you have for example a 25% damage boost perk, best to take spell B in the above scenario, and add another effect to it with the condition being that the caster has the perk, and give it a 25% bigger magnitude, then add the inverse of that condition to the original magic effect on spell B.


For a good look at how to do crazy stuff with this, look at Aldiuns firestorm spell. Under one of the magic effects, there is a script (a reasonably long one) that handles the fireballs coming down.
User avatar
Genocidal Cry
 
Posts: 3357
Joined: Fri Jun 22, 2007 10:02 pm

Post » Thu Jun 21, 2012 6:11 am

Thanks for the in-depths goat, but I'm still havingt issues even after replacing XMarker with a new Activator. The script is like this as is:
Scriptname CallLightningScript extends activemagiceffectActivator Property DungeonMasterCaster autoSpell Property Lightning autoevent OnEffectStart(Actor Target, Actor Caster)   ObjectReference XMarkSpot = Target.PlaceAtMe(DungeonMasterCaster, 0, 300, 0)   Lightning.RemoteCast(XMarkSpot, Caster, Target as ObjectReference)   self.dispel()endEvent

Lightning, btw, is just the vanilla LightningBolt spell. I'm gonna change it once I get this working.

And yet still nothing happens. Any more ideas?
(Thanks for the Alduin hint, I had forgotten about that. Should make meteor storm easier to craft.)

The problem seems to have been my PlaceAtMe command, so I'm using MoveTo now.
User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm

Post » Thu Jun 21, 2012 1:03 am

Just wanted to point out you had the parameters for http://www.creationkit.com/PlaceAtMe_-_ObjectReference totally wrong. But I think your workaround of using MoveTo on a persistent reference is probably a better idea.
User avatar
Flutterby
 
Posts: 3379
Joined: Mon Sep 25, 2006 11:28 am

Post » Wed Jun 20, 2012 11:08 pm

I am confused. By persistent reference, do you mean a reference placed in the CK somewhere in the world, that is moved around when needed, as opposed to creating new references each time the event fires and then removing them?

I ask this because I am suddenly afraid that the hundreds of activators that I am using in one of my spells are persistent despite using DisableNoWait() and then Delete() on them when I am done with them.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Thu Jun 21, 2012 1:11 pm

From the info on the http://www.creationkit.com/Persistence_%28Papyrus%29, your activators are most likely not persistent.
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Thu Jun 21, 2012 1:05 pm

Just wanted to point out you had the parameters for http://www.creationkit.com/PlaceAtMe_-_ObjectReference totally wrong. But I think your workaround of using MoveTo on a persistent reference is probably a better idea.

Lol, I was using the MoveTo parameters for PlaceAtMe. Eesh.
User avatar
ShOrty
 
Posts: 3392
Joined: Sun Jul 02, 2006 8:15 pm

Post » Wed Jun 20, 2012 11:23 pm

Another interesting thing about remotecast. Remotecasting from another object with the player as the akBlameActor will actually boost the skill of whatever school that spell is in for the player, so it looks like in every way, the akBlameActor gets credit, aside from using akBlameActors perks (though I would bet that conditions checking for a perk would in fact work, checking the akBlameActor and not akSource for the perk in question. Entry points, not so much).
User avatar
Dalton Greynolds
 
Posts: 3476
Joined: Thu Oct 18, 2007 5:12 pm

Post » Thu Jun 21, 2012 3:35 am

Players in my mod do not use skills from Skyrim, all gains from using skills are set to 0 through a perk. But that is interesting.
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Thu Jun 21, 2012 5:26 am

I've just found out that using RemoteCast() to cast a spell like Rout or Calm will only work if the actual casting object reference/actor stays active for at least half a second.
I was pulling my hair out trying to work out why my invisible caster wasn't effecting the enemy with illusions spells 9 times out of 10. Then when I put a UtilityWait command for 1second just before the script disabled and deleted the reference the spells worked every time!
I love learning the hard way :-D
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm


Return to V - Skyrim