Family picking. One works and one doesn't?

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • I have a confusion. I'll explain (see image below).

    allsprites.spritegroup is a variable for the allsprites family and each one is set specifically (for example, I have "Scenery" sprites, "Death" sprites, "Platform" sprites, etc..)

    allsprites.keynum is a variable for the same family, also set specifically (so I can have Scenery 1, Scenery 2, Death 1, Death 2, etc..)

    LastSprite and LastChosen are variables that update when you push a hotkey or roll the mouse wheel.

    My confusion is that, the set cursor action you see here works perfectly. If I push the scenery hotkey, I get scenery if I push the number, it changes accordingly and so on for all the others.

    But if take out the cursor change and try to create the appropriate sprite (the disabled action), it just chooses any sprite at random, completely ignoring my variables. (yes, I know I need to destroy the previous one for it to update properly like the cursor, this is not the issue, though. It's simply ignoring my variables or my picking or both.)

    What's the difference?

  • There is no way to pick which sprite gets created when Create is called on a Family. This has been discussed many times. You have to create each appropriate sprite.

  • Just seems strange that it can pick the right one for the cursor..

    All I want to know is "What's the difference?"

  • Set Cursor is aware of picked objects, object creation is not. If Construct made assumptions about what kind of object you want to create from a family, it could lead to confusion, thus it simply creates a random object. Honestly, I feel it would make more sense if you couldn't create an instance of a family object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set Cursor is aware of picked objects, object creation is not. If Construct made assumptions about what kind of object you want to create from a family, it could lead to confusion, thus it simply creates a random object.

    I see. Thank you for the explanation!

    Honestly, I feel it would make more sense if you couldn't create an instance of a family object.

    In that case, I'd have to agree with you.

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