Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Guyserman82 on Fri 08/01/2010 23:44:39

Title: Source Code errors
Post by: Guyserman82 on Fri 08/01/2010 23:44:39
When I try to load source codes, one of three things happen:
One, they work.

Two, I get this error code:

An error occurred whilst trying to load your game. The error was:

Data at root level is invalid. Line 1, position 1.

If you cannot resolve the error, please post on the AGS Techincal Forum for assistance

Error details: System.Xml.XmlException: Data at the root level is
invalid. Line 1, position 1.
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
  at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
  at System.Xml.XmlTextReaderImpl.Read()
  at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader
reader, Boolean preserveWhitespace)
  at System.Xml.XmlDocument.Load(XmlReader reader)
  at System.Xml.XmlDocument.Load(String filename)
  at AGS.Editor.AGSEditor.LoadGameFile(String fileName)
  at AGS.Editor.Tasks.LoadGameFromDisk(String gameToLoad,
Boolean interactive)
  at AGS.Editor.InteractiveTasks.LoadGameFromDisk(String
gameToLoad)

Three, I get this error code:

An error occurred whilst trying to load your game. The error was:

This game was saved by an old version of AGS. This version of the
editor can only import games saved with AGS 2.72.

IF you cannot resolve the error, please post on the AGS Technical
Forum for assistance.

Can anybody give me some help?
Title: Re: Source Code errors
Post by: Pumaman on Sat 09/01/2010 17:33:30
Well, do you always get the same behaviour with each particular game, or are you getting random errors with one particular game?
Title: Re: Source Code errors
Post by: Guyserman82 on Sun 10/01/2010 01:57:46
It depends on the game, but I will always get the same error code when I open each game.
Title: Re: Source Code errors
Post by: Pumaman on Sun 10/01/2010 13:11:03
The third error is self explanitory:
QuoteThis game was saved by an old version of AGS. This version of the
editor can only import games saved with AGS 2.72.

AGS 3.x cannot open games that were made with versions before 2.72. You need to load the game into AGS 2.72 first and save it, then AGS 3.x will be able to load it.

QuoteData at root level is invalid. Line 1, position 1.

This indicates that the game file is corrupt for some reason. If it is one particular game that is causing you this problem, try renaming the "Game.agf" file to something else, then rename "Game.agf.bak" to "Game.agf" and see if that resolves the problem.
Title: Re: Source Code errors
Post by: Crimson Wizard on Sun 10/01/2010 13:44:06
Guyserman, allow me to make a small and rather intuitive guess... are you opening "ac2game.ags" file from some open source project?