Game Development Community

Wierd Crash Problem

by Aditya Kulkarni · in Torque Game Builder · 07/15/2010 (6:28 am) · 3 replies

If the machine crashes, or more recently electricity failed and the machine turned off while my exe was on, it refuses to read the xml from the appdata folder.

Before the crash everything worked fine, after it just keeps saying "Can't read file profiles.xml"

[Edit]Confirmed this on 2 different machines. Also, the 'Build Project' textfields in the editor are reset to defaults (Company Name: Independent, etc.)

%fileFQN = "profiles.xml";
   
 /////////////////////////Get number of lines in profiles.xml//////////////////////////////   
	%file2 = new FileObject();
	
	if (!%file2.openForRead(%fileFQN))
	{
		error("Can't read file " @ %fileFQN);
	}

#1
07/15/2010 (7:18 am)
ok confirmed that this changes commonConfig.xml...i changed the company and game and it works...

i know i can check commonConfig and set both fields at the start of the game...but how do i stop this from happening in the first place?
#2
07/16/2010 (12:55 am)
Sorry, but I'm a little confused by the question.

Are you wondering how you can keep the commonConfig.xml file from being corrupted? Or are you wondering how to make sure a game can still run after a power failure? Or is there something else?

At least for your own files, if the file cannot open, you can re-write it with some default values. That's better than not letting your users play your game.
#3
07/16/2010 (5:10 am)
File corruption. I am wondering why it would do that and if it's possible to prevent it.