[Fixed] Pick Nearest from certain sprites

Get help using Construct 2

Post » Sat Mar 16, 2013 10:40 am

Hi all

I have set of events and they're not working like I think they should.


FamilySprite Is overlapping "DeadZone"
FamilySprite Health = 0
   FamilySprite Pick nearest to Player.x, Player.Y


Here I expect it to only pick the nearest dead enemy in the deadzone, but instead it's picking from all the enemies on screen.

I thought conditions filtered things but that doesn't seem to happen here?silkc22013-03-16 16:55:41
B
20
S
6
G
2
Posts: 157
Reputation: 3,109

Post » Sat Mar 16, 2013 12:18 pm

That should work, can you post an .capx of the problem?
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Sat Mar 16, 2013 3:03 pm

The first two conditions aren't set as seperate events are they? If they are, it'll reset the pick after the first one. The 2nd pick either needs to be indented or part of the same event as the first.

Sorry if that's not the issue but I tend to make really basic errors like this all the time in C2 and get held up for hours trying to work out what's going on
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Sat Mar 16, 2013 4:41 pm

I've tried it exactly as above - two conditions in one event and then the pick nearest as a sub, I've also tried all three conditions in one event in the same order.. in all cases it's picking enemies that don't meet the first two criteria. I'll try knock up an example (not ready to share this game with the world yet, hehe).
B
20
S
6
G
2
Posts: 157
Reputation: 3,109

Post » Sat Mar 16, 2013 4:55 pm

OK ignore me, it does work, total red herring hiding the real issue.

Sorry 'bout that! silkc22013-03-16 16:55:24
B
20
S
6
G
2
Posts: 157
Reputation: 3,109


Return to How do I....?

Who is online

Users browsing this forum: Nifl and 28 guests