RPG Dragon Warrior/Pikachu Follower

Get help using Construct 2

Post » Tue Oct 30, 2012 5:35 pm

Hey guys,

I'm trying to make a follower npc that follows a pc on a grid-based movement system. Think Dragon Warrior II or Pokemon Yellow or HeartGold/SoulSilver

I think I might have to use arrays to get this to work, but I'm not quite sure how to go about that. I think I need to find a way to store directional inputs and then have the follower simulate that input the next time the pc moves.

Thoughts?
B
13
S
5
G
1
Posts: 23
Reputation: 3,170

Post » Tue Oct 30, 2012 5:49 pm

It shouldn't be too hard if you want it to simply trace the players footsteps

add global variables, something like "lastGridX" and "lastGridY"

and in the events:
when a condition for moving the player to a new grid space is met,
set LastGridX/Y to it's current position, *before* moving the player to it's new space.

and then set the followers position to the grid space in the LastGridX/Y

There may be a simpler way though, if your game is turn-based for example you can, on the start of a turn just set the followers position to the players position before moving the player to his new spot.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Tue Oct 30, 2012 6:15 pm

Alright, I'm using the grid movement tutorial found in the How Do I? section to make grid movement via the bullet attribute.

How should I adapt your advice into this method of movement?

EDIT: Here's my Capx https://www.dropbox.com/s/d5q3ix4a4mooa2i/Pong%20Coach%20Champ.capxRave Radbury2012-10-30 19:07:40
B
13
S
5
G
1
Posts: 23
Reputation: 3,170

Post » Tue Oct 30, 2012 9:41 pm

@Rave Radbury
This may help
http://www.scirra.com/forum/follow-smoothly_topic47050_post294672.html#294672
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Tue Oct 30, 2012 10:28 pm

@lonehangman

Thank you for the suggestion, but that doesn't fit my needs. I need the follower to move at the same speed as the leader.
B
13
S
5
G
1
Posts: 23
Reputation: 3,170

Post » Sun Nov 04, 2012 5:59 pm

Sorry to double post, but I really need help with this. I'm very much out of my depth as to how I should go about solving this problem.
B
13
S
5
G
1
Posts: 23
Reputation: 3,170


Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 12 guests