Not Creating Object On Start of Layout

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Problem Description

    "Create Object" action not working upon start of layout.

    Attach a Capx

    https://drive.google.com/file/d/0B1WHy6HMPuyoMWY2Yk0wbmtzaWc/view?usp=sharing

    Description of Capx

    Capx contains 2 layouts and 1 event sheet. The "Object Repo" layout contains a single object called "global". The "Loading" layout contains no objects, and is tied to event sheet "ES Global". The "ES global" event sheet contains a single event that creates a "global" object upon the start of the layout.

    Steps to Reproduce Bug

    • Run preview of the "Loading" layout

    Observed Result

    No "global" instance is created.

    Expected Result

    An instance of the "global" object should be created.

    Affected Browsers

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

    Operating System and Service Pack

    Windows 8.1

    Windows 7

    Construct 2 Version ID

    r211

    Note: This issue does not appear in r208. I rolled back just to confirm.

  • You must load your <Object Repo> layout before using global objects defined on it.

    Create an event sheets and do this:

    From the Construct2 manual about Global Object:

  • phimaka

    That may be a workaround for the capx I posted, but that doesn't resolve the issue. The issue persists even if the object's global flag is set to "No". Using a create action should create an instance regardless of whether the object is global. In the workaround you provided, the correct result should be 2 global objects.

    Also, since this doesn't occur on r208, I'm guessing this was unintended behavior introduced in one of the last few betas.

  • Closing as by design.

    Previously the 'loader layout' option (which your .capx has set to "Yes") was ignored in preview mode, and only had effect after exporting. The latest betas enable loader layouts in preview mode. A limitation of loader layouts is that you cannot create any objects from other layouts until the loading has finished (reached 100% progress) - otherwise it would have to load the entire project to display the loader layout, defeating the purpose of the loader layout! In 'Start of layout' on a loader layout, it is certain that nothing from other layouts will have loaded. Therefore the event will not be able to create the object. In other words, the bug is in your project, and it would previously have only shown up after export, but now it shows up in preview mode too (which is useful, it helps you catch the problem sooner).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That makes sense. Thank you.

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