Picking question (added cap file)

This forum is currently in read-only mode.
From the Asset Store
Customize the animation of character when item changed
  • I have 3 sprites: A, B and C all in a container. Sprites A and B are in a family called "blue." I have a condition that picks "blue" when it's private variable health=0. In a sub condition, I try to pick Sprite C when its private variable state<100, but it seems to pick every instance of Sprite C matching that condition, not just the ones where Blue=0 and C<100. I don't understand picking 100% but i think that should work...or is something wrong with that logic? I'll set up a cap if that explanation is confusing.

    Thanks for any help.

  • As far as I know, it won't work that way. Families and objects are on a separate level as far as the Selected Object List goes. To get the benefit of containers, you need to pick an actual object in the container. If you pick by family, then there is no container attached to the family itself.

  • Ah got it, thanks deadeye. For some reason I thought it picks the sprite in the family that matches the condition.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way containers work is if any instance in the container is picked, even via a family, the entire container is picked. This means it's actually not possible to pick one object in a container without picking the rest of the container, no matter how you do it. That's the intended way, anyway, there might be a bug. Posting a .cap always helps.

  • Hmm..then if i understand it correctly, the events I originally posted should work. I'm picking instance A via a family, then trying to pick instance C which is in a container with instance A. I'll post a cap when i'm home to see if it's a bug or not.

  • Oops, I guess I was wrong

  • NP deadeye

    There only seems to be a bug in my game, maybe some junk left over after saving in different versions of Construct. I set up a similar situation in a clean file in 99.4 and it works as expected, picking from the family and then picking the instance in the container.

    I'll just recreate the families and containers in my game and hopefully that will fix it.

  • Well after not being able to get this working in my game, i set up another file and the picking doesnt seem to be working.

    Here is the cap: http://www.louisferina.com/games/families.cap

    The 2 blue sprites are in a family "blue". The red square is in a container with the blue sprites.

    Left clicking will spawn a bullet traveling to the right. When it hits the blue sprites, it deletes the red square which will also delete the blue sprites in the container. One container of sprites should remain but for some reason both get deleted. I think that's a bug.

  • I think I've encountered the a similar problem (so I think) with families and containers.

    I have families A,B,C and D and want to always set the positions of B,C and D to the position of A. Objects of the from families A,B,C and D are always grouped in a container.

    When I first tried this objects from different containers were positioned together in a mixed up manner (however still one object of family A,B,C and D each).

    However changing the Z order seems to solve this problem. I just made sure that objects in the same container are directly subsequent to another.

    It's a bit of a hack, but it could help people who have similar problems to the one I had.

    Families and containers have difficulties with one another.

    (I'd still like an object that could have other objects as private variables...)

  • I thought those were new posts by deadeye, where is that man!?

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