Hunt Nearest Enemies

Get help using Construct 2

Post » Sat Jun 01, 2013 11:12 pm

What I want is: Every BlueObject have to chase(Pathfind) the nearest RedObject.

With one Blue I got it.
However when I put more than One BlueObject, just one BlueObject starts "Hunting" and the others reamain stopped.

Why is this Happening?

Here's the Capx:

https://docs.google.com/file/d/0B4gkRQY2H_o6clRtb1JoRmVoYUU/edit?usp=sharing

@Kyatric @Yann @Whiteclaws
@sqiddster @R0J0houndpsycholize2013-06-01 23:24:53
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Sat Jun 01, 2013 11:30 pm

I'm looking now.

Edit:
Dang I can't see it.. I thought this would work but that just causes an error.. all I can suggest is you work on the basis that you need to tell the event sheet that ALL blue need to go pathfinding.

SorrySulli2013-06-01 23:37:32
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sun Jun 02, 2013 12:37 am

@psycholize
@Sulli


Im guessing this is what your trying to do?

Link:
https://www.dropbox.com/s/llnb9hs866htv7u/Fix.capxretrodude2013-07-03 22:21:46
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Sun Jun 02, 2013 1:58 am

Last edited by Yann on Sun Sep 14, 2014 7:15 pm, edited 1 time in total.
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511

Post » Sun Jun 02, 2013 11:52 am

@retrodude knew it was somewhere ;) haha, thanks for helping him out guys
B
20
S
7
G
4
Posts: 322
Reputation: 4,521

Post » Sun Jun 02, 2013 8:01 pm

Thank you Guys! One day I will be fuckyeah like you!
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Sun Jun 02, 2013 8:09 pm

@Yann

I have a doubt. Why you commented to be carefull that the pathfinding cell size matches the object size?

Is there any problem in have 16x16 objects with 16x16 Cell size?
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Mon Jun 03, 2013 3:45 am

@psycholize

You had a pathfinding cell size of 30 whereas your sprites was 16x16 squares.
And it was possible that the hunter sprite reached its destination node as given by the pathfinder, but somehow was too far to collide with the hunted sprite.

A clear explanation of why that can happen with a cell size of 30 and a sprite size of 16 would probably require some drawings, and since I'm a bit lazy I'll ask you to trust me on that :D

All in all, it's probably better to have a cell size of 16 for sprite sizes of 16... (Though it might work with slightly bigger cell size but 30 was too much)
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511

Post » Mon Jun 03, 2013 4:00 am

@Yann

I got it.
Thank you friend!
B
13
S
3
G
1
Posts: 60
Reputation: 1,828

Post » Mon Jun 03, 2013 4:05 am

thanks this was very helpful thread to follow
B
41
S
12
G
6
Posts: 136
Reputation: 6,372

Next

Return to How do I....?

Who is online

Users browsing this forum: beguinner, mcscooter, totoe, Yahoo [Bot] and 19 guests