What determines spell Casting AI? and a small scripting ques

Post » Wed Feb 06, 2013 6:25 am

Anyone know how AI works in determining what actors will cast? I've given my actor two spells. One is an ice spike projectile, and one is a damage over time spell. I was wondering if there is anyway I can make it so that my actor won't cast the DoT spell on targets which are already effected by it. I'm thinking that magicka has something to do with how frequent the actor casts spells, but I'm not if there is a better way I can get more control.

Also, as part of the DoT spell, I attached a script to mimic the silencing effect in mw/ob.

MagicEffect Property CPFrostDamageFFActor AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)    if akTarget == Game.GetPlayer()        Debug.Notification("You have been silenced!")    endIf    while akTarget.HasMagicEffect(CPFrostDamageFFActor)        akTarget.InterruptCast()    endWhileendEvent

I realize that the while condition will keep firing over and over again until the duration runs out of the spell is dispelled somehow. Is this kind of script going to cause problems? I have noticed any performance hit when the script is running and my computer is on the low-end as far as Skyrim is concerned. If it is a problem, would adding something as simple as a Utility.Wait(0.1) help? I'd rather not use registerforupdate as I believe that function can actually cause some problems, especially with short update times.

Thanks
User avatar
El Goose
 
Posts: 3368
Joined: Sun Dec 02, 2007 12:02 am

Return to V - Skyrim