How do I store multiple object's position, to be created later

0 favourites
  • 12 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • hello dop2000

    I am not able to reply on my old post How do I store multiple object's position, to be created later

    after year of this post. This method not working anymore. I mean data is saving but when getting back on another file then instance variable data not applying there. I thought it is bug but Ashley said

    It looks like you are loading JSON data that was saved from a different and incompatible project. The instance variable's internal IDs are all different, so it fails to find any and doesn't attempt to load them. Loading data from different projects is not supported.

    do you know anything about it. To remind you I was saving object's positions and variable data into json and then on other project i applied. It was working but now its not working.

  • Can you post your project file together with the json data? I can't help you without it.

  • files attached here

  • I can't add anything to Alshey's answer. You saved JSON in one project, you can't use it to restore another object's state in a different project. Even if the name of both objects is the same, their internal IDs are different.

  • Try removing Dot object completely from the second project, and then drag&drop it from the first project.

    If it doesn't help and if you really need to re-use all that JSON data, you can probably manually edit the IDs in project files. I don't know if this can cause any other issues though.

  • then how it is working in another file. i attached there 2 files. one is working and second is not.

    the working file was created long before when you did help me last year. If ids are different then how it is working there. because data was saved in another third file and then was imported into these files.

    btw i'll try your method

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The old (working) file was probably copied/cloned from the original (third) file. But in the non-working file you created a new Dot sprite, that's why its ID is different.

  • i have original (third) and i also tried to copy object from original file to new but still its not working.

    Edit: I also tried to change old ids into new in json file but it also not worked

  • Unzip the non-working project into a folder. Edit this file:

    \objectTypes\dots.json

    In line 11 change "sid" to this:

    "sid": 945835785233453

    After that it should work.

  • it worked thanks

  • method you said is working well and no problem but I have a question.

    when we save object's data asJSON then instead of changing "sid" in the dots.json I tried to change it in asJSON file. but there its not working.

    let me explain: we have 2 files "original" and "new". Original file, where we actually saving object's data and "new" file where we applying that data. I just did save data of object with same variable here in "new" file too so I can get its "sid" number. Then I replaced this number in "original" files asJSON data. It should work there but its not. Do you know any reason here why its not working here.

  • You should be able to change the id of this instance variable in AsJSON data to match the "sid" value in Dots.json

    It should work if you do it correctly and change all occurances.

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