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
  • I have 5 Tiled Backgrounds and put them in Family. Now I want to insert one of them through action.

    How can i do this. I don't want to do this with normal Sprites.

    please help.

  • Put them all in a family.

    System action - Create family object.

    Create object

    Create a new instance of an object type on a layer at a given position. If a Family is chosen, a random object type from the family is picked, and an instance created for that.

  • I don't want to pick randomly, I want specific Tile Background.

  • Then select the specific tiled background you want when creating the object...

  • im also interested in this as i recently switched to families and i have problems understanding how it all works.

    I have a character selection layout from which you select the game character you want to play with.

    before i added both characters (sprite objects) in the "player" family, i used to have separate event sheets and layouts for each, and in each event sheet i had all the events on that sprite object (jumping, shooting...etc)

    What i want now si that once i select the character i want to play with between the two, to only have to apply all the events and actions i had before on the individual object to be applied on the selected family object.

    How is that possible.

    I created a global variable called player which is 0 initially and when you select a character it either gets the value 1 or 2.

    And then i want a specific object from the family to be used when the family is referenced in all the evenst and actions.

  • Families can be used for picking. When you set the global variable to 1 or 2, create and set an instance variable in the player object to 1 or 2 as well. Then you can use the family - compare instance variable = global variable, it will pick the chosen object.

    Although if it is the only existing instance or object in the family on a layout, using the family will only pick that one by default anyway.

  • I have worked a lot of things with single Tiled Background and everything I want with other tiled backgrounds too. So I don't want to copy paste many times that events and it cannot be used with Functions because i already used functions many times there So It will never be used to reused events.

    Note: I never used Tiled background for Background Purpose. I used it for some other purpose.

  • Families can be used for picking. When you set the global variable to 1 or 2, create and set an instance variable in the player object to 1 or 2 as well. Then you can use the family - compare instance variable = global variable, it will pick the chosen object.

    Although if it is the only existing instance or object in the family on a layout, using the family will only pick that one by default anyway.

    I did use this method but this method always creates a random object

  • I wasn't answering you with that post lucky. If you want to create a specific object, just create that object directly instead of selecting the family.

  • the problem is I am using Tile Background (not using it for background purpose) and I have multiple Tiled Backgrounds from which i want to choose a specific Tiled Background.

    Edited: Construct 3 have given some new features in Tiled Backgrounds Which i am using mainly.

    Offset x/y and Image scale x/y

  • Okay I have found a way to created specific Tiled Background.

    Thanks

  • oosyrag - Amazing explanation. Thank you so much.

    Can you tell me a bit more on how i do this:

    "Then you can use the family - compare instance variable = global variable, it will pick the chosen object."

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use "Create object named…" and then call System > Pick last created object from Family

    Excerpt from my project to create background "on the fly“ :

  • You can use "Create object named…" and then call System > Pick last created object from Family

    Excerpt from my project to create background "on the fly“ :

    Not sure that answers my question.

    So at the moment i have a family object called "player" in wich i have 2 sprite objects "player_1" and "player_2"

    "player_1" inside the family has an instance variable - selected_player = 1

    "player_2" inside the family has an instance variable - selected_player = 2

    The family itself doesnt have an instance variable set - as i dont know if the individual object from the family needs to have the instace varibale or the family itself.

    I also have a global variable called selected_player = 0

    When you select player1 from the character selection layout i set that variable to 1 or 2 based on the selection.

    At the start of the game layout i create the player object and place it at specific coordinates.

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

    Hope it makes sense.

    At the moment they show up randomly.

    Thank you so much!

  • You can use "Create object named…" and then call System > Pick last created object from Family

    Excerpt from my project to create background "on the fly“ :

    Sorry Nikolas , you were probably answering Lucky's question.

    So sorry again for jumping on this question as i thought its very similar to my problem.

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