Object Persist On Change OF Layout

0 favourites
  • 6 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Problem Description

    ok, so a while back did a layout template for my future games, its nothing more then a new game template just with a menu setup already, so i use it for all my future games, not having to repeat the process each time, so the problem is that, either i got a bad glitch, on the capx itself, or something is up with 1 of the objects.

    when i create a new game using this template, i dont have no problems on beginning, but once i switch layouts, not from menu to game, but from game to menu when an object is destroyed, some objects persist on screen, and are spawned on menu also, even though all plugins and objects are not global, and the layouts dont have any force texture on it, it happens every time im adding more then 10 objects or i dont know, if im doing a new capx, everything is ok, if i use under 10 objects in game layout, then switch to menu is all ok, but then if i add more objects the glitch happens, so either is my c2 corrupted since i switched from r205.2 to r206 and then backwards cause started to act funny once i updated the version. now this capx is made in beta r205, but even if i install r206 is still doing it, and not only that is doing a lot weird things (such as, platform behavior fails on collision, physics behavior also, even though im using bullet settings for better collisions, something is up with save/load also, if you save a file then choose to load it, the global variables, instead of loading the saved state, it adds to its variables the content of the save file, something is going on with save load, since the deprecation of WebStorage it seems to save automatically even if you dont have the object added and so on) if id be to do a bug report for all id be reported for spam, so i choose to remain under r206, because r206 creates to many problems for me!

    so in the end im not sure what is the real problem of the capx, or the glitch, all i know is that some items persists on screen, and c2 acts funny all the time lately. can it be a updated wrong file not getting written or something on the c2 version i have? or is it a real serious problem?

    i think il downgrade to r202 since it wasn't a creating big problems for me back then, and see if the problems are still persisting. if not il have to delete all my custom plugins try it with a clean version r206.

    Attach a Capx

    Download capx <initial menu layout i think i added a few objects in game layout..

    Download new game using the layout above

    Description of Capx

    1st capx is the layout im using for new games it should have the menu setup and thats it, and some objects in the game layout but nothing big, seems to have a saving behavior action, or something that saves and makes items persisting,

    2nd capx is a small game im working on for amusement, it will make the glitch even more annoying

    capx files are made in 206 and downgraded to 205.2

    Steps to Reproduce Bug

      Using capx 1
    • Step1 create any short game with it
    • Step 2 place a condition if game over to switch from layout game to layout menu
      Using capx 2
    • Step1 play the game when you shoot the bomb in the net you should be switched to menu and some objects that are from game layout will persist.

    Observed Result

    items persist on screen in capx2 on switching between layout game to layout menu

    Expected Result

    switch to layout menu all items to be as it is in the initial state, not being there, just the ones that are supposed to be.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    win7 ultimate service pack1

    Construct 2 Version ID


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is a 'feature' of c2 - the engine has no way of knowing if the objects are destroyed at the end of the layout or because events have commanded them to be destroyed some other way, so any On Destroyed trigger that creates another object could cause a problem at the end of the layout because they will create at the start of the next. The way around it is simple enough - just have a game mode variable to control the game's mode of play; if the mode is set to "going to menu" or similar then don't permit the On Destroyed trigger to be accessed. There have been a few bug reports similar to this one in the past (example: ) - it's nothing to sweat but you do need to be aware of it so you don't get caught out....!!

    Ashley, this seems to get posted as a bug with some regularity. I couldn't find a specific reference to it in the manual; perhaps you could consider adding a one-line explanation on this page alongside the On Created description?

  • Colludium oh dident knew this is already a known one, so that's why was acting like that, saving or creating let me see if i disable on destroy at end, if acts the same, cause now it makes sense, the issues i had lately!

  • This comes up regularly. I think even though it makes sense from the perspective of the engine, everyone actually expects that 'On destroyed' should not fire when changing layout, which also solves the problem of what to do when creating objects when ending a layout. So the next beta experimentally does not trigger "On destroyed" when changing layout. We'll see how it goes!

  • ^^ Gulp....

    Actually a good idea

  • awesome !

    Thanks for the prompt responses!

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