amblingalong Posted February 17, 2012 Share Posted February 17, 2012 (edited) Can someone help me make sense of this? The idea is that when a weapon kill an enemy, the enemy is resurrected as a Dead Thrall (the actual enchantment adds a 10% chance of that happening, as well as some other requirements, but that isn't relevant to the script). For some reason, however, it doesn't seem to be working. I'm hoping someone will be able to help me troubleshoot. Thanks in advance! Scriptname EncEldingarEffectScript extends ActiveMagicEffect Spell Property Revenant Auto Event OnDeath (Actor akKiller) Actor TargetActor = GetTargetActor() Utility.Wait(2) Revenant.cast (TargetActor, akTarget = TargetActor) EndEvent Edited February 18, 2012 by amblingalong Link to comment Share on other sites More sharing options...
Jugg3r Posted February 18, 2012 Share Posted February 18, 2012 Hmmm...i took me a while to understand this, cause i dont know what DeadThrall.cast(TargetActor, akTarget = TargetActor)does. I guess it is not important for this matter .. So from a logical point of view, i would reanimate dead, instead of dying ;) Event OnDeath() ;something got killed Actor TargetActor = GetTargetActor() ;Target, what got killed DeadThrall.cast(TargetActor, akTarget = TargetActor) ;cast DeadThrall on the target that died, akTarget is btw the same target again Did i get it right? :) Link to comment Share on other sites More sharing options...
amblingalong Posted February 18, 2012 Author Share Posted February 18, 2012 That's exactly what it's supposed to do, the problem is that currently, it's not working :). I'm hoping someone can explain why it isn't doing what you said. Link to comment Share on other sites More sharing options...
Jugg3r Posted February 18, 2012 Share Posted February 18, 2012 Did you change the eventtype from OnDying to OnDeath? Link to comment Share on other sites More sharing options...
darkylord Posted February 18, 2012 Share Posted February 18, 2012 (edited) Does it give you any errors on compile or it just doesn't resurrect the enemy ?Btw, I get the feeling the GetTargetActor() isn't used right...I would try something like that : Scriptname EncEldingarEffectScript extends ActiveMagicEffect Spell Property Revenant Auto Event OnEffectStart(Actor Target, Actor Caster) Utility.Wait(10) if Target.IsDead() == true Revenant.cast(Caster, Target) endif EndEvent Edited February 18, 2012 by darkylord Link to comment Share on other sites More sharing options...
amblingalong Posted February 18, 2012 Author Share Posted February 18, 2012 (edited) Does it give you any errors on compile or it just doesn't resurrect the enemy ?Btw, I get the feeling the GetTargetActor() isn't used right...I would try something like that : Scriptname EncEldingarEffectScript extends ActiveMagicEffect Spell Property Revenant Auto Event OnEffectStart(Actor Target, Actor Caster) Utility.Wait(10) if Target.IsDead() == true Revenant.cast(Caster, Target) endif EndEvent Thanks for the suggestions! The targetactor seems to be working correctly, since the game logs are showing that the spell was cast on the correct NPC. It's very odd; basically, after they are killed, the 'raise dead' spell-casting animation plays and they shimmer purple (as undead do while you're raising them, usually) and then... nothing, they just lie there. No errors, nothing. The reason I have them casting on themselves is because I'm not sure how else to ensure that the spell won't be blocked by the level scenery, and because visually I don't want to have the player casting raise dead on them. Did you change the eventtype from OnDying to OnDeath? I did; it wasn't casting because the spell was reading the NPC in the process of dying as alive, and therefore an invalid target. I'm really appreciating the help! Edited February 18, 2012 by amblingalong Link to comment Share on other sites More sharing options...
darkylord Posted February 18, 2012 Share Posted February 18, 2012 That could be the reason it doesn't work. It's possible they can't cast this to themselves so you probably have to make the user of the item been the caster of the spell too. Link to comment Share on other sites More sharing options...
amblingalong Posted February 18, 2012 Author Share Posted February 18, 2012 That could be the reason it doesn't work. It's possible they can't cast this to themselves so you probably have to make the user of the item been the caster of the spell too. Hmmmm... I wonder if there is a way to do this without having the visual effect of the player casting the spell, because I really want it to look like they're rising as a result of the weapon hit. I'll give it a shot and let you know what happens. Link to comment Share on other sites More sharing options...
darkylord Posted February 18, 2012 Share Posted February 18, 2012 You could duplicate the resurrection spell and just remove those effects. Then use that new resurrection spell instead of the original. Link to comment Share on other sites More sharing options...
Jugg3r Posted February 18, 2012 Share Posted February 18, 2012 Perhaps you could let the weapon cast the spell? Like weapons that cast soultrap on living stuff. You might check those. They should work in a similar way. Link to comment Share on other sites More sharing options...
Recommended Posts