Jump to content

Photo

How do I find deleted objectReferences with no keyword?

objectreference papyrus find persistence

  • Please log in to reply
5 replies to this topic

#1
wysiwyg

wysiwyg

    Old hand

  • Premium Member
  • 932 posts

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.



#2
Rasikko

Rasikko

    The Arbiter of Time

  • Members
  • PipPipPipPip
  • 1,236 posts

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 by Rasikko, 29 July 2018 - 06:55 AM.


#3
wysiwyg

wysiwyg

    Old hand

  • Premium Member
  • 932 posts

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. 



#4
SKK50

SKK50

    Institutum delenda est

  • Premium Member
  • 4,311 posts
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:


#5
wysiwyg

wysiwyg

    Old hand

  • Premium Member
  • 932 posts

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



#6
SKK50

SKK50

    Institutum delenda est

  • Premium Member
  • 4,311 posts

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.







Also tagged with one or more of these keywords: objectreference, papyrus, find, persistence

Page loaded in: 1.102 seconds