Some trouble with custom data type arrays (save game corrupt

Post » Thu Jun 21, 2012 11:26 pm

Hi guys,

I've experienced something I've never experienced before. I've used arrays of custom data types before and it gave me no problems. But today when I was working on a new script, I realized that the declaration of an array of custom data types is causing savegame corruption.

As a test, I made a new empty script that extends ObjectReference and tried to make an array out of it and it caused savegame corruption. When I commented out that line, the problem goes away. If I changed the data type to an existing data type (i.e. float, Actor), it works fine too. If I changed the variable to just the datatype itself without the array, there is then no corruption. I've tried changing the datatype to a few other custom data types and some corrupted the save and some didn't.

So next, I decided to change the array variable to a property and the corruption occurs if the array has no elements inside. But if I make it an array of length 1 with a "None" element within, then again the corruption goes away.

I wonder if any one had experienced something like this before?

Also, are there ways to trace what exactly causes a savegame corruption? I couldn't find any trace files in the game folder.
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Thu Jun 21, 2012 1:45 pm

I suppose nobody is interested in this silly topic.

Anyway, I did a bit more digging. It appears the savegame corruption does not occur as soon as I am given a chance to initialize the custom datatype array (i.e. saving after walking into a cell where the object loads and initializes the array).

One possibility I can think of is that the module that controls the game saving process does not have full information on the custom datatype until it is first used in a script in some form (something in the lines of "call by need").

Since the Skyrim game engine apparently does not allow the user to initialize a global variable array upon declaration, the workaround I had was to make the array a property and manually set it to some large size.

Now, I am not sure if I am being plain ignorant or if I've hit upon some inherent flaw of the Skyrim game engine.
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Fri Jun 22, 2012 3:53 am

I'd say anything that can cause savegame corruption using only official tools would definitely be a bug.

What were thy symptoms of this savegame corruption? Did the game report that the files were corrupt when you went to load or something?

Cipscis
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Thu Jun 21, 2012 1:12 pm

I'd say anything that can cause savegame corruption using only official tools would definitely be a bug.
Not necessarily. I've corrupted my saves before by forgetting to properly initializing an array (similar situation, although in that case I was using the array as a property instead of a global variable).

What were thy symptoms of this savegame corruption? Did the game report that the files were corrupt when you went to load or something?

Cipscis
It simply says my save is corrupted and then bounced me back to the main screen. And as I've noted, I had to very explicitly force the game to define the array by making it a defined property to avoid corruption.
User avatar
dean Cutler
 
Posts: 3411
Joined: Wed Jul 18, 2007 7:29 am


Return to V - Skyrim