How do I make a simple ai that moves around a solid square

Get help using Construct 2

Post » Wed Sep 17, 2014 6:54 am

I followed a guide that allowed for edge detection and it worked perfectly.Now using the 8direction move behavior I'm trying to make an ai that will move around a rectangle.
Image

I had a couple ideas of how to make this work but it didn't go the way I hoped. So in the guide using one imagepoint the ai can detect when it's on the edge, so I tried to emulate this example but with 4 imagepoints corresponding to the 4 directions.
Image
Image
Without doing the whole thing at once, I first tried to see if it'd register one of the image points but for some reason the monsterdetector2 sprite won't redirect it's position to the bottom of the circle where the bottom image point is set. I confirmed this by going into debugging mode and seeing if the monsterdetector2 sprite moved at all but it just remained in the same place.
Image

I've tried looking up guides on this topic with no avail, so I'm currently stumped. I've added an attachment if you want to test out my problem for yourself.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 179

Post » Wed Sep 17, 2014 7:40 am

Message: puntodamar can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
have you try this one?
https://www.scirra.com/tutorials/756/setting-custom-paths-using-waypoints
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 292
Reputation: 6,678

Post » Wed Sep 17, 2014 7:40 am

have you try this one?
ww*.sci*ra.c*m/tutorials/756/setting-custom-paths-using-waypoints
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 292
Reputation: 6,678

Post » Wed Sep 17, 2014 10:11 am

Thanks. That gave me a few more ideas. I did end up using waypoints, but in a simpler way then in the demo, though admittingly with less functionality/flexibility.
Image
Image
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 179

Post » Wed Sep 17, 2014 7:30 pm

Here's one way here using detector sprites:
help-with-retro-enemy-behavior-move-along-solids_p713155?#p713155

For just a rectangle you can get away with having only 1 detector, I used 3 to handle crevices.
B
94
S
33
G
113
Posts: 5,357
Reputation: 73,275


Return to How do I....?

Who is online

Users browsing this forum: chrisinfinger, YoHoho and 15 guests