Save & Load Test

This forum is currently in read-only mode.
From the Asset Store
Soldier Test
$9.99 USD
A Construct version 2 & 3 "Stand-alone" RPG game with "In-Game Module" (IGM) integration.
  • Here is the .cap: rapidshare.com/files/625898342/Save%20Load%20Test.zip

    Using Deadeyes ISO .cap, I'm trying to do a Save & Load Test using the Save & Load function. Here is what's happening:

    Layout 1

    In the first layout, the black rectangle loads a save when you click it, and when you click on the red rectangle it makes a save of the positions of the objects you drag and drop inside the layout and carries it over to the next layout. So in a way, this acts like a layout editor at runtime.

    Layout 2

    In this layout, anything you drag and drop is meant to be temporary, and when you go back to Layout 1 all the positions of the objects should be back where you originally left them in Layout 1. So essentially, this is trying to make Layout 2 a runtime... at runtime :-) but the problem is...

    -When I click on the blue rectangle to take me back to Layout 1, it goes back to Layout 1 but the objects retain the positions made in Layout 2. The positions in Layout 2 were only supposed to be temporary.

    -When I click on the black rectangle to load the save, it's supposed to start on Layout 1, but it jumps to Layout 2. The only thing that goes right is that it saves the correct positions, it's just that it puts them in the wrong layout! :-(

    Two more things

    Does anyone know what the file type of the save file is? I'm on XP and the file type doesn't show, it just says "file" under file type.

    AND...

    Does anyone know which plugins don't work with the Save & Load function? I haven't encountered any yet but I read that some plugins don't Save & Load.

  • <img src="smileys/smiley19.gif" border="0" align="middle" />

    Anyone?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • When I click on the blue rectangle to take me back to Layout 1, it goes back to Layout 1 but the objects retain the positions made in Layout 2. The positions in Layout 2 were only supposed to be temporary.

    The objects are global so they keep the same position from layout to layout. You could try to reload when you go to layout 1.

    When I click on the black rectangle to load the save, it's supposed to start on Layout 1, but it jumps to Layout 2. The only thing that goes right is that it saves the correct positions, it's just that it puts them in the wrong layout! :-(

    This makes solution 1 not work, so I would say this would be a good situation to do your own save/load system.

    oes anyone know what the file type of the save file is? I'm on XP and the file type doesn't show, it just says "file" under file type.

    It's a Construct game state file, only readable by the game that made it.

    oes anyone know which plugins don't work with the Save & Load function? I haven't encountered any yet but I read that some plugins don't Save & Load.

    Only the sine behavior comes to mind.

    There are examples elsewhere on the forum of custom save and load, the S plugin can be helpful in this aspect.

    Here is a simple save/load that will work for your example:

    http://dl.dropbox.com/u/5426011/examples15/simple_save_load.cap

  • Hi Rojo,

    Thanks for tackling this!

    The objects are global so they keep the same position from layout to layout.

    Yeah, that's exactly what I want it to do, with the addition of being able to have the objects return to the previous positions they were in in Layout 1.

    You could try to reload when you go to layout 1.

    Do you mean manually, or through events?

    When I've tried it manually the program just sends me to Layout 2 when I click the black loading button. When I've tried to do it through events where I try to get a load and a layout jump at the same time, the program refuses to do either and I'm stuck on the same layout :-(

    I really need it to reset automatically, but I figured that if I can't at least get it to stay on Layout 1 when I click load there is no reason to even try tackling the auto load function yet.

    This makes solution 1 not work, so I would say this would be a good situation to do your own save/load system.

    I created an .ini Save/Load system last year, it worked great. But my hard drive crashed since then and I no longer have the old file. To make matters worse, I can't even remember how I did it, lol :-(

    The other thing I worry about is how the system will handle loading and saving duplicate sprites like how you'd have a lot of when laying ground tiles for a platform game. The save/load function in events would obviously do it naturally but I'm not sure of how to go about it using an .ini save system. If I can do it like a level loader where sprite positions are read from the .ini file at runtime then that would take care of positioning at least, but I forget how to save plugin parameters and such.

    It's a Construct game state file, only readable by the game that made it.

    Right, but I was trying to find out what the file extension is. I can't find it.

    Here is a simple save/load that will work for your example:

    http://dl.dropbox.com/u/5426011/examples15/simple_save_load.cap

    Yeah, I could already do that with my current setup if I only use one Layout. I actually originally did that, but I need two layouts; one to use as an editing board, and the second to use as a fake 'runtime' of the editing board.

  • It's a bug that it goes to the second layout when loading. That's why it's a good idea to do your own save/load system. You can use my example for any layout, just include the events in each layouts event sheet and change the "on button clicked" events to "on loop" events so you can call the save/load event from anywhere with the "Start loop" action.

    When you go back to layout 1 reload with events so the changes from event 2 are discarded. The save files the save/load actions use have no extension.

  • Ah. Thank goodness it's just a bug. I wasn't sure at all.

    I'm going to do what you said. I was at first going to try making an .ini save system again, but I don't see a way to properly send and receive info between the .ini and cap/exe for multiple duplicated sprites unless there were a way to have each duplicate sprite count itself as a unique sprite. I remember there being a plugin for unique sprites, but I'm not sure if that would be something to solve the issue or not. I'll have to check that out.

    Thanks again, Rojo!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)