Savegame bloat by removing a mod

Post » Sun Nov 18, 2012 9:36 am

Hi,

I have a question. I read through:
http://www.creationkit.com/OnUpdate_-_Form#Notes
http://www.gamesas.com/topic/1349327-scripting-savegame-bloating/
http://www.gamesas.com/topic/1358788-script-causes-savegame-bloat/page__p__20495082__hl__savegame%20bloat__fromsearch__1#entry20495082

I use onupdate heavily and the shortest is 1 sec. Why is it that my mod causes bloat when I remove it from the load order and load a savegame with the mod active? Will using state or registerforsingleupdate at the end of onupdate be enough to help here?
I haven't done http://www.creationkit.com/DumpPapyrusStacks as I just recently read it from one of the above links.

I guess DPS is the only point to find out what is causing the bloat? Are scripts endlessly running even though the mod is no longer loaded?
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Sun Nov 18, 2012 3:31 pm

If you use RegisterForUpdate(), yes, the scripts will continue to attempt to execute even after the mod is uninstalled. That is why you should never, ever, ever use it. Use RegisterForSingleUpdate() instead.
User avatar
Tracey Duncan
 
Posts: 3299
Joined: Wed Apr 18, 2007 9:32 am

Post » Sun Nov 18, 2012 11:57 am

So basically, because of registerforupdate my scripts are registered, are in the queue but can't be executed because the mod is not loaded and thus, increase the save size astronomically?
I changed now to singleupdate but I must start a new game to have the change take effect, right?
Are there other known causes for bloat? Of course, we all know the placeatme thing. ;)
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Sun Nov 18, 2012 9:08 am

I don't. Tell me about the PlaceAtMe thing.
User avatar
Jade Muggeridge
 
Posts: 3439
Joined: Mon Nov 20, 2006 6:51 pm

Post » Sun Nov 18, 2012 3:12 pm

PlaceAtMe is better now than it was in Oblivion.
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm

Post » Sun Nov 18, 2012 11:08 am

PlaceAtMe is better now than it was in Oblivion.

So it will remove objects now?
So it seems that only really registerforupdate may cause bloat.
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Sun Nov 18, 2012 8:36 am

So it will remove objects now?
So it seems that only really registerforupdate may cause bloat.

PlaceAtMe does not auto remove/delete anything as that would be a terrible idea as some things you do not want auto deleted.

There are now functions that will delete objects that were dynamically created unlike Oblivion that did not have this feature.

Delete and DeleteWhenAble should be used in conjunction with PlaceAtMe.
User avatar
Darren Chandler
 
Posts: 3361
Joined: Mon Jun 25, 2007 9:03 am

Post » Sun Nov 18, 2012 2:07 am

Ah, okay, that makes me feel better. I'm always careful to cleanup my mess, particularly when I'm using hundreds of FXEmptyActivators in a script to guide movement... if just using PlaceAtMe caused bloat, I'd be so screwed :P
User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am

Post » Sun Nov 18, 2012 2:45 am

ObjectReference PlaceObjectHere = RefToPlaceTheObjectAt.Placeatme(Object) will link the Object to a reference, casting this reference as perm to a quest prop lets you safely delete the ref again like this

QuestScript property ScriptQuest Auto

Script has the property tRef as ObjectReference

so

Event OnSomething()
QuestScript.tRef = PlaceObjectHere
;do something with the ref now
endevent

Event NextEvent()
;we are done delete the object again
QuestScript.tRef.Disable()
QuestScript.tRef.Delete()
endevent

this should prevent bloating with placeatme, for the OnUpdate it would be best to use OnSingleUpdate or just set up conditions that contain UnregisterForUpdate, like:

Event OnUpdate()
if Condition == 0
UnregisterForUpdate()
else
;do some stuff
endif
Endevent

when you disable the mod the condition will be always 0 so your script should in theory unregister itself upon disabling of the mod, as the alias is stored inside the savegame.
User avatar
Genocidal Cry
 
Posts: 3357
Joined: Fri Jun 22, 2007 10:02 pm


Return to V - Skyrim