Jump to content

[LE] Iterating all actors in a faction?


Haravikk

Recommended Posts

So basically I'm making a mod that changes the race of arbitrary NPCs in order to significantly alter their appearance (different model and textures). This works fine, however, I'm currently working on an MCM menu for it, and I'm thinking that I ought to handle cases where a user wishes to uninstall my mod.

 

I'm assuming that uninstalling a custom race that vanilla NPCs are set to will be bad-news (unless Skyrim knows to reset them?) so I'm thinking I need a way to iterate through changed NPCs in order to change them back; even if this isn't actually needed for uninstalling, I figure I should have a cleaning function anyway if a player wants to essentially reset the mod.

 

Anyway, when I change an NPC, in addition to calling .SetRace() I also add them to a custom faction, which I thought might make it easier to find them again, but I can't see a way to do this. Is it possible to iterate all members of a faction (no matter where they are)? If not, are there any alternative methods that I can use to iterate all NPCs that I've changed so I can change them back?

Link to comment
Share on other sites

You'd think there would be but as far as I can tell, there's not, even with SKSE.

 

However, there is an alternative. Instead of (or in addition to) adding them to a faction, you can dynamically add them to a FormList with AddForm when you change their race. That FormList will contain a list you can iterate through to reset your actors.

Link to comment
Share on other sites

[...] I'm thinking that I ought to handle cases where a user wishes to uninstall my mod.

No, uninstalling mods is what corrupts peoples savegame files and even with the various "cleaners" not all of the corruption can be removed. People need to finally accept that once you've starting using a mod you have to keep using that mod, go back to a save made before it was added, or start a new character. Every time someone creates a mod with an "uninstall" option it just perpetuates the myth that there's a safe way to uninstall mods and continue playing with that same character.

Link to comment
Share on other sites

 

[...] I'm thinking that I ought to handle cases where a user wishes to uninstall my mod.

No, uninstalling mods is what corrupts peoples savegame files and even with the various "cleaners" not all of the corruption can be removed. People need to finally accept that once you've starting using a mod you have to keep using that mod, go back to a save made before it was added, or start a new character. Every time someone creates a mod with an "uninstall" option it just perpetuates the myth that there's a safe way to uninstall mods and continue playing with that same character.

 

Is that really the case?

 

My mod is fairly light overall; the meat of it is in the new races, and all scripting is contained within the quest that triggers the race changes (among other things, there'll be more of a quest to it in future). Surely once the race changes are undone, removing the quest will, at worst, leave behind an orphaned script that doesn't do anything (it is only triggered through the quest), and which a save cleaner should tidy up quite happily?

 

I realise that more complex mods that attach a bunch of stuff to the player or to other NPCs might be another matter, but my mod shouldn't need to do any of that.

Edited by Haravikk
Link to comment
Share on other sites

People keep thinking about cleaning up scripts with the save cleaners. Those are just the most obvious problems but there are all sorts of things that can happen including strange inter-dependencies that happen dynamically in the game.

 

Yes, sometimes it can be relatively harmless to remove mods but just because your mod is light doesn't mean that some other mod which does something fancier hasn't taken into account your mod's changes and when removing your mod you end up breaking those other mods. The game is designed to have things added but not removed. We've known that about Bethsda games since Morrowind and people keep trying to patch their way around it but the official (and unofficial) word from Bethesda developers who know how things work say it's not safe to remove mods and continue playing with that same character. We also know they don't always understand their own work, but usually it's because they assume things like load order won't matter. But in this case what they've said does seem to be true.

 

So it's not really about your mod particularly but about how it might end up interacting with others that's the biggest problem.

Link to comment
Share on other sites

That myth also carries on because nothing bad seemingly happens when a mod is disabled. Oblivion was a bit different: You disable a mod, chances are that all the saves relying on the mod wont load(character bye bye) or you get in game and crashes everywhere, or things just f*#@ing breaking. Oblivion will yell at you. Loud. Skyrim doesn't. It takes is sweet time and before you know it, the save is corrupted.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...