Check vars when instances of same object collide?

Get help using Construct 2

Post » Fri May 10, 2013 3:11 pm

Thanks everyone! I think we can all agree that working around this requires some hella inelegant stuff. I'll ask Ashley to do... something to make it easier. I'm not sure what, but he's the genius programmer here so hopefully he can find something!
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Fri May 10, 2013 4:37 pm

Actually, once you've done the variable check, how do you tell C2 which Sprite you want to do work on? (Destroy, or adjust variable, or etc)
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Fri May 10, 2013 5:32 pm

The same of your other topic, you can use instance variables, pick by UID or other stuffs doing the same.

https://www.scirra.com/tutorials/361/understanding-uid-iid-health-cards-and-rocket-smoke-trail

I'll work on a sample for you today (21:00 GMT +3), hoping to help, because this was an issue on my life when I began here too.TELLES08082013-05-10 17:33:52
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301

Post » Fri May 10, 2013 6:21 pm

Thank you so much!
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Fri May 10, 2013 8:34 pm

@ChrisAlgoo, I've noticed that this type of question seems to come up every once in a while on the forums, so I've written a tutorial to hopefully clarify the confusion.

Understanding Picking with Respect to Families

The tutorial not only covers how to distinguish between identical objects within single events, but why it's important from a modular design standpoint.
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Fri May 10, 2013 9:39 pm

That was extremely awesome, thank you.
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Sat May 11, 2013 12:01 am

https://dl.dropboxusercontent.com/u/47035927/Samples/IDs/sample2/index.html

https://dl.dropboxusercontent.com/u/47035927/Samples/IDs/sample2/filtering_IDs.capx
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301

Post » Sat May 11, 2013 3:03 am

Ignore the messy coding in the event sheet. There's some kinks I need to iron out. i think it's because I started out with limited variables and started adding more i got confused so the information that shows up are wrong and the variable assigning is screwed up as well.

You may noticed that sometimes a smaller object > bigger object (so big is destroyed)


but you get the idea (i hope)

https://dl.dropboxusercontent.com/u/18773252/VarCheck.capx

i'll try to fix it later.OrangeTapioca2013-05-11 03:05:12
B
40
S
10
G
5
Posts: 102
Reputation: 6,602

Post » Sat May 11, 2013 3:59 am

@ChrisAlgoo
You're very welcome. I also added a new section to the bottom of the tutorial where I discuss the performance aspects and advantages of Family to Family collision detection.
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Mon Dec 28, 2015 4:59 pm

As I was searching the forums for a solution I found this thread, and I was wondering if this lack of a simple solution regarding families colliding with families happens only in Construct 2 or in other programs too as it is sort of a programming quirk?
Brick by brick, stone by stone.
B
41
S
16
G
8
Posts: 273
Reputation: 7,078

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: MarkThomas and 17 guests