Concentration Spell via script - tracking moving targets?

Post » Sat Aug 06, 2016 12:16 pm

So I'm wanting to make a concentration spell that fires at the player whenever they are in range of a trap. The idea is that as long as the player is in range, they are getting a spell like "frostbite" (as an example) cast on them.



Everything works in the sense that the casting toggles on and off successfully. But I've discovered the target never updates - if Cast() targets the player, it will only target the player at the exact spot they were at when the casting started.



Is there a way to get Cast() to track a moving target? Otherwise I'm afraid I'm going to have to go with the much more visually boring option of just using a cloak.



I searched and the only thing that might come close was someone had used an invisible actor with a moving xmarker to have that actor cast a spell at the xmarker. A good idea, but wouldn't work with the setup I have for my trap.

User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Sat Aug 06, 2016 6:36 am

Are you familiar with Soljund's Sinkhole? At the end of the cell where you face the boss and the statues cast the fire spells at you. That sounds like what you are trying to do.

User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Sat Aug 06, 2016 12:17 pm

Looked that area up. Not really what I'm trying to do. The statue just casts a generic fireball spell, not a concentration one.



The spell casting part is fine. My problem is when I tell something to cast a spell at a target, it doesn't track the target when it moves. That's not a problem if you are just firing fireballs, heals or cloaks, but it is a problem if you are using concentration spells (like sparks).

User avatar
kat no x
 
Posts: 3247
Joined: Mon Apr 16, 2007 5:39 pm

Post » Fri Aug 05, 2016 10:58 pm



Er...sorry but you seem to be contradicting yourself. Is the spell that you are trying to make the statue cast a concentration spell or not?



I think you are saying you want the statue to cast a concentration type spell where the projectiles STREAM out to produce the effect of a fire jet?



Can't you just fake it by re-casting quickly and shooting many projections one after the other (machine gun style)?


Basically just fire many custom spells one after the other that use the same projectile as the concentration spells do!

User avatar
Alexxxxxx
 
Posts: 3417
Joined: Mon Jul 31, 2006 10:55 am

Post » Sat Aug 06, 2016 6:55 am


Whoops haha you are right I did!



Concentration spells = sparks/frostbite, where you hold the button down to cast it. Using the cast function in papryus you can cast these just fine as intended, but it doesn't appear to support tracking a moving target - you can only cast to a specific point.



And I have tried your suggestion using the OnTrigger() event (as opposed to OnTriggerEnter()). The problem is I'm worried about polling the script too much (since the script essentially fires non-stop as fast as possible), and secondly the results aren't desirable. The spell just flickers on the player over and over in a really noticeable manner versus being a constant beam.



The solution I'm currently thinking of is having the player shoot a dummy concentration spell via papyrus at the object that is casting to get the visual effect (since I'm pretty sure cast will follow the object that is doing the casting), and then have the real damage being applied to the player from an invisible spell cast on the player (with dummy effects spawned to make it appear that the player is taking damage?)

User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am


Return to V - Skyrim