Massively annoying bug with commanded actors.

Post » Wed Jun 20, 2012 1:28 pm

So, after doing some experimenting, I found that reanimated actors have a big problem.

After reanimating a dead body, and then going into a "load screen" to transition to a new area, the reanimated undead appears next to you. But even if you still have a lot of time left on the spell, the actor will remain motionless and turn to ash immediately.

I have located the source of the problem. Reanimate spells have two parts. One magic effect is responsible for bringing the actor back to life for a limited time, and the other effect is responsible for giving it that purple swirly glow effect, giving it the blue swirls as it is rising from the dead, and turning it into ash when it dies or the time expires.

The first magic effect, since it is attached to the player, is just fine. Moving to a new area causes no problems, the effect will remain on the player and thus the "minion" will remain reanimated and continue to follow you. The second effect, which is attached to the minion, is the source of the problem.

It is immediately dispelled as soon as you go into a loading screen, which is responsible for the actor turning to ash as it appears next to you.


I have eliminated that particular problem by editing the script (well, making a new, similar script) to remove the "turntoash()" function from the "OnEffectFinish()" event, which means that under all normal circumstances when the actor would die due to the duration running out or being killed, it will still turn to ash, but it will not turn to ash when moving to a new area because when the effect is removed, it doesn't call that function.


However, this introduces a new problem. When the actor dies after moving to a new location with this change in the script, it will NOT turn to ash because there is no magic effect associated with the actor. The actor will also not have the cool purple glow to it.

I am here to ask for ideas to fix this bug. Is there a way to track the time remaining on the effect, and then re-apply an effect to an actor the moment it steps into a new area with the remaining duration?
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Thu Jun 21, 2012 1:48 am

I have fixed the issue. However, I am having one last problem. The shader applied by the secondary effect (the one that makes your reanimated undead glow purple) dissapears when the minion enters a new area through a load screen, and I cannot seem to be able to fix that. I tried having the player as a reference alias, and then using Event OnCellAttach() on the player and then some scripting to start playing the shader on the actor again. No dice, doesn't seem to do jack, as if the event is not firing.


But I was able to fix the rest of the issues by doing the following. I set up a quest with a script to store the reanimated minion as a variable. The secondary effect got a new script identical to its current turntoash script, only I put if statements on all the events to prevent them from running any of the code inside the events if the caster of the spell is the player. I added a new script that, if the caster is the player, casts to the quest script to store the actor in the quest script. Then I went into the main effect, the reanimate effect, and added a new script there. This script retrieves the stored actor by casting to the quest script, and oneffectfinish, it does all the stuff that the original vanilla turntoash script did. This way, turning the undead to ash when it dies is accomplished through a script on the player, as opposed to a script on the minion, so the script doesnt fire oneffectfinish when the player goes into a load screen.
User avatar
Evaa
 
Posts: 3502
Joined: Mon Dec 18, 2006 9:11 am

Post » Wed Jun 20, 2012 9:06 pm

Good find! I noticed that, but never thought about why specifically it happens.

The question is: Why do the "reanimate secondary effects" get dispelled in a load screen? Does this happen with all magic effects on NPCs?

The "undead glow" could potentially be fixed by just giving the reanimate an ability or by recasting a duplicate of the secondary effects.

Does your workaround function properly when you have more than 1 reanimated actor?
User avatar
Ashley Campos
 
Posts: 3415
Joined: Fri Sep 22, 2006 9:03 pm

Post » Wed Jun 20, 2012 6:32 pm

You could try adding the commanded actors to aliases. I ran into a similar problem creating some commanded animals. So I added the command animals to aliases in a quest, and then the aliases have a script which refreshes the effectshader onload. Now then, I used aliases and a quest because I needed to track three different commanded actors but I didn't want them to be considered under the players control for the purposes of limiting commanded actors. Actually, If you're just using a spell, the easiest thing to do is just put your event handling for OnLoad on a magic effect script for the effect. Then just have it reapply the shader, not the spell. Here's my ReferenceAlias script for...reference. :smile:

Scriptname mm_BeluaAnimalFollowersScript extends ReferenceAliasEffectShader Property mm_BeluaAnimalAllyFx AutoActor SelfActorEvent OnDeath(Actor akKiller)  mm_BeluaAnimalAllyFx.Stop(Self.GetReference())  Self.Clear()EndEventEvent OnLoad()   SelfActor = Self.GetActorReference()  mm_BeluaAnimalAllyFx.Stop(Self.GetReference())  mm_BeluaAnimalAllyFx.Play(Self.GetReference(), -1)  if(SelfActor.GetAv("HealRate") < 1.0)	SelfActor.SetAv("HealRate",1.0)  EndIfEndEvent

Hope this helps you out!

-MM
User avatar
Harry Hearing
 
Posts: 3366
Joined: Sun Jul 22, 2007 6:19 am


Return to V - Skyrim