Enemy AI 8-Movement?

Get help using Construct 2

Post » Wed Aug 28, 2013 7:47 am

Hello!

In my game, I have a fence where a spider will be moving in a box-shaped pattern. I've decided to use the 8-Movement behavior on it, but ran into a few issues.

My initial set up was four invisible triggers that when hit, the spider would change direction to create a box, but the spider wouldn't move using 'on start of layout'

So I used 'Every Tick' to get the spider to move, and it worked, but it wouldn't collide with the directional triggers. I assumed it was the every tick overriding any other input.

Am I doing this the hard way? Is there a better way to do this? Or am I just over-thinking this?

Thanks so much in advance for helping out! : ]
B
3
Posts: 2
Reputation: 229

Post » Wed Aug 28, 2013 2:43 pm

Would need a link to the .capx file to assist.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Wed Aug 28, 2013 3:16 pm

Yeah, we'd need the .capx file to help out, try uploading it to dropbox or something.
B
9
S
3
G
1
Posts: 53
Reputation: 1,296

Post » Wed Aug 28, 2013 9:31 pm

Sorry about that--It took a while since the original project file is HUGE. Here's a snippet of the bigger file containing what I need fixed (the spider is stand-in art)

https://www.dropbox.com/s/tdr8cmulzdg6gqk/Spider_assistance.capx

Thanks for the quick reply! : ]
B
3
Posts: 2
Reputation: 229

Post » Wed Aug 28, 2013 11:47 pm

Simulate move direction will only move the spider a tiny amount, you have to loop it. You could do that by setting variables when each corner is hit.
I would structure the logic in a different way though : MoveToward Spider_Down, WhenOverlapping Spider_Down > MoveToward Spider_Left etc etcplinkie2013-08-28 23:49:04
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Thu Aug 29, 2013 9:53 am

or why not try the Pathfinding behaviour as well ..then you can enable or disable it as required and call movements to exact screen positions ..Pathfinding is pretty neat for that..if you need to control the path finding motion you could also add in CUSTOM (not necessarily solids) avoidance blocks that funnel the spider sprite to the correct location...These Block Sprites can be invisible :)
The Pathfinding Behaviour has many other uses..than what you would think...like many of the prefab behaviours..
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests