NPC Spell?

Post » Sun Nov 18, 2012 6:03 am

Hello everyone.

My problem is as follows:

I made a new NPC and fitting Race for a huge Fox. I tried to give it a spell. It has the spell, it has enough magicka to use it (5 times before it runs out) and it has the slot (voice) to equip it. IN the Combat Style i made it favor magic as much as Unarmed, so it should WANT to use it too.

Now my problem is:

It keeps attacking me with claws and bites, but it never ever uses it's spell that it's supposed to use. It is supposed to be a bossfight, but this way it gets much less interesting, does anyone know what i could do to make it start using my spell? I can't figure it out.
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Sun Nov 18, 2012 1:15 pm

It seems like NPCs that have no casting animation have difficulty casting. I had enough trouble with this on my Fire Guardian boss (which uses the Wolf model) that I resorted to writing its spellcasting AI in Papyrus tied to animation events.
User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Sun Nov 18, 2012 11:02 am

hm....i don't have a lot of knowledge in papyrus yet i think, do you think you could help me a bit there, or maybe give me the code you made so that i can put the spells with properties or something similar?

Thank you in advance
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Sun Nov 18, 2012 1:51 am

Bump. Someone help me?
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Sun Nov 18, 2012 2:39 am

You said that you made your npc favour unarmed damage as much as magic. I assume you used the Equipment Score Mults, and set Unarmed the same as Magic. One thing to note in regards to these settings

Equipment Score Mults - the higher the number, the more likely the actor will be to use that weapon. This number is multiplied into the damage output of the attack. So if you have a melee attack that has a small amount of damage, and a spells that do a lot, you have to 'jack' this mult up very high on the melee attack for the actor to prefer melee attacks over magic.
Quoted from http://www.creationkit.com/Combat_Style

If i understand this correctly if your unarmed attack deals more damage than your magic attack, even though you set the ESM equal, unarmed will be preferred as this is just a multiplier.

I don't know whether your npc is capable of casting, but if it is, you might want to look at creating a usemagic package as a combat override.
User avatar
Penny Courture
 
Posts: 3438
Joined: Sat Dec 23, 2006 11:59 pm

Post » Sun Nov 18, 2012 9:44 am

Well the magic is much stronger, so that shouldn't be it. But i figure that a fox is not able to cast.
User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Sun Nov 18, 2012 4:53 am

If you really want your actor to use a magic attack, you can give it to your actor as an attack spell. I haven't checked whether an attack spell uses magicka. However, if you go to the Attack Data tab in Actor, you can then add an attack spell to an attack event.

You do this by
  • Highlighting the attack event
  • Click override data
  • Select the required spell in the Attack Spell box

I can't say for certain whether this causes a spell cast effect to play, but it is a way in which your actor can use a spell as its attack, albeit tied to a melee attack. If you add a condition to the magic effect, based on a random percentage, the spell then doesn't cast on every attack.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Sun Nov 18, 2012 1:47 pm

If i use this variant will it still take magicka? It was supposed to be able to do it twice or three times before it ran out, thus beeing unable to use it.
User avatar
An Lor
 
Posts: 3439
Joined: Sun Feb 18, 2007 8:46 pm

Post » Sat Nov 17, 2012 11:05 pm

bump
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Sun Nov 18, 2012 7:52 am

It would seem spells cast this way do not use magicka, however you could use this work around.

Use a condition on the magic effect which checks for the magicka value of the actor.
Optionally use a random chance for the magic effect to be applied
Attach a script to the magic effect which damages the magicka value of the actor.
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am

Post » Sun Nov 18, 2012 7:12 am

The way I handled it for my Fire Guardian was to set a timer that updates once a second, with a counter that increments on each update. When the counter gets above a certain number, it sets a Boolean that is checked to allow it to cast the spell. When the spell is cast, it resets the Boolean and the counter.

Checking the actor's Magicka value on a timer and using DamageAV("Magicka",value) as heilghast suggests is also a good idea.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Sun Nov 18, 2012 6:29 am

Thanks i will try it this way.
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am


Return to V - Skyrim