KillEssential Not Working

Post » Tue Oct 21, 2014 12:12 am

Having an issue with creating a script that works fine on some NPCs and not at all on others. I'm specifically running into trouble with npcs from Interesting NPCs but can't figure out what makes them any different.

For example, let's take Faendal (Vanilla) and Gorr (3DNPC).

Event OnEnterBleedout()  Actor npc = self.GetActorRef()  npc.KillEssential()EndEvent

Faendal goes into bleedout, he drops dead. Gorr goes into bleedout, he gets right back up. Any thoughts?

User avatar
Eliza Potter
 
Posts: 3481
Joined: Mon Mar 05, 2007 3:20 am

Post » Mon Oct 20, 2014 10:34 pm

Looks like the problem is that 3DNPC followers are set to protected by a quest alias. Is there any way to use a script to disable this? Why doesn't the KillEssential bypass it?

User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Mon Oct 20, 2014 8:24 pm

You could try clearing them out of their alias first. SKSE just added a handy new function called GetNthReferenceAlias which will let you loop through any aliases holding the actor.

int aliasCount = StubbornActor.GetNumReferenceAliases()while (aliasCount > 0)    (StubbornActor.GetNthReferenceAlias(aliasCount)).clear()endWhileStubbornActor.KillEssential()

Disclaimer: I don't know how 3DNPC works, so who knows if this could break something else in the quest :tongue:

User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm


Return to V - Skyrim

cron