• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Not only.. I meant just a few that doesnt move sprites or generates them.
 

BugMania

The Bug Master
32
Posts
10
Years
  • Seen Nov 4, 2016
This would be much easier, if GBA would allow multithreading :P
I give you a tip: calling the scripthandler instead of ASMing everything
(like getplayerpos or applymovement), you save much time with it.

If I understand your idea, could be changing clothes in the game.
For if it is possible for a sprite walk along with the player ...
It would be sensational!
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
If I understand your idea, could be changing clothes in the game.
For if it is possible for a sprite walk along with the player ...
It would be sensational!

We can already change clothes................ Look at my "Real Realtime Player Customization" on PHO.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, so I'm currently looking into how the player moves. It definitely isn't applymovement.

DavidjCobb found the X,Y ram a long time ago. http://www.pokecommunity.com/showpost.php?p=6856053&postcount=197

[0x03005008] + 0x0000 2b Camera X-position
[0x03005008] + 0x0002 2b Camera Y-position

This will be useful.
 
Last edited:
5
Posts
12
Years
  • Seen Jan 15, 2018
Hi there, maybe the last advance about the ram data are usefull but maybe we can study the system used on the script of RPGMaKeR pokemon games on it are created mulriple events (because on it can follow thru 6 pokemon) but esentially an event are created on the map; if i'm not remember too bad its on map at once, my knowledge un Ruby is't closely to Zero but maybe somebody can study and compare the posible syntax comon fuction.

Its only an idea ;P
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Hi there, maybe the last advance about the ram data are usefull but maybe we can study the system used on the script of RPGMaKeR pokemon games on it are created mulriple events (because on it can follow thru 6 pokemon) but esentially an event are created on the map; if i'm not remember too bad its on map at once, my knowledge un Ruby is't closely to Zero but maybe somebody can study and compare the posible syntax comon fuction.

Its only an idea ;P

9P30KCd.png
 
Last edited:
3
Posts
11
Years
  • Seen Oct 21, 2014
It's been awhile since I looked at it, but here's my attempt at a follow script. It works nice, for some things, but has serious limitations.

Here's the video of it in action:


Limitations:

1) The sprite doesn't follow when changing areas, including changing routes. I bypassed this by setting up sprites in 'unseeable' areas, then teleporting them as needed when the player enters new areas. (This is seen when the player leaves buildings in the video)

2) Tests showed that battles work as normal....until I edited the code forever ago >.<. I think they still work, but haven't tested it. The code should support normal battle functions.

3) Requires the hacked FireRed Engine/

4) Doesn't currently track swimming or jumping. It does take into account running, but I don't remember if the current version does. (A past version does, but I lost that one.)

Here's the code snippets. It's been forever, so I don't remember if this is all of it or not.

Spoiler:


Spoiler:


If I remember correctly, this script only needs to be enacted once. Then it will work so long as the follower is within the same map. (Thus, when changing maps, the follower needs to be placed behind or at the player).

Hope this helps some of you =/ I've left Pokemon hacking and went back to Skyrim >_<.

To those who sent me PMs. Sorry, didn't see them >_< But here you go! :D
 
1
Posts
11
Years
  • Seen Apr 8, 2014
First of all, thanks for sharing the code.
Anyway, I really don't like copy-pasting and I was wondering if you can add some comments or explain me all these "copyvar, subvar, getplayerpos...". I mean, I know what they does, but how did you choose the parameters and so?
Furthermore, what do I have to do whit the "Loading the Follower Script Information" script?
Thenks a lot and sorry for bad english :)
 

Sniper

ふゆかい
1,412
Posts
10
Years
It's been awhile since I looked at it, but here's my attempt at a follow script. It works nice, for some things, but has serious limitations.

Here's the video of it in action:


Limitations:

1) The sprite doesn't follow when changing areas, including changing routes. I bypassed this by setting up sprites in 'unseeable' areas, then teleporting them as needed when the player enters new areas. (This is seen when the player leaves buildings in the video)

2) Tests showed that battles work as normal....until I edited the code forever ago >.<. I think they still work, but haven't tested it. The code should support normal battle functions.

3) Requires the hacked FireRed Engine/

4) Doesn't currently track swimming or jumping. It does take into account running, but I don't remember if the current version does. (A past version does, but I lost that one.)

Here's the code snippets. It's been forever, so I don't remember if this is all of it or not.

Spoiler:


Spoiler:


If I remember correctly, this script only needs to be enacted once. Then it will work so long as the follower is within the same map. (Thus, when changing maps, the follower needs to be placed behind or at the player).

Hope this helps some of you =/ I've left Pokemon hacking and went back to Skyrim >_<.

To those who sent me PMs. Sorry, didn't see them >_< But here you go! :D

Don't come back to Skyrim!! D:
Anyways.. Nice work. Still need a lot of fixes and tweaks though.
But maybe someday a follow script like HG/SS will surely be find.
 
64
Posts
10
Years
  • Age 27
  • Seen Mar 30, 2016
The ARM7-CPU of GBA doesnt support multithreading, so you need to check special events etc via getplayerpos to execute them via ;cmp <register> <position> ; beq trainerbattle;(for example)
Maybe I will try to do one in the next time.

Saturnus said:
But maybe someday a follow script like HG/SS will surely be find.

That will probably be never possible as the GBA has limits.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
That will probably be never possible as the GBA has limits.

It is, there is only one problem left to solve, and that is warping. We have a few ideas for solutions, and one of them is using the createsprite command, which is a useless command that creates a useless sprite. However, this sprite doesn't take up an NPC space, making it perfect for this.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
I actually had an idea as to how to implement this a while back. So the basic follow-me algorithm is to echo the player's movement one step behind them at all times. My idea was to keep a log of the player's last movement and then apply these movements to whatever dummy sprite there is on the map.

Now obviously this is easier said than done, but I have been led to believe that all player movement uses some shape or form of the "applymovement" command, or at least the function that it is tied to. So if we can attach our logger there, and then apply it to another sprite, then we are good to go.
 
18
Posts
13
Years
I actually had an idea as to how to implement this a while back. So the basic follow-me algorithm is to echo the player's movement one step behind them at all times. My idea was to keep a log of the player's last movement and then apply these movements to whatever dummy sprite there is on the map.

Now obviously this is easier said than done, but I have been led to believe that all player movement uses some shape or form of the "applymovement" command, or at least the function that it is tied to. So if we can attach our logger there, and then apply it to another sprite, then we are good to go.

So, meabe detecting what the player press, we can store what movement he/she does and use it in an "Dynamic Applymovement" ? :P That's what you're saying? ;)
 

daniilS

busy trying to do stuff not done yet
409
Posts
10
Years
  • Age 24
  • Seen Jan 29, 2024
I actually had an idea as to how to implement this a while back. So the basic follow-me algorithm is to echo the player's movement one step behind them at all times. My idea was to keep a log of the player's last movement and then apply these movements to whatever dummy sprite there is on the map.

Now obviously this is easier said than done, but I have been led to believe that all player movement uses some shape or form of the "applymovement" command, or at least the function that it is tied to. So if we can attach our logger there, and then apply it to another sprite, then we are good to go.

AFAIK the player doesn't move with applymovement. I've tried to trace it, but couldn't find anything.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
AFAIK the player doesn't move with applymovement. I've tried to trace it, but couldn't find anything.

You are correct. NPC movement in general is handled purely by ASM code mixed with a little lookup table (trust me, I checked this one out myself when I was developing my own version of this). Said lookup table has 9 entries, of which only 5 are ever used. I can't recall where this lookup table actually is (sorry) but either way, player and NPC movement is handled purely by ASM.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Great news. ShinyQuagsire and I found a macro routine that controls player movement in a similar fashion to applymovement. The next step is to see if we can dump the movements and make another npc follow them. This project will be finished.:D


BTW, shiny never said that applymovement moved the player. He said a system like applymovement. and yes, that is what we found.;)
 
857
Posts
15
Years
Great news. ShinyQuagsire and I found a macro routine that controls player movement in a similar fashion to applymovement. The next step is to see if we can dump the movements and make another npc follow them. This project will be finished.:D


BTW, shiny never said that applymovement moved the player. He said a system like applymovement. and yes, that is what we found.;)

Looking forward to seeing the results. Good luck.
 

Mr.Mako

Resident Edgelord Troll
162
Posts
9
Years
  • Age 27
  • Seen Aug 10, 2023
Um... is this still being worked on or is it dead in the water.
 
Back
Top