Avoiding area corruptions

Most people have had better luck after patch 1.05, but apparently it is still happening. Here is some basic information to help:

Check out the Toolset Corruption thread on the Toolset forum.

Some things you can do

  • Don't just change the variables on objects. Delete the variables and re-create them, or better yet, delete the object, update it the blueprint, and replace it.
  • Don't leave areas open. Save and close, then back it up.
  • Turn autosave off if you are getting this a lot.
  • Run kivinen's check module script. (See the local page for more info)
  • Occasionally back up your areas to .erf files.
  • Remove any haks that could have scripts that are causing problems.

Tracking down the cause

One of the most common corruption problems comes when you don't properly set the variable type on a trigger. As a general rule, set the variable type first.

There seem to be additional problems when working with speak triggers. stg_why and mattaus have posted how to recreate these issues:

  • open an existing area
  • change an attribute of an existing object (or simply add a speaktrigger, although its not 100% of time for everyone causing corruption)
  • save , close toolset

- sgt_why

Some people are advocating turning off the auto save function because of this.

Corrupted backups

There's also an issue where some areas are getting corrupt and are not noticed until further down the development process.

Phil5000 posted some frustrations in the Toolset forum about this:

Hi there. Ever since my mod was corrupted and I lost half of it I've been saving backups regularly. Well it got corrupted again but in a different way. The game wouldn't load the mod but it seemed ok in the toolset. So I opened up every area to check and when I hit one particular one I got a 'program has caused error and must close' message.

So I loaded a backup and checked that same area and I got that same message! I know for a fact the area is ok having played it through several times. So what could have happened?

This time the game would load it though so I went in there to have a look. Everything is black. There's nothing in there at all. I can turn the camera around and access my inventory but the PC isn't there. It's just like a void in space.

The idea that your area could have been corrupt long ago will make any builder nervous.

Chris_Rocks posted a possible back-up strategy about exporting your areas as .erf files. While this may be a bit cumbersome and will require more space, it will definitely give you a good backup that you can easily bring into your module. Remember that there's never such a thing as backing up too much.

jackyo123 posted a comment suggesting that it's always a good idea to shut the area down when you are done building with it:

one thing that is ESSENTIAL to do -

I was in the habit, because of the ridiculous load times of anything to do with the toolset, of simply leaving my large areas open.

I would happily go along, making edits here, edits there, etc. Saving multiple backups, everything looks good.

Then, a night or 2 later, the toolset crashes. Ok, no biggie, i have a hundred backups. I open up the toolset, go to open my big area - NOPE. Gives me a CAST error or something. Ok, go back 1 version. NOPE, same thing. Go back 10 versions. Nope, same thing.

What was happening is that the area i had open the whole time had become corrupted, but i had not known about it, since it was open already in the toolset, and i didnt try to reload it.

So I no longer do this. I close down an area as soon as i am done working on it, then re-open it to verify its ok. THEN i close it again and move on to my next piece of work.

He also offeres some additional backup strategies:

Also, you need to be making backup copies of the DIRECTORY (usually has a temp^&^E%^%^%&&$modname associated witn it) by manually copying this directory to a safe place every once in a while. I copy the directory every 3 or 4 mod saves. I can often pull scripts, blueprints, etc out of there, and merge them with the last known 'good' copy of an area before it got trashed, and everything is ok.

Thanks to these fine people for their thoughts.

It may also be helpful to check out my stragety for versioning your modules when working with a campaign.