• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: The Follow Me Script

Mr.Mako

Resident Edgelord Troll
162
Posts
10
Years
  • Age 27
  • Seen Aug 10, 2023
Yay, I know this will wind up helping a lot of people when it's done; especially the guys with Yellow version remakes and Gogo if he demakes HG/SS like he is Platinum.
 

Nurse Joy

Would you like to rest your Pokémon?
239
Posts
10
Years
I don't know anything about this, and it might not be my place to post here, but...

In RSE, The Mimic Circle on Route 119 mimics all of your movements... Maybe they have the code for a proper follow-me script.

IDK. It's just an idea I had. If someone already thought of this, then disregard this post >,>''
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
I don't know anything about this, and it might not be my place to post here, but...

In RSE, The Mimic Circle on Route 119 mimics all of your movements... Maybe they have the code for a proper follow-me script.

IDK. It's just an idea I had. If someone already thought of this, then disregard this post >,>''

If it mimics you you'd have to alter it since it'd just copy you. For example, you move up and he's next to you, he'll move into a tree.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
I don't know anything about this, and it might not be my place to post here, but...

In RSE, The Mimic Circle on Route 119 mimics all of your movements... Maybe they have the code for a proper follow-me script.

IDK. It's just an idea I had. If someone already thought of this, then disregard this post >,>''

Actually, you aren't too off on this idea. I recently had the inspiration to utilize this little mechanic, but with a few modifications:

First off, it's on Fire Red's engine because that's just where I'm comfortable pioneering things at. Secondly, the mimicing code it's quite exactly what you think it is. In A-Map it states it as being a "Copy Player" function, when in reality it actually rotates based on where you entered the sprite's view. So the first thing I did was fix that. Next I basically took the movement that the sprite originally wanted to do, stored it, and pulled the last movement they wanted. Here's a video of the result:

As you can see it's a bit rough, but it's a good proof-of-concept. Best part is that it only took about 0x30 bytes to implement, and it's still a fully functional NPC.

EDIT: I should probably also mention that the video is a bit dated, ledges actually work now (to a point, it's possible to create a gap while the NPC is jumping so I need to find a way to prevent movement while they jump) and it doesn't copy the player's looking direction.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
So there is a posibility that we can see this fully implemented and working before the end of 2014?

Most definitely. Very very likely that this will happen. As of now, since we have a person following properly, all that would be needed is the proper interventions between certain events and stuff. Although in it's current state it would work nice for events like the following people in DPPt. Minus the double battles and stuff.
 
252
Posts
10
Years
  • Age 27
  • Seen Jul 6, 2019
Most definitely. Very very likely that this will happen. As of now, since we have a person following properly, all that would be needed is the proper interventions between certain events and stuff. Although in it's current state it would work nice for events like the following people in DPPt. Minus the double battles and stuff.
Do you mind posting the ASM routines you've developed so far for this then? That way people could experiment with the routines, find ways to fix them, and port them to R/S/E. (I definitely want to port this to Emerald lol)
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
i have a very good idea its simple but should work good if i think so its just a bit hard to do it. (sisifus) but it works with XSE why we don't use simply the mapscript if you enter a map and a movesprite on player position and a getplayerposition command and some flag and vars so we need to add the sprite on every map and hide it until the flag is getten and then use a spritebehaviour to make it follow you over the map until you go on another map and the enter map script start a new getplayerpos and movesprite and spritebehaviour and showsprite and so on why this could not work?

this wouldn't work for many reasons.
First it would cause a delay in each move you make
second it doesn't support ledges or scripts that move you
third surfing isn't supported
fourth it takes too much space.
fifth it wouldn't work on changing maps
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
So a while back I posted a video of a follow me I had done for the heck of it, and since I haven't made much of any progress on it for a while I'd figure I'd release what I had and see where it goes. The code can be found on my GitHub here along with instructions in the README.md and the asm files for proper modification and hooking. It should be noted that there's a few issues, namely ledges and missing hooks that I have yet to add (ie running). For a basic follow me though, it should work fine. It should also be noted that this replaces the "Copy Player" movement type for NPCs in A-Map. The total size is under 0x200 bytes so it's very compact and easy to insert, even for beginners.
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
So a while back I posted a video of a follow me I had done for the heck of it, and since I haven't made much of any progress on it for a while I'd figure I'd release what I had and see where it goes. The code can be found on my GitHub here along with instructions in the README.md and the asm files for proper modification and hooking. It should be noted that there's a few issues, namely ledges and missing hooks that I have yet to add (ie running). For a basic follow me though, it should work fine. It should also be noted that this replaces the "Copy Player" movement type for NPCs in A-Map. The total size is under 0x200 bytes so it's very compact and easy to insert, even for beginners.

The code you posted on your GitHub doesn't function like the video; the OW collides with the player and thus leaves a 1 tile gap while walking. Could you please upload the needed byte changes onto the repo so that we can make this functional? GoGo said you have it working in your ROM.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
The code you posted on your GitHub doesn't function like the video; the OW collides with the player and thus leaves a 1 tile gap while walking. Could you please upload the needed byte changes onto the repo so that we can make this functional? GoGo said you have it working in your ROM.

I believe I mentioned this, but the solution I used in the video was to remove 100% of collision detection. I did this for demonstration purposes, but my original intent was to exclude the following players from collision between the player and itself. I'm trying to find the modification I made to achieve this but my IRC logs aren't showing anything unfortunately.

EDIT: Did a diff, if you replace the 0E at 0005BBDB with 20 you get walk through anything hax, which includes overworlds as well (and just about everything).
 
Last edited:

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
I believe I mentioned this, but the solution I used in the video was to remove 100% of collision detection. I did this for demonstration purposes, but my original intent was to exclude the following players from collision between the player and itself. I'm trying to find the modification I made to achieve this but my IRC logs aren't showing anything unfortunately.

EDIT: Did a diff, if you replace the 0E at 0005BBDB with 20 you get walk through anything hax, which includes overworlds as well (and just about everything).

Okay, thanks. I thought it might be something like that. I'm probably going to modify the collision detection algorithm so it ignores the NPC's and map boundaries, as well as the player for that behaviour alone.
 
416
Posts
11
Years
  • Age 35
  • Seen Feb 10, 2024
Okay, thanks. I thought it might be something like that. I'm probably going to modify the collision detection algorithm so it ignores the NPC's and map boundaries, as well as the player for that behaviour alone.
like a check, if an NPC is set to 'copy player', it ignores collision? Cause we still want the player to bump into stuff.
 
Last edited:

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
ke a check, if an NPC is set to copy player, it ignores collision? Cause we still want the player to bump into stuff.

I'm going to modify the collision algorithm of only that NPC with that behaviour set. The player will still collide with everything, bar the NPC that is following him/her.
 
416
Posts
11
Years
  • Age 35
  • Seen Feb 10, 2024
I'm going to modify the collision algorithm of only that NPC with that behaviour set. The player will still collide with everything, bar the NPC that is following him/her.

when you do this will you be publishing your work?
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
when you do this will you be publishing your work?

I'll open source it on my GitHub. I have a number of other projects to take care of though, so It'll take a while for me to get round to doing this.
 
200
Posts
10
Years
  • Age 30
  • Seen Jun 19, 2022
I played around with the modified mimic function Shiny Quagsire posted, and, correct me if I'm wrong, but it will only follow you a short distance? It'll go across routes, sure, but it's limited by steps.

NPCs have a movement-distance variable (right under movement type in Advanced Map, which I put as the first 'Mirror Player' there - that's the correct one, right? Worked anyway.) in XY format I think, so I guess the max any NPC can go is the movement value FF, or 16 y and 16 x. That's as far as I was able to make it go.

If you go far enough away from the NPC, they teleport back to their original position, and for me at least go kinda bonkers when you go back to retrieve them. So you could spam NPCs at a far enough distance from each other to hax it into longer distance, or less spastically put some kind of periodic script to mod the movement-type/start-pos of the NPC following you? o_0 Or a combo of the two, which sounds more feasible if it's a small hack and you, say, only have the NPC following you around for a short while/area anyway. Although it seems like there should be a way, since the NPC seems to check how far it's gone since the origin point, to silently find and ASM repoint that origin as you move along so the NPC never runs out of space to roam from the origin. If it's just one var, it shouldn't be too lag inducing. Maybe I'm completely wrong and that isn't how NPCs move, or maybe since the origin is hardcoded and probably not used as a temp var you'd just have to get the NPC to stop looking for the origin altogether rather than repointing it.

If there's a way to make NPCs move further and I'm just ignorant and blathering about nothing, please correct me, I'm a newbie.
 
Back
Top