How do fix this save/load issue? (Objects being destroyed on load)

0 favourites
  • 10 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • So whenever I save using the System Save action, I can save/load fine initially.

    But Problem show after two points:

    ________________________________________

    On Loading after "fresh" launch of the game, game fails to load with:

    ________________________________________

    If I save, then move an object from one area (From my inventory to stash) then load.

    Loading destroys the object in the stash instead of moving it back to where it was (in my inventory)

    I have it trigger a sound when the object is destroyed for testing purposes.

    ________________________________________

    Both leads to triggering "On Load Failed" and a broken gamestate.

    > There is only one action that calls for these objects to be destroyed. If I disable that action, the game also fails to load but the objects are not destroyed but the game state is still broken.

    I have no idea what is causing this so if anyone's got any idea!

  • Ignoring the error, what is actually broken ? Is the game the same as when you last saved it ?

  • Any objects moved into stash or otherwise changed positions delete itself and several other objects reset visibility or lose child/parent and etc.

    And it's not 100% same each time in different configurations of errors after loads.

    It's got me stumped.

  • But you said you moved them to stash after saving ? Do you mean the inventory does not look the same as when you saved it, after a load ? Check your events like on start of layout and such that might delete objects.

  • Yeah the object would delete itself, while it should technically go back into my inventory.

    There is one event that destroys this specific objects and if I disable it, it fixes the item destroying part but makes the load fail like nearly 100 percent of the time for whatever reason.

  • Sounds like it might be related to this https://github.com/Scirra/Construct-bugs/issues/8118

  • I made a workaround instead of using hierarchy i saved the UID in the "parent" object as an instance variable, then pick the "child" by evaluation. So not using hierarchy fixes the crash as well as further loading related issues, but also means you will need to handle hierarchy related conveniences manually.

    Or just leave it as it is and wait for a fix.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok so you had an event that runs to delete that object so probably that's why it is deleted immediately after the load. What do you mean by load is failing ?

  • The Problem is that The action that destroys the obj should only destroy the object that's not in stash, inventory, or equipped.

    It just does it anyways haha

    I tested the instance variables extensively to see if they all correctly apply from being stashed, equipped, or in inventory.

  • That kind of sounds like what's happening as my stash adds the items dropped into it as a child.

    I'll try that evarede, thank you!!

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