- Home /
Question by
MrMadGameplay · Nov 13, 2012 at 11:54 PM ·
saveloadautoserializer
input .lzma too short
Hi everyone, I'm using the Unity Serializer pack and I tried finding help on the offical website but I couldn't find anything. At the moment I want my game to auto-save on exit and auto-load opon starting the game, but I get this really annoying error and I was hoping someone would be able to help me with it.
here is the error:
Exception: input .lzma is too short
SevenZipRadical.Compression.LZMA.SevenZipRadicalHelper.Decompress (System.Byte[] inputBytes, ICodeProgress progress) (at Assets/Plugins/whydoidoit.com/7zip/Compress/SevenZipHelper.cs:178)
CompressionHelper.Decompress (System.String data, ICodeProgress progress) (at Assets/Plugins/whydoidoit.com/7zip/Compress/SevenZipHelper.cs:96)
LevelSerializer.LoadSavedLevel (System.String data) (at Assets/Plugins/whydoidoit.com/Serialization/LevelSerializer.cs:842)
CoinSaving.Start () (at Assets/UnitySerializer/Scripts/CoinSaving.js:11)
Here is my code:
#pragma strict
var Hasitstarted : int = 0;
var levelData = PlayerPrefs.GetString("_PAUSE_GAME_","");
function Start () {
Hasitstarted = PlayerPrefs.GetInt("Playedbefore");
if (Hasitstarted == 1)
{
LevelSerializer.LoadSavedLevel(levelData);
Debug.Log("Loaded");
}
}
function Update () {
if (Input.GetKeyDown(KeyCode.Escape)) {
PlayerPrefs.SetString("_PAUSE_GAME_", LevelSerializer.SerializeLevel());
Hasitstarted = 1;
PlayerPrefs.SetInt("Playedbefore", Hasitstarted);
Debug.Log("Saved");
}
}
Comment
I did respond on the US forum - I could do with knowing what the first 20 characters of your level data string.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Unity Serializer: How to load last save 1 Answer
Scene Saving 1 Answer
Remembering the state of a scene 1 Answer
Implement save and load option in a game 2 Answers