Getting an error parsing my savegame files after a few game variables are set.

Error while parsing XML data: at System.String.IndexOf (Char value, Int32 startIndex, Int32 count) [0x00013] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1114

at ORKFramework.XML.XMLParser.Parse () [0x00000] in :0


The flow is:

1. execute some scenes
2. save game
3. reload

This flow works correctly until i pass a certain point in my game, after which I get the error on loading a game which was saved from that point on.

I tested with the following code, as well:


public static void TestXMLParse(string file)
{
var parser = new XML.XMLParser(File.ReadAllText(file), new AssetLookUp());
parser.Parse();
}


It seems like there is some non standard xml in the file so it is a bit hard for me to see what the issue is.

https://mrochon-public-images.s3.amazonaws.com/savegameAUTO.save
  • Hm, at first glance I didn't see any issue in the XML of the save file.

    Can you tell me some details on the variables you're setting? Mostly their variable keys and the value of string variables.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The only one thats being set between scene 3 and 4 is a couple of booleans:

    var useBattleTutorial: bool
    var alreadyShowedAttackTutorial: bool

    Saving and loading before scene 3 starts works fine.
    Saving and loading after scene 4 ends, fails.

    Scene 3 leads into a battle tutorial, scene 4 is the scene after the battle ends. There is no opportunity to save in between or during.

    I'd be happy to debug the file to identify at least exactly where it is failing, but the xml parser doesnt have any options to print out more detailed information. if you want to send me a core dll for 2.24.1 with some debug logging on the xml parser i can try that.

    The other option would be to send me just the xmlparser cs file privately and I can step through it.

    As always I am happy to help, or wait if needs be.
  • edited May 2019
    I'll do some tests with parsing your save file.

    Edit: Alright, seems like having a '-' in a scene name causes trouble ... or at least if it's used with spaces, e.g. '1 Town' is working but '1 - Town' isn't.
    Will fix this in the next update.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2019
    Ok cool, will test on my end and make sure this solves it. Weird that it works if i save before scene 3, but fails if i save after scene 4.


    Edit: Confirmed scene rename fixes the issue. Thanks for tracking that down!
    Post edited by mattehr on
Sign In or Register to comment.