Sub-Events not keeping parent instances

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Link to .capx file (required!):

    dropbox.com/s/9mnvmk80836ltjl/subEventError.capx

    Steps to reproduce:

    1. Create an object with a instance variable (buggy)

    2. Create an object that is destroyed quickly (destroyme)

    3. Create an event with the buggy object (is visible)

    4. Create a sub-event that causes the instance of buggy to spawn a new item (destroyme), and tells buggy to not spawn another with instance var.

    5. Create a second sub-event on the destroy of the (destroyme) spawned item. (have it reset the instance var)

    6. Place multiple instances of the main object (buggy)

    Observed result:

    buggy will spawn the destroyme object when it should not.

    It appears the destruction from instance #1 caused instance #2 to reset also.

    Expected result:

    buggy will spawn the destroyme object wait for it to be destroyed then spawn a new one.

    Browsers affected:

    Chrome: yes

    Firefox: ?

    Internet Explorer: ?

    Operating system & service pack:

    Windows 8

    Construct 2 version:

    r126

  • It appears the destruction from instance #1 caused instance #2 to reset also.

    Due to the way you've set your events and how events work, you're not doing any picking on event 3. So all the instances of "buggy" will be affected and have their variable "bombOut" set to false when any destroyMe object gets destroyed.

    You might want to keep a reference to the "buggy" instance that dropped the "destroyMe". (For example keep the UID of the "buggy" object as an instance variable of the "destroyMe" object)

    Your capx fixed.

    Is it the behavior you expect ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just realized the same thing. The first selector for my event never filtered out the other objects so my instance variable update affected all the of them.

    So yes, your code does fix the problem.

    --Thanks

  • Closing as not a bug.

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