Persistent data storage?

Post » Sun Jun 24, 2012 6:16 am

Is there a way to persistently store data in a property or variable across play sessions?

For instance, if I wanted the HelloWorld tutorial script to permanently record the total number of times I had ever activated the statue, is there a way to do that (other than maybe using a quest container)?
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

Post » Sun Jun 24, 2012 6:14 am

You don't need to do anything special to do that. Papyrus will hold onto your variables and the changes you make to them forever all on its own. They get saved into your game the moment they are loaded and stay there for good.

(Be warned this "feature" tends to make people tear their hair out and utter words that should never be repeated in public, though)
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Sun Jun 24, 2012 1:55 pm

Make a always-running-quest, and use its script to store whatever variables you need should work
User avatar
Beth Belcher
 
Posts: 3393
Joined: Tue Jun 13, 2006 1:39 pm

Post » Sun Jun 24, 2012 7:43 am

*facepalm* I just realized I was, when testing this, COCing back to my test cell instead of loading my save. Hah!

Thanks.
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Sun Jun 24, 2012 2:32 pm

You don't need to do anything special to do that. Papyrus will hold onto your variables and the changes you make to them forever all on its own. They get saved into your game the moment they are loaded and stay there for good.

(Be warned this "feature" tends to make people tear their hair out and utter words that should never be repeated in public, though)
+1
this feature is both a blessing and a curse. even if you completely uninstall and "clean save" your game, the old properties from previous scripts will leave permenent residue in the save game (which dumps errors every time a save game is loaded)
User avatar
SaVino GοΜ
 
Posts: 3360
Joined: Mon Sep 17, 2007 8:00 pm

Post » Sun Jun 24, 2012 3:42 am

Blessing/Curse: It can be if you forget to 'reset' your variables/properties either at the end of one script-firing, or at the beginning of each one (or presumably, somewhere in between, or even externally; eg- another script).

perma-residue: as we're discussing in the 'deleting script' thread currently, the same technique can be used to get rid of these errors in a saveGame. For instance, if you no longer use suchNsuch mod, but it's stuff is violating your saveGame data on a regular basis... it shouldn't after making a clean save. But for still-in-use mods, one must obtain a 'cleaned version' of said mod before Ye Olde clean-a-save trick can be used (that technique goes back at least to Obliv.. though properties weren't the issue back then, I actually forget WAS heheh).

A clean version would be one that has any object, ref, alias, etc that has the modified script still attached to it... but in the CK, whoever needs to actually REMOVE the script, then add it back - and re-fill the remaining properties. A pain if you attached a script to indiv Refs, but it shouldn't be necessary if the baseObject is were the modified script is attached.

Cupcake: nicely done heheh.. don't feel bad, happens to many of us at least once in a while. The trick is not to post/admit it in an international forum.. heheheh.

[EDIT: type-o's. (speaking of mistakes... I've been rather 'off' tonight heheh; prob'ly more careless edits than all my other posts cumulative!)
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am


Return to V - Skyrim

cron