How do I create a sprite on a specific sprite of a family?

0 favourites
  • 14 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello,

    I have a family "miniature" who group all the picture of my levels.

    When a level is done, it changes the value of an array.

    What I want is to create a sprite "fini" on the level miniature who are done.

    I create a specific point of image in each miniature.

    My question is I strugle to find the right typo to create the level on the miniature.

    Can someone help me please?

  • Hi mathie

    I cant see you doing any Picking for the "miniature"

    You need to pick the level miniatures who are done and that match the Array miniature Info that is stored, then you will be able to spawn the "Fini" object on their image points

  • tarek2 thanks for your answear,

    So it's more like something like this?

    Because "fini" object only spawn in the first miniature.

  • tarek2 thanks for your answear,

    So it's more like something like this?

    Because "fini" object only spawn in the first miniature.

    Np

    Yes exactly, That's whats happens when you don't pick on the conditions as Construct doesn't know which object you are referring to so it will Pick the Default one (ID = 0) which is the first "miniature" created

  • But there is still the problem. It only create on the first miniature.

    As I input a local variable who is the same +1 as the position in the array, it should works, no?

    What I did wrong?

  • But there is still the problem. It only create on the first miniature.

    As I input a local variable who is the same +1 as the position in the array, it should works, no?

    What I did wrong?

    Not sure what you mean? where? Did you make anything new as I don't see any new events apart from your opening post?

  • Maybe you posted some events here? that I cant see

    Because you asked

    So it's more like something like this?

    The Pictures are no loading properly today, even mine is not showing off

  • Sorry,

    I forgot to post a new screenshot^^

  • Ok I see now))

    You are still no doing any Picking on the condition

    You are just looping through the Arrays and checking the Arrays Values thats all

    You need to find the way to Pick each "miniature"

    How many "miniature" do you have?

    How do you distinguish who is who, maybe by instance variables? or position? I have no idea yet, thats why I cannot tell you exactly what to do

  • Also, you are targetting (LoopIndex) instead of (LoopIndex"") which is different as you are using the "For" Loop

    And you are using the Array.CurY but you are not using the Array for loop so is not gonna work

    You need to use the Array internal For loop to use the Array.CurY

    If you Post a small Demo just enough to reproduce what you trying to do so I can fix it for you, it will be quicker

    Don't post your whole Project just the vents needed and the assets needed

  • tarek2

    Thanks,

    Is it enough or you need more screenshot?

  • Thanks for the Pics

    It will take longer without a demo )

    I see from the New Pictures that you haven't Update the things I told you to change:

    These mistakes have to be changed before you can carry on

    I will post them here again:

    ================================================

    ================================================

    One good thing is that you finally added the Pick "Miniature" but is outside the Loop, you have a to change the position as I show you on the Picture

    Also the Pick "Miniature.Position_Niveau" Variable are you sure it will match with the Array Values? if yes then is good

  • Sincerelly thanks for your help.

    Sorry, I'am not sure what should I do with the loop.

    In my array the first column would be the number of level. The second column if the level is unfinish (0) or done (1).

    So everytime x(1) the second column is egal to 1

    I pick the miniature who are egal to the first column +1 (as in the array it start with 0)

    I spawn the object fini on the miniature.

    What is wrong with my logic? Nothing appear.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Np

    What I would recommend you is to go through the tutorials again (Arrays, How Events Work) etc.... or soon you gonna end up with the same problem as it looks like you trying to do the events at random until they work.

    Will be better if you pause this project and go through the tutorials again then come back to it later, it will help you a lot and you will save a lot of time later. And I don't think it will take you long for the progress you are making.

    But that is just a recommendation, you can do of course whatever you think is right for you.

    For what I understood from your events, it looks like you trying to do a checkmark for all the Levels that are completed.

    I think will be quicker if I make an example:

    See if this can help you:

    Look at Event 13

    And how the icons "Miniatures" Variable "Level_N" are linked to the Levels

    I didn't use Family but is the same thing, you just have to add the Instance variable to your family and do the same

    https://www.dropbox.com/s/r5zwdkar14lv0y4/pick%20family.capx?dl=0

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