AI problem?

Discussion and feedback on Construct 2

Post » Tue Nov 04, 2014 8:51 pm

Hi all, I'm having a problem with something, in the tutorial where
its says the monsters are to stay on screen, however when I put the info in it seems the
objects continue to move off the page even though they are pointing in different directions and
none seem to stay on the layout.
I do not know if this is intended but needed to ask. Towards bottom of page:
Making monsters a little smarter

Tutorial beginners-guide-to-construct-2/page-5

Right now the monsters just wander off the layout to the right. Let's make them a bit more interesting. First of all, let's start them at a random angle.


This works it seems

Condition: System -> On start of Layout
Action: Monster -> Set angle -> random(360)

Event 4 of the tutorial.
They will still wander off forever when they leave the layout, never to be seen again. Let's keep them inside. What we'll do is point them back at the player when they leave the layout. This does two things: they always stay within the layout, and if the player stands still, monsters come right for them!


(This is where I'm thinking there is a problem cause the monsters do not stay in layout)

Condition: Monster -> Is outside layout
Action: Monster -> Set angle toward position -> For X, Player.X - for Y, Player.Y.

Run the game. If you hang around for a while, you'll notice the monsters stay around the layout too, and they're going in all kinds of directions. It's hardly AI, but it'll do!


Other than adding some functionality to the keyboard for Player movement, the file up to this point should be
just like the tutorial on the website.
Basic questions I know and thanks for the input.
Finally have the time to work on this stuff.

Thanks
You do not have the required permissions to view the files attached to this post.
B
10
S
3
Posts: 26
Reputation: 752

Post » Wed Nov 05, 2014 1:26 am

I didn't look at the capx but, try giving the spites "bound to layout" behavior.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283


Return to Construct 2 General

Who is online

Users browsing this forum: Pooya72, vargazso and 9 guests