To start out, here's a brief description of my attempt:
Spoiler
SpellEffect is "Fire and Forget", "Target Location", has 40 AoE, and calls a script.
This script does the following:
OnEffectStart: Create an activator at the caster for each target. Store activator and target in a variable. Suspend the targets. All this work fine, except I can't get any animation to work except for "BleedOutStart" and I've already tried PlayIdle(), SendAnimationToActor(), and the like to no avail.
OnUpdate: Each activator shoots a corresponding target. That works fine. However, I can't change how often the update is conducted. I tried changing the parameter for RegisterForSingleUpdate() and that doesn't seem to do anything (I don't notice a visible difference between 0.1 and 0.01). It's possible that there's a set cooldown in spell casting, although I am using RemoteCast() so that shouldn't matter.
OnEffectStop: Clean up. That works totally fine.
This script does the following:
OnEffectStart: Create an activator at the caster for each target. Store activator and target in a variable. Suspend the targets. All this work fine, except I can't get any animation to work except for "BleedOutStart" and I've already tried PlayIdle(), SendAnimationToActor(), and the like to no avail.
OnUpdate: Each activator shoots a corresponding target. That works fine. However, I can't change how often the update is conducted. I tried changing the parameter for RegisterForSingleUpdate() and that doesn't seem to do anything (I don't notice a visible difference between 0.1 and 0.01). It's possible that there's a set cooldown in spell casting, although I am using RemoteCast() so that shouldn't matter.
OnEffectStop: Clean up. That works totally fine.
One observation I have is that this script makes a separate instance for every affected target, which means variables are not shared. I am saying this because I would like to be corrected if wrong.
Anyway, here's what I want to do with the script that I have trouble accomplishing
1. I can't get any animation to work. All I wanted is to have all the affected actors stagger. I also can't get actors to scream
2. The triggering of the spell is very buggy. Sometimes it works and sometimes it doesn't even if casted right on the feet of an actor. I am not sure if that's a property of the "Target Location" option
3. I tried making the spell channeling and self-targeting but the script just totally stops working if I do that. What appears to be going on is that the actors in the AoE do not actually trigger "OnEffectStart". Is 40 too small a radius? I think it should at least affect the person beside the player.
I wonder if others suffered from the same problem.
Off-topic: Is there some way to trigger a script when it is within a certain radius of an object?
Thanks.
