How do I pick a Tiled Background from its family?

0 favourites
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • mrmlabs

    First, to clarify about Families : all objects in Families inherit instances variables, ex, 2 objects in fades family, and 2 instances variables (named so, Family instance variables) :

    So if select 1 fade item, it have it's own instance based on family (that's [fades] mean)

    So the question is, how do i get player_1 or player_2 to appear based on that global variable.

    Hope it makes sense.

    Yep! My better idea : your global var store the player.UID, and so you can Pick family instance by player.UID (your var)

  • mrmlabs

    First, to clarify about Families : all objects in Families inherit instances variables, ex, 2 objects in fades family, and 2 instances variables (named so, Family instance variables) :

    So if select 1 fade item, it have it's own instance based on family (that's [fades] mean)

    > So the question is, how do i get player_1 or player_2 to appear based on that global variable.

    >

    > Hope it makes sense.

    Yep! My better idea : your global var store the player.UID, and so you can Pick family instance by player.UID (your var)

    Great idea. But how do i do that selection? What actions do i need to put in the event sheet?

  • Quick & Dirty : On click, change the current player, call a method to move it, that's all ^^/

    Ex. file dropbox.com/s/dwvp9zrgggb50vm/Player_selector.c3p

  • Thank you for this Nicolas....but it seems when i am trying to get the UID from that object is returning 0.

    Do you know why is that happening?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think i know why i might not see that UID. Because the player selection happens in a different layout.

    Any idea how do i go around this?

  • Will it work if i make them global? Is there a better way?

  • Making both object in the family global did not do anything :(

  • construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features

    IDS

    Most objects also have two kinds of IDs: a unique identifier (UID), and an index identifier (IID). You can > read more about these in the section on instances.

    You cannot have an UID at 0… you can check in the editor, each Sprite have an unique UID;

    You pick the Sprite.UID, not the Family.UID?, then

    Family (ie from a set of objects in the Family) pick (an unique) object with UID

    Did you include Event Sheet which contain the global variable?

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