Forum rules - please read before posting.

Save System restricted symbols

Hey, are there any restricted symbols or structures in the save file system? I've glanced at the code and I'm not sure about the save file parser. Basically what I'm trying to do, is to store a JSON string inside a single global variable, I haven't done the testing yet, but I was wondering whether that's a supported approach.

Comments

  • What format are save files written in? Json, XML or Binary?

    If the format of the file itself isn't also Json, then you should be OK. When serializing/deserializing save files internally, AC makes use of pipe and colon characters to separate data. However, instances of these characters in save data are converted "PIPE and "COLON" strings when saving, and back again when loading.

    The only thing you'd certainly have to avoid is an instance of two pipe characters in succession, i.e. "||".

  • edited March 2020

    Hmmm, then it seems words PIPE and COLON should be avoided as well?

    Also, what kind of JSON parser does AC use? Because generally from what I understand a JSON as a value field for JSON seems to be a supported feature.

  • Hmmm, then it seems words PIPE and COLON should be avoided as well?

    The autoformatting of my post affected its display. The words themselves are fine to use - the replacement includes asterix characters (*) around them.

    what kind of JSON parser does AC use?

    AC's Json format handler simply uses Unity's built-in JsonUtility class - you can see its implementation in FileFormatHandler_Json.cs.

  • Have you considered parsing with escape symbols, so that no string sequence ends up off-limits?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.