Any way to log information outside of a mod?

Post » Sun Aug 08, 2010 11:02 am

I have a magic shield that each time you use it to block spells you get experience points toward an upgrade on it.

But I am worried that if the player unloads the mod and reloads it for a clean install of a new revison or for any other reason they would lose the recorded skill points.
How can a mod keep a record of a variable (a short) in the save game even if the mod is unloaded and then reloaded later?

There must be some way to stick this info into the save game as there are so many issues with save game bloat where data is stuck in the save game even when the mod is unloaded.

So I need to do this ON PURPOSE some how!
User avatar
Cathrin Hummel
 
Posts: 3399
Joined: Mon Apr 16, 2007 7:16 pm

Post » Sun Aug 08, 2010 1:00 pm

One idea would be to find a persistent reference in vanilla Oblivion that isn't used in the game. For example 'TestDeadRef' in the interior cell 'TestAlan', which is not used anywhere in the game (according to UseInfo). It has a z coordinate of 7308.1714. Take that as a base and count your experience points by elevating the reference via script. So if your experience point value is 1000 for example you'd set the z coordinate of TestDeadRef to 7308.2714. As far as I know persistent reference positions are stored in the savegame so the position of TestDeadRef would be kept even if your mod was removed.

Since TestDeadRef is an actor it could happen that the z coordinate was reset if someone coc'ed to TestAlan for some reason (unlikely, but you never know). So maybe you find a static named reference that is not used or where the position doesn't matter.
User avatar
Cash n Class
 
Posts: 3430
Joined: Wed Jun 28, 2006 10:01 am

Post » Sun Aug 08, 2010 9:28 am

Very clever man! :goodjob:

Thanks!!!


One idea would be to find a persistent reference in vanilla Oblivion that isn't used in the game. For example 'TestDeadRef' in the interior cell 'TestAlan', which is not used anywhere in the game (according to UseInfo). It has a z coordinate of 7308.1714. Take that as a base and count your experience points by elevating the reference via script. So if your experience point value is 1000 for example you'd set the z coordinate of TestDeadRef to 7308.2714. As far as I know persistent reference positions are stored in the savegame so the position of TestDeadRef would be kept even if your mod was removed.

Since TestDeadRef is an actor it could happen that the z coordinate was reset if someone coc'ed to TestAlan for some reason (unlikely, but you never know). So maybe you find a static named reference that is not used or where the position doesn't matter.

User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm


Return to IV - Oblivion