OnStartOfLayout trigger while executing offical load action

0 favourites
  • 4 posts
From the Asset Store
Game Triggers is as versatile as a Swiss army knife, and will be a great resource for any type of game you're creating.
  • 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

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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. )

  • Changed for the next build.

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