Select multiple objects from families

Get help using Construct 2

Post » Sat Jan 03, 2015 10:56 pm

Hey there,

maybe my brain's just too tired, but I can't find how to make this work properly (see capx).
Basically, I'm trying to select one or several units, then have them pathfind their way to the touch/pointer. Very classic.

Thing is :
* I do not use a selection box : every unit is selected when passing the finger/pointer over it. That part works just fine and I like it.
* And, my units are in a family called "UNITS", which has a family pathfinding behaviour, but they are also in a family called "SELECTABLE" (among with buildings, etc.), which has the "is selected" boolean variable. Meaning I don't select units directly : I select selectable objects, and if those happen to also be units, then they will move on click as units should.

The issues I'm facing are :
1. The selection rectangle that marks when an object is selected doesn't always follow the object when it moves (it seems to stick to the object only if it was the first one that was selected or something)
2. No unit will move unless the unit with the lowest UID is selected. And then, they will move even if they are not selected themselves.

I feel like it all has something to do with instance picking between families, but I'm really at a loss about what to do to solve it. Unless maybe I remove the bigger "SELECTABLE" family and have the game select every family of objects separately, but that would suck.

Thanks in advance if anyone can help. :)
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Sun Jan 04, 2015 7:43 am

Hey Kan,
Here you go! I think I made it work the way you wanted. Let me know if you have questions on what I changed.
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sun Jan 04, 2015 7:26 pm

@thatserafimkid : Seems to work fine now! Thanks a lot! :D

I sometimes get lost when it comes to finding in what order to put instance-picking conditions and which ones to use.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Tue Jan 06, 2015 10:14 pm

You're welcome. Glad I could help.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635


Return to How do I....?

Who is online

Users browsing this forum: Fradno, MathNook and 40 guests