Load assert, getObjectByUID and "wait until afterLoad()"

Discussion and feedback on Construct 2

Post » Tue Jul 19, 2016 10:47 pm

you use a lot of fancy terminology in this last post explaining your solution. I ran into a similar problem after trying to load a layout and in my case I'm picking UIDs because objects are connected in some way, like a head and a body. Would it be a viable work around if I did for example:

Global var x = 0
Parent on Created -> spawn child
->Parent - set instance var 'identifier' is x +1
->Child - set instance var 'identifier' is x +1
-> set x to x +1

where X is updated +1 after each spawn use so that it lets each family have a unique identifer that can be called when needed instead of by UID
Posts: 80
Reputation: 995

Post » Tue Aug 16, 2016 7:47 pm

This "bug" made me sad the whole day !
Happens when :
- I load a build (Json to array) with many elements (importing a "build" for my character in my game)
- Then after that, I load a savegame (usually in the same layout, it can be a savegame taken 3 second ago)

> this error occurs at every time.

or eventually if I play for a long time, filling my array, then reload a game ...

EDIT : So my thoughts are about the savegame too heavy or something, maybe because of the big array. If I understand well how C2 arrays works, clearing it won't make it smaller. So when I'm not using the array for import / export, I set its size to 0,0,0, then set its size to 17,28,10 when I need it only, and crush it after to 0,0,0 again. Since that, I didn't experience the "wait until afterLoad()" error ... yet ? I Hope this workaround will last...
Posts: 131
Reputation: 1,205


Return to Construct 2 General

Who is online

Users browsing this forum: mihirolover and 11 guests