1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

Bug/Issue XML error after save file edit to change child's name

Discussion in 'Support' started by Crowbeak, Mar 28, 2016.

  1. Crowbeak

    Crowbeak Intergalactic Tourist

    My pregnancy was far shorter than I anticipated, so when I accidentally skipped the dialogue for it and was faced with naming an unknown something, I assumed it was a cow or a goat and just put in Name for the name. Once I realized my mistake, I went into my save file and renamed the child to Kanan, but now I am getting the following error:

    Code:
    Message: There is an error in XML document (2, 3).
    InnerException: System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 2, position 3.
       at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
       at System.Xml.XmlTextReaderImpl.ParsePI(StringBuilder piInDtdStringBuilder)
       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
       at System.Xml.XmlTextReaderImpl.Read()
       at System.Xml.XmlTextReader.Read()
       at System.Xml.XmlReader.ReadEndElement()
       at System.Xml.Serialization.XmlSerializationReader.ReadEndElement()
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSaveGame.Read127_SaveGame(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSaveGame.Read128_SaveGame()
    Stack Trace:    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
       at StardewValley.SaveGame.<getLoadEnumerator>d__b.MoveNext()
       at StardewValley.Game1.UpdateTitleScreen(GameTime time)
       at StardewValley.Game1.Update(GameTime gameTime)
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
       at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Microsoft.Xna.Framework.WindowsGameHost.Run()
       at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
       at StardewValley.Program.Main(String[] args)
    I was using Notepad++. I found the start of the second line and there is an XML declaration there, but as far as I can tell there are no odd characters in front of it, unless there's not supposed to be a newline... but I didn't add the newline. The only thing I can figure is that maybe I accidentally changed the newline type when I saved the file, but I'm at a loss for how I can fix that or what the correct newline would be, if that were the case.

    Here's a copy of the save file: www.lenaleray.us/games/Crowbeak_117634386.zip

    Help would be much appreciated; since the file is plain XML, I didn't make a backup. T_T I assumed I could revert my change and things would work fine, but that's not how this is turning out.
     
      Last edited: Mar 28, 2016
    • RushToward

      RushToward Big Damn Hero

      You shouldn't post your save file without the accompanying SaveGameInfo file too, since the latter is what the game uses to actually load your save file.

      From what I can see, you somehow managed to duplicate literally everything in your save, so it's all in there twice.

      Here, should be fine now.
       
        Last edited: Mar 28, 2016
      • Crowbeak

        Crowbeak Intergalactic Tourist

        Well, now I really feel silly. Not sure how that happened. Thank you for both helping solve my issue and pointing out the fact that I should include both files.
         

        Share This Page