Talk:Persistence (Papyrus)

From the CreationKit Wiki
Jump to navigation Jump to search

What does NOT make reference persistent, that you may expect like me it does:[edit source]

- adding references to a FromList doesn't make them persistent even if you keep a reference to the FormList in your script. Doing this may endup with GetAt(index) returning None from the list when changing cell and returning again the correct value when going back where you was when you added them. This was tested with Actor (dead actors) references but I expect it to be valid for any reference, yet I don't have time to test that now, I'm also curious how it works if you add the reference to an array.LukeH 05:19, 21 March 2012 (EDT)




i know i'm not talking about stock code here, but it is popular enough now that i do not think there is anyone who isn't using a function or two from PapyrusUtil. has anyone tried this with the StorageUtil.FormList's? would a StorageUtil.FormListAdd(None,"MyPersists",AnObjectRef) trigger whatever keeps the references around? I wonder if there is anything different between the stock FormLists and StorageUtil FormLists.

at this point i am thinking of ways have an infinite number of the random hunters kept around, or other similar stupid things that you shouldn't do. --Darkconsole (talk) 2015-01-26T01:44:34 (EST)

An object CAN unload while a function is running on it.[edit source]

If an object persists when it has a running function on it, then how do you explain an error such as this:

[08/15/2012 - 11:10:58PM] error:  (FF000DFE): has no 3d, and so cannot have its motion type changed.
stack:
	[ (FF000DFE)].critterMoth.SetMotionType() - "<native>" Line ?
	[ (FF000DFE)].critterMoth.BellShapeTranslateToRefAtSpeed() - "Critter.psc" Line 556
	[ (FF000DFE)].critterMoth.BellShapeTranslateToRefNodeAtSpeedAndGotoState() - "Critter.psc" Line 639
	[ (FF000DFE)].critterMoth.GoToNewPlant() - "CritterMoth.psc" Line 273
	[ (FF000DFE)].critterMoth.OnUpdate() - "CritterMoth.psc" Line 138

This error occurred because the critter unloaded while a function was running on it.

-- Threedee 06:57, 16 August 2012 (EDT)

I think persistent references can still have their 3D unloaded, which would explain this error. See Is3DLoaded - ObjectReference
-- Cipscis (talk) 16:32, 11 October 2012 (EDT)
Have a look at the Khajiit caravans and how they work: the caravan folks are all force filled in specific reference aliases on quest start, which makes them all permanently persistent. Now have a look at the caravan script: to check whether the player is around before the camp site is enabled (in order to prevent it from popping up out of nowhere), the script waits for the caravan leader's 3D to unload. Needless to say that there would never be a caravan camp site enabled or disabled in the game if his 3D would not unload only because his reference is permanently persistent.--Sclerocephalus (talk) 2013-08-20T20:31:20 (EDT)

I'm about a year late. The caravan NPCs are filled via Unique Actor, though it is still not clear rather filling with this option makes NPCs permanently persistent. --Terra Nova2 (talk) 2014-09-02T06:56:39 (EDT)

What happens with persistent references used in crafting or sold and merchant chest reset?[edit source]

As title says. Will they bloat your save? Any "how to" take care of such items if needed? LukeH (talk) 2013-03-01T02:30:15 (EST)


So, will this make a NPC stay "loaded" and evaluating its package conditions even if not near the player? --Darkitow (talk) 2015-01-27T14:20:51 (EST)