0 Favourites

Inside/Outside of group

  • Hey,

    I got a little problem.

    I tried to implement a life bar.

    Everything works just fine, but if I put the whole events into a group, it stops working. The graphics animation does not change when the player leaves the layout. The rest of the code works, so after the 3rd time of leaving the layout, I get to the level selection screen.

    Global variables at top:

    <img src="http://s7.directupload.net/images/121227/vtad3j4z.png" border="0" />

    rest of the code in a group:

    <img src="http://s7.directupload.net/images/121227/pu28c9pe.png" border="0" />

    How to fix this?

  • Does no one know how to fix this?

  • I have no idea why that's not working. Tried it myself and I get the same result. The manual doesn't really cover events in groups like it does families and containers.

    Maybe the manual could get a more detailed description of what changes when events are in a group when Ashley has the time?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • May be a bug with objects created/destroyed inside a loop within a group. Look at this:

    I have 3 sprites.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/destroyLoopGroup1.png" border="0">

    The sprites are destroyed in event 2 and in event 3 Sprite.Count = 0.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/destroyLoopGroup2.png" border="0">

    Here the sprites are destroyed inside a loop and in event 3 Sprite.Count = 3. The sprites aren't destroyed until the end of the group.

    destroyLoopGroup.capx

  • It's not a bug, it's because created objects aren't selectable by other same level events until they are fully created, and they are not fully created until the next base level event. Since all of those events are in a group, the objects are not fully created until after the end of the group, therefore the events cannot pick the created objects.

    To fix it, just put the first event above the group, or don't create them every tick and toggle visibility instead.

  • Since all of those events are in a group, the objects are not fully created until after the end of the group, therefore the events cannot pick the created objects.

    @Arima r103.2 release notes:

    Separate triggers, and events in groups, are now treated as 'top level' when picking newly created objects.

    And it works but not when the object is created inside a loop. Then it can't be picked until the end of the group.

    This works. The sprite can be picked and it's angle is set to 45.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/createLoopGroup1.png" border="0" />

    And this doesn't. The angle isn't set. Only difference is the loop condition.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/createLoopGroup2.png" border="0" />

  • Oh, interesting, I either missed or forgot about events in groups being considered top level events. Sorry for the incorrect info. I guess it is a bug, then.

  • I created a topic in the bug report section. Thank you for your help!

  • Have you guys tried a "Pick all" system condition ?

    For Astrosus in the last event, on top of the "For each Hearts" and for ramones event 4.

    Does it change anything ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[PLUGIN] Instance Group
50 17,110
sagispin's avatar
sagispin
Unread hot topic
36 2,426
pyteo's avatar
pyteo
Unread hot topic
0 Favourites
Construct 2 Skype Group
34 12,765
Patriick's avatar
Patriick