Come here if you create saves from beta

  • china-richway2
    9th Nov 2013 Member 0 Permalink

    If you accidentally forget that you cannot save files from a beta version, you can follow this post to publish it if you don't use any new features or new elements in the beta version. If you used, you'll has to wait for next version to load it, or remove them.

    1.Unpublish your save and download it as a cps file. Then rename it convert.stm.

    You can also save as a stamp and rename the stamp convert.stm.

    2.Copy those code:

    Function ReadBinary(FileName)
    Dim Buf(), I
    With CreateObject("ADODB.Stream")
    .Mode = 3: .Type = 1: .Open: .LoadFromFile FileName
    ReDim Buf(.Size - 1)
    For I = 0 To .Size - 1: Buf(I) = AscB(.Read(1)): Next
    .Close
    End With
    ReadBinary = Buf
    End Function
    Sub WriteBinary(FileName, Buf)
    Dim I, aBuf, Size, bStream
    Size = UBound(Buf): ReDim aBuf(Size \ 2)
    For I = 0 To Size - 1 Step 2
    aBuf(I \ 2) = ChrW(Buf(I + 1) * 256 + Buf(I))
    Next
    If I = Size Then aBuf(I \ 2) = ChrW(Buf(I))
    aBuf=Join(aBuf, "")
    Set bStream = CreateObject("ADODB.Stream")
    bStream.Type = 1: bStream.Open
    With CreateObject("ADODB.Stream")
    .Type = 2 : .Open: .WriteText aBuf
    .Position = 2: .CopyTo bStream: .Close
    End With
    bStream.SaveToFile FileName, 2: bStream.Close
    Set bStream = Nothing
    End Sub
    Dim Buf
    Buf = ReadBinary("convert.stm")
    Buf(4) = 0
    WriteBinary "convert.stm", Buf

    Save into a vbs file. Copy convert.stm to the same folder and run this script.

    3.Open convert.stm and publish it.

     

    [to developers]

    GameSave.cpp:458

    throw ParseException(ParseException::WrongVersion, "Save from newer version");

    But you can still load it, and all the new elements are just recognized as empty. I think we should remove this line, and check it in GameSave.cpp:823 instead.

  • jacob1
    9th Nov 2013 Developer 0 Permalink
    you could also use http://mniip.com/misc/reversion.lua , which will work on all os's and is probably a little easier to use. Also how does this convert to a release version? what version does it save it as?

    We don't even have a beta right now, interesting timing lol.
  • china-richway2
    9th Nov 2013 Member 0 Permalink

    @jacob1 (View Post)

     It just modifies the major version to 0. Then you can open it.

    I said, the new elements are recognized as empty, that's all.

  • mniip
    9th Nov 2013 Developer 0 Permalink
    @jacob1 (View Post)
    reversion.lua is a bunch of hax though, my lci barely parses multipart form data, might break on some tricky browsers
  • MiningMarsh
    9th Nov 2013 Member 0 Permalink

    Here is a C version for linux users/windows users with a compiler:

    http://server.triclops200.com/MiningMarsh/powder-save-convert.c

     

    Does the same thing, just changes byte 4 (indexed from 0, is the version) in the file to 0.

     

    EDIT:

     

    Changed it to ask you what version to set the file to. Little better then always setting to 0.

    Edited once by MiningMarsh. Last: 9th Nov 2013
  • EE
    9th Nov 2013 Banned 0 Permalink
    This post is hidden because the user is banned
    Edited 3 times by EE. Last: 9th Nov 2013
  • jacob1
    9th Nov 2013 Developer 0 Permalink
    changing the version byte to 0 is a bad idea. While maybe it wouldn't open in the beta before, it now won't open in every single version except for the latest release, because of changes in the save format. The version is supposed to tell the game if it can open it ... Why not change it to 89 instead and make the game happy? lol

    Alternatively, if you want something really easy to use, and that will in most cases work without even being updated, try using my mod. It can always open beta saves, and it will save them as the release version if possible. It has proper checks to make sure you don't save things you shouldn't. Just put it in your tpt folder and resave any saves / stamps you need to using it.
    Edited once by jacob1. Last: 9th Nov 2013
  • mniip
    9th Nov 2013 Developer 0 Permalink
    @EE (View Post)
    holy crap it's eyes
  • boxmein
    9th Nov 2013 Former Staff 0 Permalink
    And here's a technically working one in brainfuck:
    theabove.bf:
    +[,+>][<]>>>>>[-]+<<<<<[>-.]
    // NOTE: requires a brainfuck interpreter for which values can go over 255 !!!
    $ cat mybrokensave.cps | bf theabove.bf > myfixedsave.cps

    Its only prerequisite is that you need a brainfuck executable that stores grid cells in larger values than chars (8 bytes)
    Edited 9 times by boxmein. Last: 9th Nov 2013
  • EE
    9th Nov 2013 Banned 0 Permalink
    This post is hidden because the user is banned