The relevant part of the "charger" script is this:
Debug.Trace("Spell casting - level = " + currentLevel, 2)leveledSpells[currentLevel - 1].Cast(caster)The array has the index I'm asking it for, and the Spell stored there is not None, at least according to the Papyrus Log files. Also, this does work 95% of the time.
The spell I'm casting is Script only, cast on Self, Fire and Forget, and its only event looks like this:
Event OnEffectStart(Actor akTarget, Actor akCaster) Debug.Trace("Started: Times=" + TimesToCast + " DelayBeforeFirstCast=" + DelayBeforeFirstCast, 2) Wait(DelayBeforeFirstCast) int i = 0 while (i < TimesToCast) SpellToCast.Cast(Game.GetPlayer()) Wait(DelayBetweenCasts) i+=1 endwhileEndEventMy observation when it fails is that I get the trace in the charger spell, but I do not get the trace in the second spell. The logs report no errors. The only pattern I've observed is that when it fails, it fails multiple times in a row. If I lay off casting the charger for a minute or so, it will work the next time I do cast it.
What do you all think? Is the Cast method just not reliable? Is there something awry with my script? If Papyrus is overloaded would it simply ignore the Cast method, but if so, why does it still perform my "charger" script?
