Not Creating Object On Start of Layout

Bugs will be moved here once resolved.

Post » Sat Aug 08, 2015 4:14 am

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.
Last edited by zatyka on Sun Aug 09, 2015 2:51 am, edited 1 time in total.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Sat Aug 08, 2015 1:10 pm

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

Create an event sheets and do this:
Image


From the Construct2 manual about Global Object:
Image
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Sat Aug 08, 2015 3:30 pm

@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.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130

Post » Mon Aug 17, 2015 12:59 pm

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).
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Aug 17, 2015 1:08 pm

That makes sense. Thank you.
B
63
S
19
G
8
Posts: 341
Reputation: 12,130


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest