trueicecold's Forum Posts

  • plinkie, looks like a valid situation: an player collides with one of several types of players, and I want the 1st (or 2nd) player to be destroyed.

    Actually, for my game, I've change the gameplay a bit, so I don't need it as of now, but it's interesting how that can be achievable.

  • Here's a Capx I uploaded to demonstrate the problem:

    https://drive.google.com/file/d/0B5myBv ... sp=sharing

    Drag one sprite to another, you'll get PickedCount 1.

    change the on collision to Sprite instead of the family, and you'll get 2.

    I've noticed I put the alert in the same level as the event, but putting it under a blank sub-event didn't change the outcome.

  • 99Instances2Go, thanks, so how can I achieve my goal?

  • Try Construct 3

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

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

    When a Sprite is inside a family, using "On Collision with Family" will return Sprite.PickedCount of 1, although the Object it was collisioned with was also the same Sprite type.

    Changing it to "On collision with Sprite" will return Sprite.PickedCount of 2.

    Attach a Capx

    https://drive.google.com/file/d/0B5myBv ... sp=sharing

    Description of Capx

    Drag one Sprite into another, and You'll get an alert stating the Sprite.PickedCount. This will show 1.

    Inside the Event sheet, Change the collision Family to Sprite, and you'll get Sprite.PickedCount of 2, which is the desired result.

    Steps to Reproduce Bug

    • Drag one Sprite into another.
    • Change the collision Family to Sprite
    • Test again to see the difference

    Observed Result

    PickedCount is 1, although 2 Sprites collided with each other.

    Expected Result

    Sprite.PickedCount to be 2.

    Affected Browsers

    • Chrome: YES

    Operating System and Service Pack

    Windows 10

    Construct 2 Version ID

    Release 233

  • You're right, plinkie, but I think I've found a bug...

    if Block is in a family - it always returns 1...

    Even if he's alone in that family - Block collision with Family will return PickedCount of 1, although the item that was collisioned with was Block as well...

  • With the on collision event, you can use Pick nth instance, instance 0 and instance 1 will be the two blocks colliding with each other and you can reference and use them in that way.

    Thanks, but it seems nth instance refers to the entire Block collection inside the game, and not just the ones involved in the collision...

    Also, outputting Block.Count inside a blank sub-event inside the collision returns the global amount of Blocks.

  • Hello all

    How can I reference both block (or a specific one of them, for that matter) in the event "If Block on collision with Block"?

    outputting Block.UID always return the lower UID of the two... I need to get the newer one.

    Thanks!

  • There aren't any variants. Those things only have one size. I think you need to be clearer about what you need.

    I was meaning to create a capx showing my problem, then I understood I had a sprite anchored at the center, and this messed up my calculations (couldn't figure out why some other sprites were out of bound...)

    A noob mistake, really

    Thanks anyway!

  • Hey all,

    I often encounter issues with measuring the layout width, as well as sprite width. I can only suspect that it's due to the pixelDensityRatio, but I'm not really sure...

    How can I properly measure sprites and layouts, considering all variants?

    Thanks

  • You could give all vehicles the car behavior, but leave them disabled.

    Then, upon overlapping a vehicle and pressing a key to drive it, enable the behavior for this vehicle only.

    Make you you disable the behavior for the previous car, or otherwise you'll end up in a nice car dance

  • tunepunk, yeah, I meant top level

    99Instances2Go, that's cool, already albeit awkward. Question is: can I ABSOLUTELY count on it that it will be 1? I COULD check < 2, so if by any chance it's a 0....

  • Thanks, both of you, bummer I have to create another event at the top instead of its appropriate logic place

  • I have 6 fruits on screen, and a platform player.

    When collisioning with a fruit, I destroy it, and checking to see if the Count is 0. However, I never reach Fruits.count = 0 sub-event when it's nested under the "on collision" trigger. When I put the Fruits.Count = 0 outside (every tick), this works just fine.

    Doesn't work (actually the Text value in the trigger is one behind. If I had 6 and destroyed one, it will still show 6):

    Works:

    Any ideas? Is this expected?

  • I guess you could go the other way around - create an animation of the ship shooting with alternating barrels, then check the current frame. If frame is 5 (for example) spawn a bullet from the left barrel. If it's on frame 11 - spawn from the right barrel.

  • Thank you all, I kinda get it now

    Wish there was some kind of signaling mechanism to C2, but I guess the current model isn't too bad, seeing the explanations