Something that's been bugging me (capx)

Discussion and feedback on Construct 2

Post » Wed May 04, 2016 4:31 pm

Add a family and put object A inside this family, then using
On object A collide with family
B
108
S
26
G
272
Posts: 4,471
Reputation: 152,277

Post » Wed May 04, 2016 5:21 pm

Another issue I had a lot of trouble with in the past.

Method 1 - use families. Have your object in a family, then for each A, if overlapping with family containing object A, destry A.

If you are using trial version of C2, you don't have access to families. In that case:

Method 2 - use UIDs to identify/pick an "active" instance, then pick all and compare if overlapping against that specific instance. You'll also need to use for each in this case, so not all A objects are destroyed at the same time.
Mistakes were made.
B
52
S
26
G
109
Posts: 1,615
Reputation: 61,651

Post » Wed May 04, 2016 6:39 pm

I like that almost better than families because you have more control of exactly which A you're destroying (or whatever).
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
64
S
17
G
5
Posts: 172
Reputation: 8,381

Post » Wed May 04, 2016 6:50 pm

Actually sorry that was bad advice. In this case, where you are destroying overlapping objects of the same sprite, UID might not work as well. You want to use Pick Nth instance instead:

Pick Nth instance
Pick the instance at a given place in the internal list of picked objects. This is most useful used in sub-events to act on separate instances. For example, in a "Sprite collided with Sprite" event, Pick 0th instance and Pick 1st instance can be used to act on each instance involved in the collision separately.

If all objects are currently picked, this condition can also be used to pick an object by its index ID (IID). For more information, see common features.


You can pick Nth instance and destroy that instance in a loop until the Sprite collided/overlap with Sprite is no longer true (there is only one instance left).
Mistakes were made.
B
52
S
26
G
109
Posts: 1,615
Reputation: 61,651

Post » Wed May 04, 2016 7:19 pm

With families i do it this way, looping trough the picklist:

https://
drive.google.com/open?id=0B1SSuCVV8v74bjhMZjdpRU9XaG8

The instances that overlap and have the lowest healtpoints get set opaque, or can be destroyd. A situation that happens a lot.

Without families and no addon, i have honestly no idea how to do the same. Mayby one day i find a way.
(Rex could have answerd you that he has an exellent addon for that)

The thing is. Families are extremely helpfull with picking problems. I understand completely why they are only available in the payed version. Missing families is missing out a huge amount of possibilitys.

But, almost all beginners have no way to know what they miss. They should make there games according what is possible with the free version. But they have not idea how to do that, and they can not have an idea. One of those things is: do not overlap more then two instances of same object hoping their are conditions to snap those individual overlaps. If you do, you work beyond the limitations of the free version.

That is my opinion. (means nothing, everyone has one) And mayby there should be some clear document explaining this, when listing up the differences between payed and free. But on the other hand, in my case, i would not have understood that doc, not even after 20 times reading. I would have come to the forum to read how other people solved this. Luckely this community is heaven.

I cant apologize for my English, i know it is horrible, but i do my best.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Jun 13, 2016 5:07 pm

"But, almost all beginners have no way to know what they miss. They should make there games according what is possible with the free version."

That's very true indeed. Don't know what I would do without that feature. I can't imagine having 10 types of bullets or enemies and having to make separate checks for collision and such... for each.
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
64
S
17
G
5
Posts: 172
Reputation: 8,381

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: sunisa2532, taker7 and 24 guests