TPT++ code

  • mniip
    14th Oct 2012 Developer 0 Permalink
    TPT++ code is so confusing @-@ I tried to find anything that can load a .cps file, but all methods such as GameSave::read are listed private, are there any public methods that can parse .cps'es?
  • plypencil
    14th Oct 2012 Member 0 Permalink

    Quickest fix would be to just duplicate the required code?

  • mniip
    14th Oct 2012 Developer 1 Permalink
    Em no
  • jacob1
    14th Oct 2012 Developer 1 Permalink
    It looks like it does:

    SaveFile * saveFile = new SaveFile("filename");

    then

    gameModel->SetSaveFile(saveFile);

    and that should load it. There's functions in simulation.cpp to save/load stamps too. tpt++ loads saves in a very strange way, some stuff is loaded outside of the load save methods (like in simulation). There's expanded and collapsed saves (I don't really understand how that works), and it seems like a lot of the saving code has to be called a few times just to load or save one thing, and also to render it.
  • mniip
    14th Oct 2012 Developer 0 Permalink
    nope, tried that already, it segfaults
  • jacob1
    14th Oct 2012 Developer 0 Permalink
    What happens then? Does at least the first line work? Maybe some more code is needed after or something.
  • mniip
    14th Oct 2012 Developer 0 Permalink
    maybe im creating GameModel incorrectly, anyways get on irc
  • jacob1
    14th Oct 2012 Developer 0 Permalink
    I can't right now. I might be able to in a few hours but probably won't. I'll wait until tomorrow to get on.
  • mniip
    15th Oct 2012 Developer 0 Permalink
    Okay, i talked to Simon, he explained me everything
  • jacob1
    15th Oct 2012 Developer 0 Permalink
    @mniip (View Post)
    Ok, what did he say then? I want to know what was wrong with what I did, I don't really understand the save code enough. I looked on your log.lua and didn't see anything