99Instances2Go's Forum Posts

  • You will have to post your capx, the tutorial seems rock solid to me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A bit confused with the example. If the family is gonna contain different sprites (objects), then 'is sprite over overlapping family' is a bit weird (in my eyes). If the family gonna contain instances of the same sprite, then use 'is sprite overlapping sprite'. Pick nth will work flawless, pickedcount will work flawless also.

    In the other case, if the family gonna contain different sprites, then make a second family. And use 'is family1 overlapping family2'. This works if both familys contain exactly the same objects. Only under those circumstances IID will make some sense. Pick nth will work flawless, pickedcount will work flawless also.

    I never uses 'is family1 overlapping family1'. You might try.

    The solution is in the link i suggested you to read, btw.

  • IID has no meaning within a Family.

    Something to read:

    https://www.scirra.com/tutorials/556/un ... o-families

  • Yours spawns 2000 objects (as long as the value is 5), wich is a rare case, because of the 'add'.

    Mine 'we mine means' spawns once when the value is 5 and then not till it is again 5, that is what 'once while true' means.

  • The 'jump' is pretty good dt corrected. It is the 'gravity' that is not.

  • To bounding box on all animation frames ... with the origin on the same place in all animations and in all animation frames ... with all animations frames beeing the same size ... ?

  • I have seen your capx, but i do not understand what you try to do.

    So, let me tell you some basics.

    Lets say we trow dices. Now the randomness depends on how much times you try.

    So if you really want true randomness, the you got to try a lot. To do this in c2, try this.

    Global variable 'timer' ... number .. = 0

    Global variable 'Pick_Ups' .. number .. = 0

    condition > system > every tick

    action > system > set value ... variable = 'timer' ... value = floor(random(1,5))

    action > system > set value ... variable = 'Pick_Ups' ... value = floor(random(4,31))

    condition > system > every x second ... interval=timer

    sub condition > system > compare two values ... 1st value = Pick_Ups .. = .. 2d value = 5

    condition > system > once while true

    action > create on random places

  • Always solvable with math and an array & a grid to reduce the possibilities.

    But, you said overlapping dont work so i used overlapping.

    https://www.dropbox.com/s/k2dcuymlcsxbh ... .capx?dl=0

    Only moves on the grid with the tile = 1 are allowed. So, predefined paths are (boring) easy to define in the layout.

  • '0>1' means that it needs some coding like this (very basecaly):

    Global variable .. number ... = zero.

    Every tick > add 0.1 to number (with max 1 and a reset for the next lerp)

    lerp(50, 800, number)

    Now number steps from 0 to 1 in 10 steps and the lerp will got from 50 to 800 in 10 steps.

    It is as easy as that !

    What you do now is the equvalent of lerp(number,800,0.3)

  • 1/. The function had no idea wich object to perform its action on, because you did not pick one. And 2/. All the other events had the same problem.

    You gots to learn how to pick objects, what the SOL (Selected Object List) stands for, and how to filter it with conditions.

    https://www.dropbox.com/s/2oofikpuwzezh ... .capx?dl=0

    Look at event 5. The 'on collision' auto picks 2 objects. The playerbox & obj_weaponItems where the playerbox collided with. Now the SOL conatains those two objects. Meaning, we still need to add the right obj_slots to the SOL. That is wat the 'pick by comparisation' does.

    At this moment the SOL contains the playerbox, the right obj_weaponItems & the right obj_slots. Any action adressed to any of those objects in that event will only adress THOSE objects that are in the SOL. And that is basecaly how c2 works.

  • Besides that it is to much code for only 'that' ....

    Your problem are the origins in the animation frames. They are way out of center, actual showing the graphic content out of the viewport.

  • Sounds like you need to use the condition ...

    Sprite > Pick nearest/furthest ... x= Player.X & y = Player.Y

  • Not really.

    You did't change that '0.3' each tick, and therefor you got one value in return.

    The lerp should be lerp(50, 800, 0>1), where '0>1' is a value that counts from 0 to 1 in a time you choose.

    The solution you found is kinda a 'fake' solution. It works, well kinda, that lerp will never reach 800.

    It works because the distance between 'Object.Width' and '800' gets smaller.

    If you cant wrap your mind arround 'lerp' then maybe you better use LiteTween.

    Just a friendly suggestion.

  • Need to use 'else'.

    Right now 'set to 1' makes '= 1' true. If true it is 'set to 2' and that makes '=2' true. And so on.

  • On startup of layout (event 1), i place the targets. Because i use a container to pair up text boxes with targets, i got to create them on run time. Because i was to lazy to calculate positions, i prepared some objects in the layout to place the targets on.

    Event 7 reads as: if instance variable 'targetUID' of the mover = -1, then pick the mover, and add a random target to the picklist. Move the picked mover to the picked target. At the same time i set 'targetUID' to UID of the choosen target. I reset the 'overlappingTime' of that target. I write that (zero) in the textbox belonging to that target. Since i use containers, picking a target also picks its text box. And, so i can see (and debug what i am dooing) i set the opacity of that choosen target, so it stands out. This event (event 7) will not run again untill 'targetUID' is set to -1 again in event 15. Why -1 and not zero ? Because the UID zero can exist. It is bad coding to take that risk.

    Event 9 reads as: Pick the target by its UID (instance variable 'targetUID' of the mover). Add the mover to that picklist when its boolean 'StartedOverlapping' is not true. If the picked target overlaps the picked mover then ... and only the first tick that all this is true ... set 'StartedOverlapping' to true.

    So. When the mover overlaps that choosen target (not any other target) set a boolean to true, so we know that from this moment we have to count the time that they are overlapping.

    Event 11 is the opposite of event 9. If i set a boolean, i have to unset it somewhere.

    So, event 11 reads as: if the boolean 'StartedOverlapping' is set to true and if the mover is not overlapping any target, then pick the mover. And set 'StartedOverlapping' to false.

    Also meaning that there can be no more time added in event 13. Done with overlapping = stop the timer.

    Event 13 is the counter. It reads as: if 'StartedOverlapping' is true, then pick the mover. If that mover is overlapping any target, then add that target to the picklist. 'StartedOverlapping' is only set (in event 9) when the target is the choosen target, so i can safely asume that any target picked here is the choosen target. When all this happen, add dt to the timer every tick. And show that time in the (due the container) picked textbox.

    Event 15 just sets instance variable 'targetUID' of the mover to -1when the MoveTo plugin says it reached destiny. With 'targetUID' = -1, event 9 can again find a new target. And it all starts all over again.

    Basicaly most coding in C2 works this way: pick an object when something is true. Add another object to that picklist when something is true. Make actions that work on the picked objects.