UseMagic procedure is not depleting magicka

Post » Thu Jun 21, 2012 1:48 pm

I attached a UseMagic Ai Package to a NPC, but casting the spell does not lower the magicka of the NPC. (whereas the documentation says it would http://www.creationkit.com/UseMagic_%28Procedure%29)
Am I missing something, or do i have to script this myself?

Using a own script is complicated for concentration spells. I would damage the magicka when the Ai package ends. But how can i calculate the magicka usage depending on the duration? What if the package is interrupted after half the duration or before the spell is casted at all? Measuring the time is inaccurate, because the UseMagic procedure contains a "walking to" animation.

Any ideas?
User avatar
April
 
Posts: 3479
Joined: Tue Jun 20, 2006 1:33 am

Post » Thu Jun 21, 2012 10:19 am

I'm modifying the magicka by my self but I ran into a problem:
aCastingActor.damageAV("Magicka" , nMagickaCost )
When I call this a few times in a short time, the NPC's Magicka gets stuck and doesn't refill anymore.
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm

Post » Thu Jun 21, 2012 3:25 pm

I attached a UseMagic Ai Package to a NPC, but casting the spell does not lower the magicka of the NPC. (whereas the documentation says it would http://www.creationkit.com/UseMagic_%28Procedure%29)
Am I missing something, or do i have to script this myself?

It must have changed in one of the updates. At the time I wrote it, that was true.

I'm modifying the magicka by my self but I ran into a problem:
aCastingActor.damageAV("Magicka" , nMagickaCost )
When I call this a few times in a short time, the NPC's Magicka gets stuck and doesn't refill anymore.

Actor values can go into the negatives. Probably, your NPC's magicka dropped so low that you can't see it refilling (ie taking a while before it even reaches 0).
User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am


Return to V - Skyrim