Saving games with custom names

0 favourites
  • 5 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • Hi

    I am brand new to Construct, but love it a lot! Is there a way to make and name savegame slots avoiding arrays? I am making an app for autistic kids where user (parent) creates and saves different picture boards.

  • You can

    That highly depends on your app.

    What do you mean by "Picture boards"?

    Are they just Sprites with different content?

    If it's as simple as that, you can create a dictionary and save the Dicitonary as JSON in a LocalStorage key.

    The advantage of LocalStorage is that you can have multiple Save slots, all renamed individually.

    But to really help you, I will need more information from you.

  • Are they just Sprites with different content?.

    They are exactly sprites with different content! One board contains 2 pictures (sprites) "first and then". "First" - is that the child has to do first, for example - clean his room (and there will be a timer for it). "Then" is what he gets for it, for example - "a candy" or he can "play games".

    Parents create boards, pick pictures from their camera, name each picture and set timer for the first one. Then I need need to figure out the easiest way for saving each board either with custom name or the name could be "<first picture name> + <second picture name>"

    Thank you for the tip, I am going to learn about Dictionary and JSON now

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for explaining your project!

    Sooooo, the way I would do it, is this:

    Since Construct 2 comes with no built-in way to export the content of a Sprite, I'd recommend using this plugin.

    It comes with has two important things:

    • An .imageUrl expression that returns the image
    • The action Load image that works similar to the Load from image URL in a Sprite, thus, accepting what has been returned by the .imageUrl expression

    Now, how do you use this for your project?

    The first steps stay the same.

    When taking a photo, you simply load the Paster object with the image from the photo and so on.

    Now, the important part: Saving all the image boards, plus text.

    I would use an Array for this, where each line represents a board and each column stands for different parts of one board, e.g.

    • picture1, containing the imageUrl of the first image, same for picture2, just for the second pic.
    • firstTxt, containing the subtitle for the first pic
    • ThenTxt, subtitle for last pic
    • timer, containing the initial time

    You see where this is going.

    When creating a board, I would give each important object a value representing its board index.

    This will be useful when saving, since you can then loop through all the boards.

    In the loop, you fill the Array, using the loopindex as the Y index in the Array.

    When the loop is complete, you can export the Array and its contents with the .AsJSON expression.

    I would use LocalStorage to save it.

    If you have any questions, please ask. If I find some free time, I will try to create an example .capx for you.

  • randomly, thanks a lot! I would figure it out by myself for quite a bit. The project sounds a bit more challenging then I expected, but it makes it more interesting

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