• 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

cbd98

A bouquet of oopsie dasies
333
Posts
13
Years
  • Seen Jan 18, 2021
@Full Metal: well i knew the sprite was only animated, but i never really connected that the camera moves. lol stupid me... but this is pretty cool.

anyway i kind of got another idea but im not sure if someone thought of it already. maybe use colcolstyles movement script, and then on border squares put scripts to help moving between maps, as long as colcolstyles didnt put a script on every square.
 

AimayBee

Mighty Spriter
213
Posts
14
Years
You wouldn't need to put a script into every tile in the game. You would just need it on the walkable ones like grass and whatnot.

All you have to do is put it on like moving water tiles or whatever.

Or if your smart enough place it to a movement permission maybe.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
So if the camera only moves, then we could retrieve the last movement before he moves again, and move the person/pokemon to the right, left, top, or bottom, so they'd always be by the center, but not on it. And if the person/pokemon isn't actually an overworld (AKA a sprite on the screen), map switching wouldn't be a problem at all.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
This may sound like a daft question, and it is related, but does ANYONE know how the PLAYER sprite (and only the player sprite) is loaded into the OAM?

If we can find this routine, we can force it to run twice, loading a secondary sprite into a second OAM slot, then rewrite the positioning routine to give the appearance of the sprite following the player. It sounds complicated, but it could actually be quite easy to do. Only thing is, I genuinely just DO NOT understand the OAM.

As for sprites only following under certain circumstances like in DPPt, we can hack the positioning routine for these sprites too to make it appear as if it's following you. The OAM contains all the relevant data for a sprite's location on the game's screen, so if we can work this out fully, we could abuse it to make a follow me routine.

Of course, atm, this completely ignores the script which could need to be attached to the following sprite should you try to speak to it.
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
I'm just a newb, but couldn't you just decompile the original Yellow and convert it. I mean, if Nintendo can easily make the code from scratch it shouldn't be that hard?
 

TheDarkShark

Metal Headed Hacker
56
Posts
13
Years
@EdensElite: Nope, that's not a real option.
And there's a main difference between Nintendo's coders and us (speaking of ROM-hackers in general) : they have a full documentation of their existing code, so they always know where to implement any code or data in the ROM. We will always have to find out first.
BTW: who said that they can easily make the code from scratch? :P
 
Last edited:

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
The following is an example of how to do it with buildings but I can't think of a similar way of using a script when there is a map connection.
You'd probably have to write your own asm script to succeed.

First, you've gotta make a script for the map's script header - a trigger event won't work because when the player steps on the trigger event, the map has already been loaded completely. In addition, the event of the pokemon that follows you must be located somewhere in the map where you write this script. It makes no difference where it is because it's position is going to be re-located anyway.

Here is what kind of script you've to write:
Define that the script of the script header occurs before sprites have been loaded into ram. That way, the sprite of the pokemon that follows you will still stay hidden.
Next, make the script check player's location in the map and according to it, re-locate the hidden sprite so that it will stand behind you. In the end of the script header you define that the sprite of the hidden pokemon is shown again.

After all that is done you write a byte for making the script of the script header end, and the map will load completely.


P.S
If somebody is wondering why I happened to write all this stuff here even though it doesn't give an answer to the problem, I just felt like trying to figure out a way to do this. That's all :)
 

AimayBee

Mighty Spriter
213
Posts
14
Years
colcolstyles has a working follow me...
Just thought I'd point it out.

I do love it that colcolstyles deleted someones post a few posts down from this.

I know people don't want everone to know their scripts because it would become mass produced and not original, but only the best can use it well.

If the script was posted on here people may take it away and make a horrible hack with just a few following scripts and it will die and everything.

But only the best will mae it work into their hack. And isn't this thread about sharing knowledge? What would have happened if Einstein never shared his findings? Or what's his name with the lightbulb?

I believe if it has been found it should be shared. Just saying.
 

Putin

Anspruchsvolle Narr
52
Posts
13
Years
What would have happened if Einstein never shared his findings? Or what's his name with the lightbulb?
Not the best examples (Edison stole the lightbulb from Tesla, along with most things Tesla did, and the most notable result of Einstein's findings at this point in time is still the atom bomb), but yeah, what this guy is saying. Or, you know, throw us a bone, some kind of general idea of the direction we should be working in. I've been wracking my brains for the last month trying to ind a solution to this, and feel no closer, personally.
 

AimayBee

Mighty Spriter
213
Posts
14
Years
Not the best examples (Edison stole the lightbulb from Tesla, along with most things Tesla did, and the most notable result of Einstein's findings at this point in time is still the atom bomb), but yeah, what this guy is saying. Or, you know, throw us a bone, some kind of general idea of the direction we should be working in. I've been wracking my brains for the last month trying to ind a solution to this, and feel no closer, personally.

First, Atom Bomb the most notable? Pah.

Second, GUY?!?! Guy?! I will eat your brains. -.-

Third, what you said has never been proven.

And fourth, if they can do it, we can do it. :P
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I do love it that colcolstyles deleted someones post a few posts down from this.

I know people don't want everone to know their scripts because it would become mass produced and not original, but only the best can use it well.

If the script was posted on here people may take it away and make a horrible hack with just a few following scripts and it will die and everything.

But only the best will mae it work into their hack. And isn't this thread about sharing knowledge? What would have happened if Einstein never shared his findings? Or what's his name with the lightbulb?

I believe if it has been found it should be shared. Just saying.

I got it, but I'm not about to spread it around until/if he decides to share it.
 

Putin

Anspruchsvolle Narr
52
Posts
13
Years
First, Atom Bomb the most notable? Pah.

Second, GUY?!?! Guy?! I will eat your brains. -.-

Third, what you said has never been proven.

And fourth, if they can do it, we can do it. :P
Sorry about the "guy" thing, but I stand by everything else I said. And on the final note, of course, but it's considerably easier and more efficient if we have something predefined to work from.
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
I had an idea. When I was spriting earlier, I noticed that the surf thing and the trainer are separate. This must mean the surf thing has been programmed to always be under you and change direction with you. If you found the offset, copied and edited the routine so it's back a tile, well I'm just guessing because i'm not a coder, but perhaps applied the routine to an offset where a pokemon i.e pikachu is stored it could potentially work, with a bit of work.
 

Putin

Anspruchsvolle Narr
52
Posts
13
Years
I had an idea. When I was spriting earlier, I noticed that the surf thing and the trainer are separate. This must mean the surf thing has been programmed to always be under you and change direction with you. If you found the offset, copied and edited the routine so it's back a tile, well I'm just guessing because i'm not a coder, but perhaps applied the routine to an offset where a pokemon i.e pikachu is stored it could potentially work, with a bit of work.
I think it would cause it to always be on the tile below or to the left of you or whatever, but perhaps storing the player's movements and making the sprite replicate the last one executed when the player moves, so that if it is to the left of you and you move up it will come under you?

I have very little experience with ASM, and, come to think of it, my C and Java are getting kind of rusty. I should really get back into coding.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I think it would cause it to always be on the tile below or to the left of you or whatever, but perhaps storing the player's movements and making the sprite replicate the last one executed when the player moves, so that if it is to the left of you and you move up it will come under you?

I have very little experience with ASM, and, come to think of it, my C and Java are getting kind of rusty. I should really get back into coding.

Well, you have more experience with THUMB than you think, because it's just compiled C.

I followed up on Eden's Elite's idea and found the OAM data in the RAM. In this data is information for the sprite, location of the sprite (in pixels) and various other useful stuff. My thinking was to override the x and y co-ordinates of a given sprite.

However, the OAM prioritises sprites in a slightly odd manner, with only the player sprite seemingly remaining static.

I understand WHY it prioritises the sprites but not how. Anyway, this is a very good first step towards follow me as we could theoretically make a sprite follow the player after it has been placed on the screen.

I'm well aware that colcolstyles has made a follow me, but if he's not willing to share it (which is his perogative), we'll need to develop it from scratch.
 
Last edited:
581
Posts
17
Years
Not the best examples (Edison stole the lightbulb from Tesla, along with most things Tesla did, and the most notable result of Einstein's findings at this point in time is still the atom bomb), but yeah, what this guy is saying. Or, you know, throw us a bone, some kind of general idea of the direction we should be working in. I've been wracking my brains for the last month trying to ind a solution to this, and feel no closer, personally.

Uhm.. what?

Einstein didn't really invent, "find" or do anything about the atomic bombs, besides writing the letters to Roosevelt. But I wouldn't say that's the most noteable he did. (Photoelectric effect, Relativity and Brownian motion?)

Uhh, and then having crazy hair!
 

EdensElite

No0b, but getting there.
190
Posts
12
Years
  • Age 29
  • UK
  • Seen Jul 4, 2014
Wait, did I actually make a relevant discovery xD

Yeah, I thought the main troubles would be that the trainer would be static (This isn't a problem for the pokemon as it has two frames bobbing up and down, you would just need to extend the amount of frames) and the event that would bring the pokemon into the game, as surfing requires manual interaction. If you could bypass this somehow so that it does it automatically or perhaps the event could be actually clicking on a pikachu ball at the start of the game and from then on the event wouldn't end. It is a problem :L
 
Back
Top