Check vars when instances of same object collide?

Get help using Construct 2

Post » Mon Dec 28, 2015 10:11 pm

@Solomon
Only Construct has this because it follows a different pattern to other programming languages. Namely Construct uses object lists that you filter with events, so if you want to pick one particular instance you'll have to filter the list down. Other programming languages only deal with only one instance at a time so you'd end up using lots of loops to compare instances with instances.

Personally I like using families to pick a different instance of the same type and I wouldn't mind seeing a way to do it in events without the need to setup a family beforehand. In my mind I'd like an overhaul of the event system so it's easier to learn and more powerful, but the exact details of such a proposal will have to wait till I've ironed out all the details, but in such a design I'd make something like this situation more trivial.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Mon Dec 28, 2015 10:15 pm

I think I'm having a similar problem here: https://www.scirra.com/forum/making-turrets-target-objects-based-on-team-instancevariable_t166138

I can't figure it out. Any ideas?
B
5
Posts: 38
Reputation: 309

Post » Mon Dec 28, 2015 11:24 pm

@R0J0hound

Thanks for the elaborate answer. In the end it did not turn out that difficult, just a matter, like it is explained in this thread, of picking two nth instance and comparing them if they collided.

Regarding ironing things out I take from what you have written that you are one of the developers of C2? Or am i mistaken?

@talqvist

Look into this thread if you are having problems of this kind, there is a capx you can download and study a page or few pages back.
Brick by brick, stone by stone.
B
41
S
16
G
9
Posts: 273
Reputation: 7,578

Post » Mon Dec 28, 2015 11:44 pm

@solomon
I'm not one of the developers, just an enthusiast.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Previous

Return to How do I....?

Who is online

Users browsing this forum: amarcelo, anty21ro, Magistross and 20 guests