How do I get characters to follow each other?

Get help using Construct 2

Post » Mon Apr 07, 2014 1:52 pm

I'm trying to get characters follow a lead character round a map.
Aside from pathfinding seeming incredibly slow (delay at start and when clicking), I'm can't work out how to get sprites to follow each other depending on which one is active.

When a sprite is clicked (detected with mouse over) it's set as active. On left click I tell the sprite to pathfind to where the mouse was clicked (by storing the Mouse.X and Mouse.Y).
What I want is for the inactive sprites to follow the active one.

But can't seem to get it working and am at a loss now.
Any help would be great :)
B
6
S
1
Posts: 19
Reputation: 440

Post » Mon Apr 07, 2014 2:32 pm

Check out the custom movement behavior in the manual , it might be what you are looking for ?
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Mon Apr 07, 2014 2:58 pm

Thanks granpa I'll check it out!
B
6
S
1
Posts: 19
Reputation: 440

Post » Wed Apr 09, 2014 6:27 pm

Having tried a few ways I just can't get my head round this.
Even with a single sprite, when I use pathfinding to get it to move to where the mouse was clicked there's a huge delay before the sprite moves. With other sprites set to follow they often don't move at all or end up in completely the wrong place.
B
6
S
1
Posts: 19
Reputation: 440

Post » Thu Apr 10, 2014 5:55 pm

what type of game are you making, depending on the type their are a few different ways.
If you are doing a top view style you could use the bullet function and just assign the object' angle of direction to the play's x and y
or you could use a pathfinding event. This is a bit harder but it works much better and the ai will be able to move around objects. again you will need to set up the path to the players x and y
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Wed Jul 02, 2014 10:18 pm

Game wise I guess along an arcade rpg type thing.
Essentially I have a team of characters that follow a "leader" around (who's moved into position by going to where the mouse left clicks).
I don't want the characters to rotate when they move, just to kind of follow along but keeping their distance.
I hope that makes sense.
B
6
S
1
Posts: 19
Reputation: 440


Return to How do I....?

Who is online

Users browsing this forum: LaurenceBedford, nahima and 5 guests