OnStartOfLayout trigger while executing offical load action

Bugs will be moved here once resolved.

Post » Thu May 21, 2015 10:30 am

Problem Description
OnStartOfLayout trigger while executing official load action

Attach a Capx
https://onedrive.live.com/redir?resid=7 ... ile%2ccapx

Description of Capx
Click, it would do saving, then go to next layout, then do loading

Steps to Reproduce Bug
  • (layout1) Print "Start L1" from OnStartOfLayout trigger
  • (layout1) Click ( touch) to do saving
  • (layout1) saving complete, got to layout 2
  • (layout2) Print "Start L2" from OnStartOfLayout trigger, then do loading
  • (layout1) Print "Start L1" from OnStartOfLayout trigger

Observed Result
OnStartOfLayout is triggered while loading. (Print "Start L1")
In the source code, OnStartOfLayou event will be fired while layout start, include official loading.

Expected Result
OnStartOfLayout (Print "Start L1") should not be fired while loading, imo.

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

Operating System and Service Pack
window7, 32 bit

Construct 2 Version ID
r204
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Tue May 26, 2015 10:19 am

I can reproduce, but it doesn't appear to be a regression so I won't do anything before the next stable release which is due soon.

However I'm not sure it's really a problem in practice: it fires 'On start of layout' to switch to the correct layout just before actually loading the savegame state, so anything the 'On start of layout' event does should be reverted by the subsequent loading. Is this a problem for a real-world project of yours?
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464

Post » Tue May 26, 2015 10:39 am

@Ashley


You are right, status will be reverted by the subsequent loading, except non-saved status.

For example, to count the playing time of this level:
Designer might increase playing counter which saved in localstorage/post to server while starting this level by "On start of layout".
When player continues the game by loading status, the playing counter will be increased again. It might be a problem, imo.

( Or private variables changing in sprite with no-save behavior... etc. )
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Fri Jun 05, 2015 12:56 pm

Changed for the next build.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests