• 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

Omega Zero

Is back...
444
Posts
14
Years
well i tryed something before that sort of worked but took up alot of space instead of looping the script it goes setvar 0x7001 0x1
at the end normally you put something like
#org @finish
goto @something (to repeat it but i tryed this )
end

#org @finish
end

then made a new script
#org @start
setvar 0x7001 0x0
release
end

and it kinda worked but the pikachu kept instantly coming to you and it would take up WAY to much space
 

OM3GA Umbr30n

Was Mazot2
123
Posts
14
Years
  • Age 26
  • UK
  • Seen Mar 3, 2010
i have an idea it would take a while but work,
have a script on every tile that uses a flag to check what starter u chose then sets ow then makes the sprite turn your direction and move towards you once every time u move.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
i have an idea it would take a while but work,
have a script on every tile that uses a flag to check what starter u chose then sets ow then makes the sprite turn your direction and move towards you once every time u move.
That idea's been thought of, tried, and failed... sorry.
I'm afraid this will have some ASM with it...
 

NatureKeeper

Guest
0
Posts
Maybe co-ordinate comparing will do?

An assembly first checks the current pressed button:

Up
Down
Left
Right and compare co-ordinates:

e,g: Left\Right, coordinate 0,1 from player, Sprite down.
Up, coordinate 0,1, Sprite down.

detects the sprite number in the map of a map that is set in a variable.

This is an example from Luminous Yellow.

'----------------' Extract
msgbox @1 MSG_YESNO
compare LASTRESULT 0x1
if 0x0 call @end
showsprite 0x10
setvar 0x7000 0x10
callasm 0xunsetyet
msgbox @3 0x6

'---' cut

#org @1
= Ok!\nYour RIOLU is allowed.\lWould you like him\lto follow you around?

#org @3
= Have fun~!
''--'' end

level script for houses

'---'
compare 0x7000 0x10
if 0x0 goto @end
showsprite 0x10
callasm 0xunset
'---'

I don't have the routine yet. T_T

All scripts copyrighted.
 
5,256
Posts
16
Years
Couldn't you use getplayerpos, store the x and y in a variable, and then subtract one from the y var if the player's facing up, add one to the y var if the players facing down, etc. and then create the OW for the Pokémon in that position?

At least I think that'd work - it would depend on if there is a way on checking where the player's facing in a level script - I'm not sure if it's possible.

Then again, what do I know?
 

558122_DG

Learning how to make mistakes
737
Posts
14
Years
  • Seen May 27, 2021
i think the simple faceplayer should fix that prob :)
ur gonna need the same amount of OW in the end :)
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Couldn't you use getplayerpos, store the x and y in a variable, and then subtract one from the y var if the player's facing up, add one to the y var if the players facing down, etc. and then create the OW for the Pokémon in that position?

At least I think that'd work - it would depend on if there is a way on checking where the player's facing in a level script - I'm not sure if it's possible.

Then again, what do I know?

Of course there is a way to check which way the player is facing... But this script wouldn't make the Pokemon walk it would just make it appear behind the player, plus it wouldn't work when changing maps.
 

Giga Universe

Working on a tool.
121
Posts
16
Years
Couldn't you use getplayerpos, store the x and y in a variable, and then subtract one from the y var if the player's facing up, add one to the y var if the players facing down, etc. and then create the OW for the Pokémon in that position?

At least I think that'd work - it would depend on if there is a way on checking where the player's facing in a level script - I'm not sure if it's possible.

Then again, what do I know?

If you had bothered to check my script, you would see I had done exactly that. If you want to fix this, then you will need a way to activate my script in a way the still allows the player to move if you do not use the 'applymovement 0xFF @pointer' bits. The map to map script worked on my script, just as long as you placed an overworld on every map. I have managed to solve many of these problems, yet I am completely stumped when it comes to removing the loop.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years


If you had bothered to check my script, you would see I had done exactly that. If you want to fix this, then you will need a way to activate my script in a way the still allows the player to move if you do not use the 'applymovement 0xFF @pointer' bits. The map to map script worked on my script, just as long as you placed an overworld on every map. I have managed to solve many of these problems, yet I am completely stumped when it comes to removing the loop.

That's your problem, if you remove the loop, the script will no longer work for you because of how you wrote it.
You'll need to make your script branch off once movement of the second sprite is completed, and end the script.
The other thing wrong, is that as soon as you do that, the script will most likely be really buggy... actually, I guarantee it will be buggy, and broken. And this script will take up some serious space in your hack. (The script itself, and then like 9 or more bytes for every map you apply it to.

Not to mention have you made a workaround for when the player jumps off a cliff?
What about running speed? (If you are running, the sprite won't change speed with you, it will cause you to stop moving for a second or two while it walks.)

Don't even get me started on biking... (Same as running, more severe.)

Flight would not be bad, except when you fly, you leave your pokemon behind momentarily.
Surfing? No way buddy, not only would the pokemon try to follow you in the water, but it would be left behind by one tile.

And what about interfering scripts?

There are simply too many factors in place for your script to work under ANY condition.
And besides, you require JPAN's patch for it, we try to find solutions for people that don't use it, so that it will be available to ANYONE.

This is a job for ASM, I'm only learning ASM at the moment, so I am of little use... I can read it, I just don't know exactly how to apply it.

*cough*Would be helpful if there was another ASM tutorial...*cough*

[EDIT] I just realized... How would your script work for the player walking down onto another map or from the left, Since (I assume) the sprite X/Y coordinates are stored in an UNSIGNED byte, wouldn't that mean that there can't be a -1 for your sprite to rest on? Or does it not require a signed byte? I have not tested this at all, but I knew it was a problem from the start.

(For reference, an unsigned byte has a range of 0 to 255, whereas a signed byte has a range from -127 to 127)
 
Last edited:

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
[EDIT] I just realized... How would your script work for the player walking down onto another map or from the left, Since (I assume) the sprite X/Y coordinates are stored in an UNSIGNED byte, wouldn't that mean that there can't be a -1 for your sprite to rest on? Or does it not require a signed byte? I have not tested this at all, but I knew it was a problem from the start.

(For reference, an unsigned byte has a range of 0 to 255, whereas a signed byte has a range from -127 to 127)

Actually, last time I checked they were signed 16-bit values.
 
788
Posts
17
Years
  • Age 29
  • Seen Mar 28, 2024
There are other issues too. What if the player is standing against a border (such as a cliff) but facing away from it? Wouldn't the Pokemon following you appear on the border? That wouldn't look very good.
 

Giga Universe

Working on a tool.
121
Posts
16
Years
There are other issues too. What if the player is standing against a border (such as a cliff) but facing away from it? Wouldn't the Pokemon following you appear on the border? That wouldn't look very good.

That would not be a problem. Even in my script which does not work properly, the script runs only on the move, not the face. So if you tap a button and the player changes facing, the follower does nothing. However, if the player moves - it moves. So therefore, your situation would not happen, as to change the follower so it would be on the border, you would have to step away from the border. Therefore, the follower would not be on the border. Basically, long story short - in the ideal script (even in mine which is clearly not ideal), your situation will not occur.
 
788
Posts
17
Years
  • Age 29
  • Seen Mar 28, 2024


That would not be a problem. Even in my script which does not work properly, the script runs only on the move, not the face. So if you tap a button and the player changes facing, the follower does nothing. However, if the player moves - it moves. So therefore, your situation would not happen, as to change the follower so it would be on the border, you would have to step away from the border. Therefore, the follower would not be on the border. Basically, long story short - in the ideal script (even in mine which is clearly not ideal), your situation will not occur.

Oh, sorry. I assumed that you were basing it on the way they were facing. My bad.
 

OM3GA Umbr30n

Was Mazot2
123
Posts
14
Years
  • Age 26
  • UK
  • Seen Mar 3, 2010
FIRSTLY!
*BUMP*
Secondly
couldnt you edit the bike and running routines to check if i pokemon is following you and if it is speed that up aswell except with the bike make the pokemon go into the pokeball like in HG/sS?
thirdly
would it be a good or bad idea to make the pokemon walthrough-able so that if the player gets trapped the player moves to where the pokemon was and the pokemon goes to where the player was using the script?
so that is a few problems fixed, but i was thinking to fix the moving maps problem could u not place a script with an OW at the mouth of all the entrances so that the script at the mouth will cause the OW there to do the following? and also how would you hide the OW from the last map? my only problem... the only othe solution i have for fixing map to map would be instead of using connections how about a warp without an animation so it moves you to the correct place as if it was a connection but it wouldnt show like a black screen etc.

~Umbreon
The hacker of logic
 

Giga Universe

Working on a tool.
121
Posts
16
Years
No, the solution to this isn't scripting. It is impossible to get a script working, there are all sorts of problems. The goal is to get this into an ASM routine, NOT a script. So yes, we would have to edit biking, surfing, flying, etc routines in order to build one. Besides My script already allows you to do that, and I'm sure Omega's does too. But I'm sure that there are a lot more bugs in his script that just the map transporting bug.
 
Last edited:

.:batto:.

Pokébreeder
266
Posts
15
Years
Yes Ive Tried Hundreds Of Times To Make Sucessful "follow Me" Scripts
i did not know that its back in heart gold and soul silver tho...:o
 

NatureKeeper

Guest
0
Posts
I have already an idea on what to do, but it includes big time ASM.

Like I said, it is the same idea from before, but with an improvement.

The ASM routine of the bike will be edited, so the variable I am using is set to zero, which is no Pokémon follow you around. (That includes both Mach and Acro.) How? Well, when you press the bike, variable XX is erased. After you dis-activate the bicycle, it calls the very script that allows the sprite of the desired Pokémon to appear beside the player according to the level of the map and the accessibility (C is accessible, but D isn't for instance, and if the player is at C, the Pokémon cannot warp to like 10. And if the player is on 0, the Pokémon disappears until the player goes on a level. Same for 3C and other relative levels.)

Running. Simply, change the done applymovement called by ASM after comparison and checking into a higher speed.

Flying: When you chose an HM to use, even Cut and Rock Smash, the Pokémon will be temporarily hidden. How? Well, fly needs a change in routine, and other simples will just have hidesprite 0x and showsprite 0x added to their main script. Common sense FTW!

Surfing: The routine will be edited just like Bike, Fly and Surf. Meh, meh.

When healing: The Pokémon will temporarily appear.

This'll need a routine to check maps, and also needs a sprite in each map and a level script. These can be done in advance. If you wish the sprite just to do exactly like HGSS without putting a sprite or a LS in each map, then we have to edit the game's engine.
 
Last edited:
Back
Top