Hi all
I've been trying to get NPC's to lay boobytraps -- however, they fail to cast Runes when told to do so via a multitude of ways. The following examples do not work:
Method 1 of 2: This works fine when making someone summon a Storm Atronach.
; Force equip the spell.
(akActionRef as Actor).EquipSpell(RuneSpellRef, 0)
; Force cast the spell.
RuneSpellRef.Cast(akActionRef)
Method 2 of 2: AI Procedures
Similarly, I've made a Procedure based on UseMagic which also fails. The condition for casting is the Spell being equipped in the left hand -- which is forced by another Script.
In both of these cases, I can hear the spell being charged, but it's always followed by the "fizzle" noise. So, it appears as if the system is struggling to cast as desired, but it can't aim at the correct target (nearby surface).
To try and engineer around this, I made a copy of the ShockRune Spell and related MagicEffect, but changed the type to Aimed. The Rune was successfully cast, though it would manifest in thin air and then change its Alpha to 0. When I walked by, it detonated -- however, I couldn't get the NPC's to aim at the ground, and SnapToNavmesh didn't work to reign in the abberant behavior.
Either way, I just want this spell to cast correctly. Ideally, it should do the usual: drain Magicka from the spellcaster; and only allow 1 or 2 Runes at a time depending on the Perks of the caster; etc..
Suggestions appreciated!