Shivzz0119 Posted August 7, 2018 Share Posted August 7, 2018 Hello all.I'm not exactly new to scripting, but not advanced either. I stumbled upon this concept of "persistence" when trying to find out why one of my quest aliases weren't working when set to a unique character. I found this link on Github explaining forms, references and aliases.It says:A specific ObjectReference and all of its details (AI packages, script properties, etc.) are not stored in a save file. Instead, nothing but the base Form of each temporary ObjectReference is stored in the save file, and then when the game is loaded, a new ObjectReference is created for each mention of each Form in the save file. That new ObjectReference will start off with a clean slate, without any of the modifications that may have taken place before the game was saved/loaded. ^^ What exactly does this mean? So If I placed an actor in my world and he wasn't persistent all his packages and scripts would be reset each time? If I damaged him and reloaded would his health be back to normal? This is quite confusing to me. It also says that any obj-ref is no longer persistent when cleared from its alias. But the CK Wiki says Specific Reference A specific reference is assigned to this alias. Note that this makes that reference permanently persistent (always loaded in memory), even when this quest is not running. This can eventually cause performance issues, particularly with actors. Which one is correct?? It says again that if an obj-ref is persistent it will carry the same ID, and maintain all its info. Does this mean if I place something in the world it has a randomly generated ID or something? I don't quite get that either. Lastly, on script properties. I get the general Idea that a papyrus script property makes the object persistent, but I read somewhere on github that they are freed from memory upon deletion. However on the CK wiki it says that it will always remain persistent(???), so its recommended to wrap it in an alias using the story manager. I know this is a lot, but I am generally confused and would really appreciate it if someone took the time to help :smile: Link to comment Share on other sites More sharing options...
simtam Posted August 8, 2018 Share Posted August 8, 2018 Consider the alias type "Find Matching Reference". By adding conditions you can narrow it down to filling a specific object reference. It won't find stuff that is not loaded in memory. It has a flag "In Loaded Area", and since everything in loaded area is loaded, you have to uncheck this flag and make sure you are far away enough so that the object you want to fill this alias with is not loaded if it's not persistent. That's how you can test if an object is persistent or not, and verify which interpretation of documentation is correct. There's a performance overhead with having things loaded in memory, and maybe NPCs behave differently if they are still loaded while in unloaded area? Not sure about the last one. Link to comment Share on other sites More sharing options...
Shivzz0119 Posted August 9, 2018 Author Share Posted August 9, 2018 Consider the alias type "Find Matching Reference". By adding conditions you can narrow it down to filling a specific object reference. It won't find stuff that is not loaded in memory. It has a flag "In Loaded Area", and since everything in loaded area is loaded, you have to uncheck this flag and make sure you are far away enough so that the object you want to fill this alias with is not loaded if it's not persistent. That's how you can test if an object is persistent or not, and verify which interpretation of documentation is correct. There's a performance overhead with having things loaded in memory, and maybe NPCs behave differently if they are still loaded while in unloaded area? Not sure about the last one.Alright so I ran some tests on some actors. One for when the alias is cleared, the other for when the quest ends. I ran another quest using a custom keyword to find references and I unchecked the "In loaded area" box. In game, since I placed them in the sleeping giant inn, I fast traveled to Solitude and run the "purgecellbuffers" comman just in case. In both instances, the aliases filled correctly. I assume this means they're not persistent, right? Link to comment Share on other sites More sharing options...
simtam Posted August 9, 2018 Share Posted August 9, 2018 To be 100% sure, it would be best to have one case when the alias is filled and one case when it is not. Otherwise I can't rule out that the methodology is wrong for some reason. BTW, do you even look up "Persistent" flags for those object references in TES5Edit? Creation Kit automatically add those to various objects referenced directly from your mod. They end up in "Persistent cell", under a Worldspace or Interior Cell. As you can see, the base game has a lot of persistent objects, so there's no point in worrying about performance of a small number of additional persistent references. Anyway, if your quest aliases weren't working when set to a unique character, it's likely due to some other reason. Link to comment Share on other sites More sharing options...
Shivzz0119 Posted August 9, 2018 Author Share Posted August 9, 2018 To be 100% sure, it would be best to have one case when the alias is filled and one case when it is not. Otherwise I can't rule out that the methodology is wrong for some reason. BTW, do you even look up "Persistent" flags for those object references in TES5Edit? Creation Kit automatically add those to various objects referenced directly from your mod. They end up in "Persistent cell", under a Worldspace or Interior Cell. As you can see, the base game has a lot of persistent objects, so there's no point in worrying about performance of a small number of additional persistent references. Anyway, if your quest aliases weren't working when set to a unique character, it's likely due to some other reason.Yeah after looking at TES5Edit (or SSEEdit now as its called) I realised it wasn't that big of a deal. Thanks - don't know why i didn't think of it earlier Link to comment Share on other sites More sharing options...
simtam Posted August 10, 2018 Share Posted August 10, 2018 There is also what I call the Arthmoor's Persistence Test, which is simpler to perform: "let's change the object position in Creation Kit and make a mod that would change this object position if started new game. Does installing this mod mid-playthrough changes this object position, or not?" because usually when an object is loaded and live in the game, mod changes are ignored. But there are various exceptions https://afkmods.iguanadons.net/index.php?/topic/4250-skyrim-levels-of-persistence/ It's worth knowing, because it impacts how mod updates should be installed on active games - for example "it's recommended to make a save in some unrelated interior cell". Also, similar thing can happen with changes to forms that are not object references. For example, changes to quest alias definitions won't take any effect if the quest is already alive (important when modding quests that aren't "Run Once"). Link to comment Share on other sites More sharing options...
Evangela Posted August 11, 2018 Share Posted August 11, 2018 All useful information that I wish I had known years ago.. Link to comment Share on other sites More sharing options...
Recommended Posts