Destroy an object on start of layout consequences

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Say your layout has an object. In your event sheet, you destroy that object first thing. Then you create some new objects based on that object. What, if any will the consequences be, if any? Erratic behavior? Nothing? I know that the object will successfully be created and manipulated, but while I'm trying to work out bugs, I want to make sure I didn't create any by doing that. Also, I realize that the IIDs and UIDs may change due to this action, just as they would if I destroyed any other object.

  • Nothing unexpected. Doing it that way is pretty common and useful.

    Only thing you may run into is if you have "On Created" events for that object. As "On created" will trigger on objects before they are destroyed "at start of layout".

  • I usually have an objectdump layout where I put all the objects I'll need later but don't want existing to begin with. That way C2 has an instance to referance, and any On Created/Destroyed events won't involve it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I usually have an objectdump layout where I put all the objects I'll need later but don't want existing to begin with. That way C2 has an instance to referance, and any On Created/Destroyed events won't involve it.

    This is a good idea. I do this as well. Makes it easy to keep track and organize. As well as avoid the instance must exist on some layout issues. for whatever silly reason I always end up calling it my ZooLayout.

  • Ahh, great idea! By putting my 'prototype' instance of the object I'm working with in a different layout, it is not getting involved in any of the stuff I'm doing with subsequent instances. I was not looking forward to making each event screen out the prototype's UID.

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