Jump to content

How to find deleted objectReferences in Papryus


CrankyCat

Recommended Posts

I have objects persisting even though they've been deleted and the linked keywords were removed. So, they aren't going to be returned if I select a workshop and use GetLinkedRefChildren(WorkshopItemKeyword). 

In FallrimTools they'll show up as just changeforms while in game if I select using prid they'll show with the [T] [PP] and [D] tags; temporary persistence, papyrus placed, and deleted(?) or disabled(?). They are both deleted and disabled and dppi shows nothing. I can use 'fp' (forcepersistence) to toggle and remove persistence manually but I need a way to write a cleanup script. I only have some I know about and could remove but there are many more.

There is no 'fp' command in papyrus so figuring that out is the second problem. In the console I can use 'fp' to toggle persistence and the deleted item is immediately removed from the game but I don't know how to do that in Papyrus.

Thanks for any assistance.

Link to comment
Share on other sites

  • 1 month later...

(1) There is no function to toggle persistence from a script. If an object is unexpectedly persistent, this might be because it is still linked to other objects (or other objects being linked to it). Workshop objects that require an actor are linked from that actor (this link is deleted on unload and restored on load). All crops are linked from their damage helpers but this link is permanent; it is not cleared until the crop is deleted.  It also could be that the offending object is in a script property. All crops, for example, keep the reference of their damage helper in a script property and they also have an array on WorkshopObjectScript to keep the references of their furniture markers.

(2) Deleted objects are not actually removed until their parent cell unloads. Up to that point, they're only "marked for deletion" (that's why scripts should disable them before they delete them, so they are at least invisible until they are actually deleted). Thus, in order to make sure that you don't look at bogus objects, you should allow the workshop to unload and reload before you start inspecting objects. Better though if you allow it to unload and reload twice because the householding functions that start running when a workshop loads do a lot of cleanup stuff that may result in even more objects being removed when it unloads subsequently.

Link to comment
Share on other sites

Thanks for the reply. I had some success with finding objects by type based on existing types and managed to shrink my save by 20MB or so using keyboard macros to perform prid and fp combos based on a generated list. Yeesh.  Earlier I went all the way to Nuka-World to go into a new worldspace to see if that would clear deleted items with a save/quit/reload but it didn't. Only my nasty macro created in Notepad++ with regex search and replace cleaned up many of the deleted temp persistence (FFxxxxxx) objects.

I never could find the reason for some persistence although some point after my initial cleaning the deleted objects cleaned up correctly after refreshing instead of remaining in their deleted state forever. All KingGath did was explicitly remove the linked reference to the workshop as far as I know but perhaps that change avoided the forced persistence going forward. Not sure why it wasn't everyone with the issue unless it has to do with script performance or it wasn't noticed.

I didn't find most of the junk apparently since a clean install of Sim Settlements lowered the save size another 40MB down to 40MB without SS and 60 with it reinstalled. I was able to do a clean reinstall without screwing up my game by destructing all of the ASAM sensors/plots and going to the old QaSmoke location to do the uninstall ala Skyrim. My custom buildings are still there so I can add the plots back but I'm kind of tired of Fallout for now :-| 

 

 

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...