Jump to content

Script for removing records that have no references


Elaura

Recommended Posts

Looking for a way to batch remove records that have no references listed in SSEEdit.

On a side note, could records without references still be needed by the mod?

Link to comment
Share on other sites

I have no script,  but ...

Many mods take advantage of unreferenced items.  Mods that resurrect things from the cutting room floor are some prime examples.  

Also consider that some scripts may refer to unrferenced forms by using commands like Game.GetPlayer().GetItemCount(unreferenced_item).

So ... unreferenced items may not be truly unreferenced.

Link to comment
Share on other sites

Thank you for the information. So much for cleaning up this mess. Is there any way to know for certain *without* getting into the head of the mod author?

Link to comment
Share on other sites

Mod authors, plural. 

By way of example,  Fallout 3, Point Lookout had a shotgun called Pa's Fishing aid which got left on the cutting room floor.  It was incomplete and several people completed and released their version of the shotgun.  

So, without a crystal ball, I know of no way of knowing what is used, what is recycled and what is waste. 

Link to comment
Share on other sites

Yeah, you really need to check that kind of thing manually in order to be sure what you want to remove isn't being used anywhere.

Link to comment
Share on other sites

Plus, there are objects where referencing works backwards. Construction and tempering recipes, for example: they reference the items they are supposed to work on but they are not referenced by any record themselves (at least not by any record in the game files; they are apparently still referenced by engine level code though).

Link to comment
Share on other sites

On 5/22/2021 at 9:06 AM, Elaura said:

It gets more complicated with every passing day. Thanks for the reply.

Depending on what type of records you are talking about, you do have the option of disabling them as opposed to deleting them. Exactly what type of records? Are these record created by your Mod? If they were created by your mod then you can delete them after checking for their use info in xedit and the CK.  When you are looking to see how something is being used it is a good idea to check Xedit and the use info in the CK.

Link to comment
Share on other sites

Unfortunately, it's not *my* mod. It's a large, complicated mod that has a Frankenstein's monster look in XEdit. The author(s) left a lot of extraneous records from copying existing objects, merging in records from resources, and from version changes. I don't even know if the extra records cause any issues.

For example, the main character wears a unique set of armor. In XEdit, I can see there are two sets of armor, one appears to be a leftover from a prior version that was never removed.

Sometimes, it amazes me that the mod works.

Link to comment
Share on other sites

15 hours ago, Elaura said:

I don't even know if the extra records cause any issues.

It is unlikely they would cause issues other than potentially conflicting with another mod.

It sounds like you are going to need to work with it for a period of time before you are familiar enough to start deleting files. If you delete a file and the game calls for it your game could crash.  Keep in mind, there are ways to call records via script that can not be detected by xedit or the CK.  It wouldn't hurt to look over any scripts and see if the author uses that code.( gamegetformfromfile ). 

Put one foot in front of the other and soon you will be running. :firerabbit:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...