Load assert: UID lookup during object creation in transition

Bugs will be moved here once resolved.

Post » Thu Nov 05, 2015 9:05 am

Problem Description
This bug report relates to the following thread : load-assert-getobjectbyuid-and-quot-wait-until-afterload-quot_t163350
Performing an UID lookup in "on created" triggers during layout transition fires an assert "Do not call getObjectByUID in loadFromJSON: wait until afterLoad() to look up"

Attach a Capx
https://dl.dropboxusercontent.com/u/526 ... ssert.capx

Description of Capx
2 layouts, a "menu" and a "game level"
Menu : Space to go to the "game level" layout ; F9 to load a game state
Game level : 3 entities : ground, player, pickup. I'm not too sure if/how object creation/destruction works with game states, so having a player being able to collect pickups provides a quick way to "collect" some of the entities and try different "save/load" configurations. On creation, the pickup entity performs a UID lookup (pick by UID) with triggers the assert

Steps to Reproduce Bug

  • Menu, press "space"
  • Game, press F6 to create a save state
  • Restart the game / reload the page
  • Menu, press F9 to load the save state > an assert is triggered

  • Menu, press "space"
  • Game, press F6 to create a save state
  • Restart the game / reload the page
  • Menu, press "space"
  • Game, press F9 to load the save state > the assert is NOT triggered

Is seems the assert fires only during layout transition.

Expected Result
The assert seems to have no impact ; the event logic seens valid, therefore the developer expects no assert

Affected Browsers
  • Chrome: YES

Operating System and Service Pack

Construct 2 Version ID
C2 r216 64b (Steam)
Game Producer & Independent Developer - http://raphaelgervaise.com
Posts: 244
Reputation: 2,246

Post » Thu Nov 12, 2015 2:45 pm

Thanks, should be fixed in the next build.
Scirra Founder
Posts: 25,279
Reputation: 200,817

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest