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
Operating System and Service Pack
Win10
Construct 2 Version ID
C2 r216 64b (Steam)