The Elder Scrolls V: Skyrim

The Elder Scrolls V: Skyrim

View Stats:
Altbert Sep 26, 2020 @ 6:16pm
NPC resurrection?
I have responded to many discussions on NPC resurrection. Most of the time I was either ignored or it was strongly adviced not to follow my suggestions.

COULD IT BE POSSIBLE TO HAVE A FAIR DISCUSSION ON THIS SUBJECT?

I have been looking into this subject for several years now, studying scripts (including quest fragment and topic fragment scripts), quests (including quests not showing up in your quest journal), story manager event nodes, etc. I also did a lot of testing, although I am far from done testing. There is still much to do, as various parts of the game are designed differently.

I have found various misconceptions and misuse of terminology in many posts.

Resurrecting NPCs will break your game
Most NPCs who are part of a quest or quest line are marked essential or protected, unless using mods or the console to undo their status. Still, it will never break your game, but it may break quests or even a complete quest line, although the latter can be considered breaking your game.

The game knows if an NPC has died
The game never "knows"! Only if an NPC is a reference alias in a quest, that quest is active or is game start enabled, the reference alias is marked as dead, meaning that a quest "knows" (not the game), but other quests may not "know", unless a quest is marked as start game enabled.

Death of NPCs is handled by a death script
There is no such thing as a single death script. In fact, there are over 400 death scripts (I have counted 410 death scripts sofar). Some of these scripts handle the number of deaths (e.g. Civil War quests) or the type of kill (e.g. Dark Brotherhood and Thieves Guild, which can be an indication of quest failure). Reference aliases in quests may have a death script attached which differ from one NPC to another.

NPCs know if another NPC has died
Some NPCs will "know" if another NPC has died, but only if those NPCs have a special relationship with the deceased NPC (association type) or in case of a "kill alarm" when guards and bystanders start hunting down the killer. However, this will only occur if a cell is 3D loaded, t.i. when the player has actually entered that cell (this may occur every time the player enters that specific cell).

Deceased NPCs are moved to their burial coffin or urn
None of the deceased NPCs are moved to a burial coffin or urn. Unique NPCs are moved to a special holding cell, sometimes called "death cell", upon death after 12 ingame days, and only their belongings end up in a coffin or urn in the Halls of the Dead, but only if their base object has a special script attached (DeadBodyCleanupScript). If unique NPCs do not have this particular script attached they will be moved to the holding cell with all their belongings.

A resurrected NPC will loose ownership of their properties
This is questionable, as I have not found any script that removes ownership.

Unique or named NPCs
In the game only two types of NPC are defined: unique and non-unique NPCs. Both types can be named or not! So, it can be quite disturbing to use named instead of unique.

Scripts are "baked" into save files
What the heck does this mean? It would be very bad programming practice to add a complete executable script (PEX) to a save file! What they really mean is that script variables are added to a save file. Is this a bad thing? Not at all, the game generally highly depends on those script variables. It may only cause problems when uninstalling mods with scripts mid playthrough. After uninstalling, script variables will stay present in successive saves and keep referencing ingame objects. In my opinion this will only cause problems when referenced objects no longer exist.

Death catalog
The game does not provide a death catalog! The closest you can get to a "death catalog" are the ACHR and AVIF records in a save file, but these records hold no values on an NPC's death, and none of the other records in a save file do.

Can NPCs be resurrected?
Yes, in my opinion, they can. But it takes more than only using the "resurrect" console command. Without taking precautions, a resurrected NPC will still be removed from the game after a certain amount of ingame days. However, do not expect a resurrected, unique NPC to completely have their original behavior. A resurrected, unique NPC will have their default behavior as defined by their AI packages, but none defined by any quests, although you sometimes may need to reset their AI.

CAN WE HAVE A FAIR AND OPEN DISCUSSION ON THIS SUBJECT?
< >
Showing 1-15 of 108 comments
mpd1958 Sep 27, 2020 @ 12:56am 
I am not qualified to discuss this subject as I have only resurrected only 1 NPC in all the hours that I have put into Oldrim and SE. That was Alvor the Blacksmith in Riverwood. The resurrection went off without a hitch and the game continued without incident.

From reading your post I feel that you have done a very detailed study of the matter and put forth your statement with a lot of thought. I hope you get the reasonable discussion you seek. Good Luck!
Bomb Bloke Sep 27, 2020 @ 1:12am 
Originally posted by Altbert:
Resurrecting NPCs will break your game
Most NPCs who are part of a quest or quest line are marked essential or protected, unless using mods or the console to undo their status. Still, it will never break your game, but it may break quests or even a complete quest line, although the latter can be considered breaking your game.

AFAIK, resurrection cannot break quests at all - it's the initial deaths that do that, and then only sometimes. The trick is that resurrection often can't revert such breaks.

I suspect some folks have taken "break" to mean "the game will bug out and/or crash", when in context it has only ever referred to "quest failures". Such "breaks" are intended events coded in by the game's developers to simply let players know that there's no point in finding item X for deceased character Y anymore - they're not "bugs" related to stability issues.

There are other relatively minor side effects that may arise from allowing an NPC to die. For eg, resurrected NPCs may fail to turn up during later scripted encounters. Note only "may" - it depends on how the scripts in concern are coded - and of course you obviously also wouldn't see them there if you allowed them to remain dead. Such scenes are intentionally coded to be dynamic (some even have replacement actors lined up), and it's typically of little consequence as to how they play out.

Where it gets tricky is that a broken quest may not show up in the journal, depending on who dies and when - if you fail a quest before your character was told it had even started, for example, then there's no logic in making a visible note of that. And although there are other ways to determine what impact the death of a character might have, such as through the Creation Kit, these tend to be a bit beyond the average player.

This has led to the blanket advice that "it's safer to reload if an NPC dies"... which has gradually warped over the years into the much-less-sensible "the ground will open up under your feet and swallow you if you type in the resurrect command".

Originally posted by Altbert:
The game knows if an NPC has died
The game never "knows"! Only if an NPC is a reference alias in a quest, that quest is active or is game start enabled, the reference alias is marked as dead, meaning that a quest "knows" (not the game), but other quests may not "know", unless a quest is marked as start game enabled.

There apparently is a death counter that applies to each NPC's baseID, incremented whenever associated refIDs are killed, and reviewable through GetDeadCount.[www.creationkit.com]

Its mere availability is of no danger per se, and I don't know of any instances where it's used to determine "if a specific NPC has ever died". Although quest authors could make it serve that purpose if they really wanted it to, that's not what it's there for.

If a script author needs to track an NPC's state they typically either use a reference alias (which can trigger stuff if an NPC dies while a quest is running) or they just call isDead (which indicates an NPC's status at the current moment in time).

Likewise, I've never seen anything to indicate any sort of "death catalogue" in a save... nor a reason to think that the developers might ever've wanted to add one. Not sure where that idea came from.

Originally posted by Altbert:
None of the deceased NPCs are moved to a burial coffin or urn.

This one's a bit of a "story and gameplay segregation" deal. Bethesda intentionally presented things such that players are supposed to think that character remains end up in the Hall of the Dead, so it's quite reasonable for a casual gamer to claim that they've "found a character" if they spot the coffin/urn the corpse/ashes are "supposed" to be in (even if the "real body" is hidden away in a debug chamber).

Whether it's worth correcting specific people on this hinges largely on the context of the conversation. If a player states they can't find Lydia in the Hall of the Dead, for eg, it's probably safe to assume he just means "her container". ;)

Originally posted by Altbert:
Without taking precautions, a resurrected NPC will still be removed from the game after a certain amount of ingame days.

Heck, I don't even consider that to be a problem: they can always be moved back in again if need be... or left, if not.
Originally posted by Altbert:
A resurrected NPC will loose ownership of their properties
This is questionable, as I have not found any script that removes ownership.
People have resurrected shopkeepers (Like Belethor for a specific Example), only to discover they no longer do any shopkeeping (Like Belethor no longer does if you resurrect him).


I can't go into specific details about why resurrected NPCs no longer function as they should, because I totally admit I don't know the programming side of it. But I have seen that resurrected NPCs don't behave as they previously did, and it's not a huge leap from them not behaving right to it breaking your game...

If I have to resurrect one, I have done it in the past, I prefer the Recycleactor command, BUT it's a last ditch attempt to save a questline, and I personally don't recommend it.
seriousthree Sep 27, 2020 @ 5:45am 
I have not found need to resurrect a quest character as yet, normally I just restart the previous save as it won't be that long before. What I have tried is to resurrect shopkeepers, which has gone badly so far. Belethor buys stuff but his stock contains a lot of things that I have sold him, including dozens of water breathing rings. Ulfberth War-Bear is presently deceased although he wandered from the shop and spent a lot of time just standing on a hill first.

Really the merchants in Whiterun at least should have been protected against death.
Last edited by seriousthree; Sep 27, 2020 @ 5:46am
Altbert Sep 27, 2020 @ 4:13pm 
I am very sorry to say that I will not be replying to any comments (probably at least a week) as the grandmother of my children is dying and she will probably not live to see the end of this week. Anywhere next week I will try to respond to posted messages.
John Sep 27, 2020 @ 4:43pm 
Originally posted by Altbert:
I am very sorry to say that I will not be replying to any comments (probably at least a week) as the grandmother of my children is dying and she will probably not live to see the end of this week. Anywhere next week I will try to respond to posted messages.

This is more important than some topic on steam, so best of wishes to you and your family for the upcoming days. When you return i at least would like to have a conversation about the topic in question.
smr1957 Sep 27, 2020 @ 6:30pm 
Very sorry to hear that, Altbert. My heart goes out to you and your family, If there was more to say, I would say it, but there really is nothing that can be said to lessen the pain and grief that you and yours must be feeling.
Last edited by smr1957; Sep 27, 2020 @ 6:32pm
alexander_dougherty Sep 28, 2020 @ 12:45am 
Originally posted by Altbert:
I am very sorry to say that I will not be replying to any comments (probably at least a week) as the grandmother of my children is dying and she will probably not live to see the end of this week. Anywhere next week I will try to respond to posted messages.
My condolences, I hope you and your family are coping.
Altbert Oct 2, 2020 @ 1:53pm 
Originally posted by Bomb Bloke:
Originally posted by Altbert:
Most NPCs who are part of a quest or quest line are marked essential or protected, unless using mods or the console to undo their status. Still, it will never break your game, but it may break quests or even a complete quest line, although the latter can be considered breaking your game.
AFAIK, resurrection cannot break quests at all - it's the initial deaths that do that, and then only sometimes. The trick is that resurrection often can't revert such breaks.
You’re right! Only the death of an NPC will fail quests, but only when NPCs are already in their reference alias, meaning the quest should already be activated, although sometimes not running yet (game start enabled quests, not yet visible in the quest journal). If a quest is marked as game start enabled and also to run once, there is no way to reset the quest and the quest will always fail.
Originally posted by Bomb Bloke:
I suspect some folks have taken "break" to mean "the game will bug out and/or crash", when in context it has only ever referred to "quest failures". Such "breaks" are intended events coded in by the game's developers to simply let players know that there's no point in finding item X for deceased character Y anymore - they're not "bugs" related to stability issues.
Again you are right! But, keep in mind that many players are not native English speakers/writers (and I’m not either). A phrase as “will break the game” may be seen literally or not put it in the correct context.
Originally posted by Bomb Bloke:
There are other relatively minor side effects that may arise from allowing an NPC to die. For eg, resurrected NPCs may fail to turn up during later scripted encounters. Note only "may" - it depends on how the scripts in concern are coded - and of course you obviously also wouldn't see them there if you allowed them to remain dead. Such scenes are intentionally coded to be dynamic (some even have replacement actors lined up), and it's typically of little consequence as to how they play out.
It’s not only the scripted encounters, but also the quests these are attached to. Is the quest game start enabled and/or marked to run only once? Does the quest already have predefined aliases, either through forced references or as predefined unique NPCs? Does the reference alias have scripts attached, the base object of a reference alias, or is there only a “general” script attached to the quest?
Originally posted by Bomb Bloke:
Where it gets tricky is that a broken quest may not show up in the journal, depending on who dies and when - if you fail a quest before your character was told it had even started, for example, then there's no logic in making a visible note of that. And although there are other ways to determine what impact the death of a character might have, such as through the Creation Kit, these tend to be a bit beyond the average player.
This will most probably only apply to various miscellaneous quests. As far as I’ve seen major quest (lines) have this logic built in. Also, every NPC who plays an important role in a major quest (line) is marked as essential, either by the quest or the base object of the NPC is marked as essential as from game start.
Originally posted by Bomb Bloke:
Originally posted by Altbert:
The game knows if an NPC has died
The game never "knows"! Only if an NPC is a reference alias in a quest, that quest is active or is game start enabled, the reference alias is marked as dead, meaning that a quest "knows" (not the game), but other quests may not "know", unless a quest is marked as start game enabled.
There apparently is a death counter that applies to each NPC's baseID, incremented whenever associated refIDs are killed, and reviewable through GetDeadCount.[www.creationkit.com]
The GetDeadCount function only applies to non-unique NPCs and is never used on unique NPCs, as it uses the base NPC type an not the NPC’s base object. This function is used in the Civil War quests to count the number of dead enemies (Stormcloak soldiers, Imperial soldiers), and in some Thieves Guild quests, in which case you aren’t supposed to kill any NPC.
Originally posted by Bomb Bloke:
Likewise, I've never seen anything to indicate any sort of "death catalogue" in a save... nor a reason to think that the developers might ever've wanted to add one. Not sure where that idea came from.
No, there’s no such thing as a “death catalog”. I have checked the save file records format, and the only records that could come into mind are the ACHR, AVIF and NPC_ records. The first two records are dynamic and the last one is static. Only the AVIF record could be called an “death catalog” in which the Health entry may indicate death if the value is 0. But, since it’s a dynamic value, once an NPC is revived, the value is non-zero.
Originally posted by Bomb Bloke:
Originally posted by Altbert:
None of the deceased NPCs are moved to a burial coffin or urn.
This one's a bit of a "story and gameplay segregation" deal. Bethesda intentionally presented things such that players are supposed to think that character remains end up in the Hall of the Dead, so it's quite reasonable for a casual gamer to claim that they've "found a character" if they spot the coffin/urn the corpse/ashes are "supposed" to be in (even if the "real body" is hidden away in a debug chamber).
Whether it's worth correcting specific people on this hinges largely on the context of the conversation. If a player states they can't find Lydia in the Hall of the Dead, for eg, it's probably safe to assume he just means "her container". ;)
I don’t think so. Many players may not know that those coffins or urns are only made visible (enabled) when a unique NPC has died, although not every unique NPC has a coffin or urn reserved in the Halls of the Dead, meaning some coffins or urns will never appear. But, even if a coffin or urn appears, it will always only contain loot and never the body of a deceased NPC. Once inside a Hall of the Dead, they may check the coffins or urns for any loot, finding only loot and no corpse.
Originally posted by alexander_dougherty:
Originally posted by Altbert:
A resurrected NPC will loose ownership of their properties
This is questionable, as I have not found any script that removes ownership.
People have resurrected shopkeepers (Like Belethor for a specific Example), only to discover they no longer do any shopkeeping (Like Belethor no longer does if you resurrect him).
For what I’ve found sofar, shopkeepers are only removed from their shopkeeper faction, and their replacements are added to those factions. This can be reversed, both using the console and mods. What I referred to are not faction-related ownerships, but NPC-related ownerships.
Last edited by Altbert; Oct 2, 2020 @ 1:58pm
Altbert Oct 3, 2020 @ 3:44pm 
Originally posted by mpd1958:
I am not qualified to discuss this subject as I have only resurrected only 1 NPC in all the hours that I have put into Oldrim and SE. That was Alvor the Blacksmith in Riverwood. The resurrection went off without a hitch and the game continued without incident.

You either already accepted the quest to inform the jarl of Whiterun from Alvor or you have sided Ralof after your escape from Helgen. If so, Alvor doesn't play any role in later quests, and thus the game will continue without incident. If you travel to Riverwood, check to see if Alvor is still there. If not, he will be moved to the holding cell, alive and kicking!

Originally posted by mpd1958:
From reading your post I feel that you have done a very detailed study of the matter and put forth your statement with a lot of thought. I hope you get the reasonable discussion you seek. Good Luck!

Thanks. I hope so too.
Chef Oct 3, 2020 @ 3:46pm 
I have been following this discussion since you started this thread. I have nothing to add, but I enjoy the education.
Altbert Oct 3, 2020 @ 3:57pm 
Originally posted by seriousthree:
I have not found need to resurrect a quest character as yet, normally I just restart the previous save as it won't be that long before. What I have tried is to resurrect shopkeepers, which has gone badly so far. Belethor buys stuff but his stock contains a lot of things that I have sold him, including dozens of water breathing rings. Ulfberth War-Bear is presently deceased although he wandered from the shop and spent a lot of time just standing on a hill first.

Really the merchants in Whiterun at least should have been protected against death.

This is how some shopkeepers are scripted. Belethor is replaced by Ysolda, if you have the Unofficial Patch installed, otherwise there is no shopkeeper. Ulfberth is replaced by Adrianne. Original shopkeepers will be removed from their factions and they will not be a regular merchant anymore and their merchandise (what's in their inventory) will not respawn. Check to see if both are still wandering around Whiterun, as after 12 ingame days you should not be seeing them anymore, as they should be moved to the holding cell (death cell).
Altbert Oct 3, 2020 @ 4:01pm 
Originally posted by Chef:
I have been following this discussion since you started this thread. I have nothing to add, but I enjoy the education.
I hope everybody may learn something from this discussion, myself included! That's why I started it.
Bomb Bloke Oct 3, 2020 @ 8:12pm 
Originally posted by Altbert:
This is how some shopkeepers are scripted. Belethor is replaced by Ysolda, if you have the Unofficial Patch installed, otherwise there is no shopkeeper.

That is to say: the patch is what "breaks" Belethor's ability to restock items after resurrection (unless you manually put him back into the merchant faction)?

I wonder why it would do that. If the guy remains dead, it seems redundant. If a player wants to resurrect him, they'll obviously want him to continue in his original role.

I gather only about a dozen shopkeepers are "replaced" without the patch in play?
Altbert Oct 4, 2020 @ 6:53am 
Originally posted by Bomb Bloke:
That is to say: the patch is what "breaks" Belethor's ability to restock items after resurrection (unless you manually put him back into the merchant faction)?

I wonder why it would do that. If the guy remains dead, it seems redundant. If a player wants to resurrect him, they'll obviously want him to continue in his original role.

I gather only about a dozen shopkeepers are "replaced" without the patch in play?
This got me thinking about replacement. I had not been looking into this before, but I think the answer lies in the ForceRefTo function in the SwapAliasOnDeath script. When Belethor dies and Ysolda takes over his business, her reference alias is forced into Belethor's reference alias. This happens in the DialogueWhiterun quest, which never stops and so Ysolda will stay in his reference alias (if I express myself correctly). Ysolda will stay Ysolda, but receives Belethor's faction and AI package data. But will she still hold on to her own?

I wonder what consequences this has. Will the player not be able to marry Ysolda? Or, if already married, will there be a forced divorce, with additional consequences when marriage is involved? Will Ysolda not be a quest giver for the Rare Gifts quest anymore?

Interesting to figure this out!
< >
Showing 1-15 of 108 comments
Per page: 1530 50

Date Posted: Sep 26, 2020 @ 6:16pm
Posts: 108