wysiwyg Posted July 28, 2018 Share Posted July 28, 2018 As the title says, 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. I never got an answer to the question on how to remove persistence on an object in Papyrus previously. Thanks for any assistance. Link to comment Share on other sites More sharing options...
Evangela Posted July 29, 2018 Share Posted July 29, 2018 (edited) Removing the objects via FO4Edit could work but I've not tried this on a save that has already seen the mod. I don't know a way to find an object marked as deleted at run time. You could try FindAllReferencesOfType and use the base object as the thing to search. Edited July 29, 2018 by Rasikko Link to comment Share on other sites More sharing options...
wysiwyg Posted July 29, 2018 Author Share Posted July 29, 2018 Thanks for that, FindAllReferencesOfType should work for items with no keyword. At least I can use Self.GetLinkedRefChildren(WorkshopItemKeyword) on the workbench and find references of the types which still exist in the settlement at any rate. Tracking the unique baseid's could be a hassle with the arrays limited to a size of 128. I can see them in FallrimTools and delete them but there's no filter by the ChangeFormFlag yet. I asked if that could be added so hopefully at some point I can do it. Now I have to figure out how to remove the persistence since the "forcepersistence" toggle is only in the console. Link to comment Share on other sites More sharing options...
SKKmods Posted July 29, 2018 Share Posted July 29, 2018 As per Rasikko I have cleaned up some of my own mod upgrade messes with OnPlayerLoadGame() + FindAllReferencesOfType() + IsDisabled() + IsDeleted no problem without anyone noticing :ninja: Link to comment Share on other sites More sharing options...
wysiwyg Posted July 29, 2018 Author Share Posted July 29, 2018 @SKK50, what do you do with the objects you found? I tried Reset(), UnregisterForAllEvents(), SetActorOwner(None), SetActorRefOwner(None), and removed any keywords and they still persist. Only toggling forcepersistence from the console gets rid of the items even though they'd been disabled and marked for deletion. Link to comment Share on other sites More sharing options...
SKKmods Posted July 29, 2018 Share Posted July 29, 2018 I have never had persistent stuff hanging around that was not my own fault due to dirty pointers locking 'em in a RefColectionAlias or ObjectReference Array. Although I did use quest aliases to create some NPCs without the TEMP flag set and then lost 'em persistent when the alias was cleared, but find + disable + killsilent + delete cleanup fixed them. Also whilst a script array find is limited to 128 results, a quest match fill will populate 256 results 10 times faster. Fix up a restartable quest that keeps filling and killing until there are no more. Segmenting with Worldspace conditions can help if your covering DC/GoodN/Nuka and such busy areas. Link to comment Share on other sites More sharing options...
Recommended Posts