PDA

View Full Version : The Follow Me Script


Pages : [1] 2

Touched
January 3rd, 2010, 01:31 AM
We all know what this is, so I'll cut to the chase. This is basically fully working - an example can be seen in GoGo's hack, Platinum Red (and eventually Blue). This is basically all we have so far:

boRbK37qP5o

The code for doing this has been open sourced, and is available on my GitHub, here (https://github.com/Touched/FollowMe). You're welcome to fork and send me pull requests if you have anything to contribute. Any bugs or issues should also be reported on GitHub rather than in this thread.

I will post build instructions soon.

Gamer2020
January 3rd, 2010, 10:21 AM
Well maybe you can have some kind of level script.
This is just an idea but the script can check to see if this certain sprite is following you and have the "same" sprite appear on the map.
Idk if I explained my idea right and I'm not sure if it's possible since I don't remember if flags can be used in level scripts. I don't remember exactly at this time but still there are always variables.

It's just an idea don't kill me...

ZodiacDaGreat
January 3rd, 2010, 11:42 AM
Uh, level scripts are out of the picture here XD And as for the routine, I don't thinking hacking the keypress routine is a good idea. Anyway, here's my idea... Who know's you might see one in Pure Gold too ;)

Part 1 - We hack the sprite loading routine and load a extra sprite... But not just anywhere :P This sprite should be the last, as Map overworlds might overwrite this. Then, we hack a routine that's executed a lot. What this routine does, is:
1) Check for a flag - A flag must be set meaning that the sprite can follow the player.
2) Check the party - To see if the overworld (Pikachu, or what so ever) is in the party.
3) Other checks - whether Pikachu has evolved or not and so on...

Should any of these previous checks fail then the sprite does not appear and follow the player. But once the conditions are fulfilled, the routine will take the player's position and calculate it for the overworld, so it'll be following it.

interdpth
January 3rd, 2010, 01:28 PM
The games all have a function which happens everytime you take a step. Like the check for poision or an egg hatching happens in this function I have the offsets for FR/LG. So if you could hack the function and throw a script execution in, this would enable you to have following pokemon.

Co500
January 3rd, 2010, 01:49 PM
What about if someone find the script or asm or evel script in yellow and translate it to the newer GBA generation?

DreadWaffle
January 3rd, 2010, 04:41 PM
i think this may help
http://www.pokecommunity.com/showpost.php?p=5398985&postcount=2695
thank you giga!

0m3GA ARS3NAL
January 3rd, 2010, 05:45 PM
What about if someone find the script or asm or evel script in yellow and translate it to the newer GBA generation?
You can not do that, nuff said.



Well, his script is... interesting at best, at least in this context.
I've had a script written out that was quite long indeed, it worked almost exactly like this, only I hadn't thought to use the movesprite command.

The problem is, you have to take into account other sprites on the map, small cliffs the player can jump off of, and things like that.
And no doubt we want to be able to supply this to hackers NOT using JPAN's Hacked Engine.

(Very possible, as we can just as easily check what button the player is pressing by comparing to a number found in a certain area of the RAM. (I knew what it was, but my memory has gotten a bit rusty, haven't gotten so fired up about hacking in a long time. (That is why I am going to post, and contribute a lot to PC's R&D department, lol)))

Anywho, I like Zodiac's idea a lot, and I like interdpth's too... problem is, actually hacking the routine's needed.
I wish I could help with that, WHEN ARE YOU GUYS RELEASING ANOTHER ASM TUT?!?! lol

So, are we going to take interdpth's route? If so, I'll get writing... I've made the script once before, no harm in writing it again...

davidthefat
January 3rd, 2010, 07:18 PM
http://www.emu8086.com/dr/asm2html/assembler_source_code/snake.asm.html

thats the ASM code for snake (the really old game) You can look at that and figure out how they handle that. I have no idea what that ASM mumbo jumbo means

http://www.zophar.net/pdroms/gba/christmas-advance.html

thats a gba one


personally I would make the pokemon check for collision before moving.

colcolstyles
January 3rd, 2010, 07:29 PM
I believe that the key register is located at 0x4000130. In my opinion, interdpth has the best idea. If he has the address of that routine, we can examine it. Otherwise, I guess just run a ROM with VBA-SDL-H and put a breakpoint on 0x4000130 and try to locate that routine. davidthefat also makes an excellent point about the location of the hack; we don't want to put it before anything important such as collision detection or behavior data like, as 0m3GA said, those ledges that the player jumps over.

interdpth
January 3rd, 2010, 08:00 PM
here's the function

SAME FOR FR/LG

ROM:0806D698 EachStepTests ; CODE XREF: sub_806D5E8+36p
ROM:0806D698 PUSH {R4,LR} ; Push registers
ROM:0806D69A LSLS R0, R0, #0x10 ; Logical Shift Left
ROM:0806D69C LSRS R4, R0, #0x10 ; Logical Shift Right
ROM:0806D69E BL sub_811B0D0 ; Branch with Link
ROM:0806D69E
ROM:0806D6A2 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6A4 BEQ loc_806D72C ; Branch
ROM:0806D6A4
ROM:0806D6A6 LDR R0, =byte_203ADFA ; Load from Memory
ROM:0806D6A8 LDRB R0, [R0] ; Load from Memory
ROM:0806D6AA CMP R0, #2 ; Set cond. codes on Op1 - Op2
ROM:0806D6AC BEQ loc_806D72C ; Branch
ROM:0806D6AC
ROM:0806D6AE BL sub_806D74C ; Branch with Link
ROM:0806D6AE
ROM:0806D6B2 LDR R0, =dword_2037078 ; Load from Memory
ROM:0806D6B4 LDRB R1, [R0] ; Load from Memory
ROM:0806D6B6 MOVS R0, #0x40 ; '@' ; Rd = Op2
ROM:0806D6B8 ANDS R0, R1 ; Rd = Op1 & Op2
ROM:0806D6BA CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D6BC BNE safari ; Branch
ROM:0806D6BC
ROM:0806D6BE LSLS R0, R4, #0x18 ; Logical Shift Left
ROM:0806D6C0 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6C2 BL sub_8059D70 ; Branch with Link
ROM:0806D6C2
ROM:0806D6C6 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6C8 CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D6CA BNE safari ; Branch
ROM:0806D6CA
ROM:0806D6CC BL sub_810C4EC ; Branch with Link
ROM:0806D6CC
ROM:0806D6D0 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6D2 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6D4 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6D6 BNE poison ; Branch
ROM:0806D6D6
ROM:0806D6D8 LDR R0, =EachStep ; Load from Memory
ROM:0806D6DA BL DoScript ; Branch with Link
ROM:0806D6DA
ROM:0806D6DE B fin ; Branch
ROM:0806D6DE
ROM:0806D6DE ; ---------------------------------------------------------------------------
ROM:0806D6E0 off_806D6E0 DCD byte_203ADFA ; DATA XREF: EachStepTests+Er
ROM:0806D6E4 off_806D6E4 DCD dword_2037078 ; DATA XREF: EachStepTests+1Ar
ROM:0806D6E8 off_806D6E8 DCD EachStep ; DATA XREF: EachStepTests+40r
ROM:0806D6EC ; ---------------------------------------------------------------------------
ROM:0806D6EC
ROM:0806D6EC poison ; CODE XREF: EachStepTests+3Ej
ROM:0806D6EC BL CheckForPoison ; Branch with Link
ROM:0806D6EC
ROM:0806D6F0 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6F2 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6F4 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6F6 BNE eggs ; Branch
ROM:0806D6F6
ROM:0806D6F8 LDR R0, =EachStepPoison ; Load from Memory
ROM:0806D6FA BL DoScript ; Branch with Link
ROM:0806D6FA
ROM:0806D6FE B fin ; Branch
ROM:0806D6FE
ROM:0806D6FE ; ---------------------------------------------------------------------------
ROM:0806D700 off_806D700 DCD EachStepPoison ; DATA XREF: EachStepTests+60r
ROM:0806D704 ; ---------------------------------------------------------------------------
ROM:0806D704
ROM:0806D704 eggs ; CODE XREF: EachStepTests+5Ej
ROM:0806D704 BL sub_80463B8 ; Branch with Link
ROM:0806D704
ROM:0806D708 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D70A CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D70C BEQ safari ; Branch
ROM:0806D70C
ROM:0806D70E MOVS R0, #0xD ; Rd = Op2
ROM:0806D710 BL btl2_8054E90 ; Branch with Link
ROM:0806D710
ROM:0806D714 LDR R0, =script_EggHatch ; Load from Memory
ROM:0806D716 BL DoScript ; Branch with Link
ROM:0806D716
ROM:0806D71A B fin ; Branch
ROM:0806D71A
ROM:0806D71A ; ---------------------------------------------------------------------------
ROM:0806D71C off_806D71C DCD script_EggHatch ; DATA XREF: EachStepTests+7Cr
ROM:0806D720 ; ---------------------------------------------------------------------------
ROM:0806D720
ROM:0806D720 safari ; CODE XREF: EachStepTests+24j
ROM:0806D720 ; EachStepTests+32j
ROM:0806D720 ; EachStepTests+74j
ROM:0806D720 BL CheckSafariSteps ; Branch with Link
ROM:0806D720
ROM:0806D724 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D726 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D728 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D72A BEQ fin ; Branch
ROM:0806D72A
ROM:0806D72C
ROM:0806D72C loc_806D72C ; CODE XREF: EachStepTests+Cj
ROM:0806D72C ; EachStepTests+14j
ROM:0806D72C MOVS R0, #0 ; Rd = Op2
ROM:0806D72E B loc_806D732 ; Branch
ROM:0806D72E
ROM:0806D730 ; ---------------------------------------------------------------------------
ROM:0806D730
ROM:0806D730 fin ; CODE XREF: EachStepTests+46j
ROM:0806D730 ; EachStepTests+66j
ROM:0806D730 ; EachStepTests+82j
ROM:0806D730 ; EachStepTests+92j
ROM:0806D730 MOVS R0, #1 ; Rd = Op2
ROM:0806D730
ROM:0806D732
ROM:0806D732 loc_806D732 ; CODE XREF: EachStepTests+96j
ROM:0806D732 POP {R4} ; Pop registers
ROM:0806D734 POP {R1} ; Pop registers
ROM:0806D736 BX R1 ; Branch to/from Thumb mode
ROM:0806D736
ROM:0806D736 ; End of function EachStepTests
ROM:0806D736

0m3GA ARS3NAL
January 3rd, 2010, 08:14 PM
here's the function

SAME FOR FR/LG

ROM:0806D698 EachStepTests ; CODE XREF: sub_806D5E8+36p
ROM:0806D698 PUSH {R4,LR} ; Push registers
ROM:0806D69A LSLS R0, R0, #0x10 ; Logical Shift Left
ROM:0806D69C LSRS R4, R0, #0x10 ; Logical Shift Right
ROM:0806D69E BL sub_811B0D0 ; Branch with Link
ROM:0806D69E
ROM:0806D6A2 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6A4 BEQ loc_806D72C ; Branch
ROM:0806D6A4
ROM:0806D6A6 LDR R0, =byte_203ADFA ; Load from Memory
ROM:0806D6A8 LDRB R0, [R0] ; Load from Memory
ROM:0806D6AA CMP R0, #2 ; Set cond. codes on Op1 - Op2
ROM:0806D6AC BEQ loc_806D72C ; Branch
ROM:0806D6AC
ROM:0806D6AE BL sub_806D74C ; Branch with Link
ROM:0806D6AE
ROM:0806D6B2 LDR R0, =dword_2037078 ; Load from Memory
ROM:0806D6B4 LDRB R1, [R0] ; Load from Memory
ROM:0806D6B6 MOVS R0, #0x40 ; '@' ; Rd = Op2
ROM:0806D6B8 ANDS R0, R1 ; Rd = Op1 & Op2
ROM:0806D6BA CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D6BC BNE safari ; Branch
ROM:0806D6BC
ROM:0806D6BE LSLS R0, R4, #0x18 ; Logical Shift Left
ROM:0806D6C0 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6C2 BL sub_8059D70 ; Branch with Link
ROM:0806D6C2
ROM:0806D6C6 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6C8 CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D6CA BNE safari ; Branch
ROM:0806D6CA
ROM:0806D6CC BL sub_810C4EC ; Branch with Link
ROM:0806D6CC
ROM:0806D6D0 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6D2 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6D4 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6D6 BNE poison ; Branch
ROM:0806D6D6
ROM:0806D6D8 LDR R0, =EachStep ; Load from Memory
ROM:0806D6DA BL DoScript ; Branch with Link
ROM:0806D6DA
ROM:0806D6DE B fin ; Branch
ROM:0806D6DE
ROM:0806D6DE ; ---------------------------------------------------------------------------
ROM:0806D6E0 off_806D6E0 DCD byte_203ADFA ; DATA XREF: EachStepTests+Er
ROM:0806D6E4 off_806D6E4 DCD dword_2037078 ; DATA XREF: EachStepTests+1Ar
ROM:0806D6E8 off_806D6E8 DCD EachStep ; DATA XREF: EachStepTests+40r
ROM:0806D6EC ; ---------------------------------------------------------------------------
ROM:0806D6EC
ROM:0806D6EC poison ; CODE XREF: EachStepTests+3Ej
ROM:0806D6EC BL CheckForPoison ; Branch with Link
ROM:0806D6EC
ROM:0806D6F0 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D6F2 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D6F4 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D6F6 BNE eggs ; Branch
ROM:0806D6F6
ROM:0806D6F8 LDR R0, =EachStepPoison ; Load from Memory
ROM:0806D6FA BL DoScript ; Branch with Link
ROM:0806D6FA
ROM:0806D6FE B fin ; Branch
ROM:0806D6FE
ROM:0806D6FE ; ---------------------------------------------------------------------------
ROM:0806D700 off_806D700 DCD EachStepPoison ; DATA XREF: EachStepTests+60r
ROM:0806D704 ; ---------------------------------------------------------------------------
ROM:0806D704
ROM:0806D704 eggs ; CODE XREF: EachStepTests+5Ej
ROM:0806D704 BL sub_80463B8 ; Branch with Link
ROM:0806D704
ROM:0806D708 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D70A CMP R0, #0 ; Set cond. codes on Op1 - Op2
ROM:0806D70C BEQ safari ; Branch
ROM:0806D70C
ROM:0806D70E MOVS R0, #0xD ; Rd = Op2
ROM:0806D710 BL btl2_8054E90 ; Branch with Link
ROM:0806D710
ROM:0806D714 LDR R0, =script_EggHatch ; Load from Memory
ROM:0806D716 BL DoScript ; Branch with Link
ROM:0806D716
ROM:0806D71A B fin ; Branch
ROM:0806D71A
ROM:0806D71A ; ---------------------------------------------------------------------------
ROM:0806D71C off_806D71C DCD script_EggHatch ; DATA XREF: EachStepTests+7Cr
ROM:0806D720 ; ---------------------------------------------------------------------------
ROM:0806D720
ROM:0806D720 safari ; CODE XREF: EachStepTests+24j
ROM:0806D720 ; EachStepTests+32j
ROM:0806D720 ; EachStepTests+74j
ROM:0806D720 BL CheckSafariSteps ; Branch with Link
ROM:0806D720
ROM:0806D724 LSLS R0, R0, #0x18 ; Logical Shift Left
ROM:0806D726 LSRS R0, R0, #0x18 ; Logical Shift Right
ROM:0806D728 CMP R0, #1 ; Set cond. codes on Op1 - Op2
ROM:0806D72A BEQ fin ; Branch
ROM:0806D72A
ROM:0806D72C
ROM:0806D72C loc_806D72C ; CODE XREF: EachStepTests+Cj
ROM:0806D72C ; EachStepTests+14j
ROM:0806D72C MOVS R0, #0 ; Rd = Op2
ROM:0806D72E B loc_806D732 ; Branch
ROM:0806D72E
ROM:0806D730 ; ---------------------------------------------------------------------------
ROM:0806D730
ROM:0806D730 fin ; CODE XREF: EachStepTests+46j
ROM:0806D730 ; EachStepTests+66j
ROM:0806D730 ; EachStepTests+82j
ROM:0806D730 ; EachStepTests+92j
ROM:0806D730 MOVS R0, #1 ; Rd = Op2
ROM:0806D730
ROM:0806D732
ROM:0806D732 loc_806D732 ; CODE XREF: EachStepTests+96j
ROM:0806D732 POP {R4} ; Pop registers
ROM:0806D734 POP {R1} ; Pop registers
ROM:0806D736 BX R1 ; Branch to/from Thumb mode
ROM:0806D736
ROM:0806D736 ; End of function EachStepTests
ROM:0806D736


Sweet
I think that if one were to branch off into the movement of a second sprite, it would be important to do that, BEFORE the Poison and Egg Checks.
I don't know if it would make any difference, but if the second sprite moves after an egg hatches, then would the second sprite move? Or would it sit there, and end up de-syncing with the player?

Also, I have East Asian Language Suppourt on for programs, so any letters that aren't normal, show up as Chinese... what is "EachStepTests+7Cr"
But more importantly, what is the +7Cr thing?
All I see after the C is a strange box that looks like...
___
|00|
|18|

Sorry for the crappy ASCII representation...

interdpth
January 3rd, 2010, 08:16 PM
It's supped to be an up arrow xD

JPAN
January 3rd, 2010, 08:21 PM
The games all have a function which happens everytime you take a step. Like the check for poision or an egg hatching happens in this function I have the offsets for FR/LG. So if you could hack the function and throw a script execution in, this would enable you to have following pokemon.

I have recently developed for my engine a hack that allows you to activate a script every time you take a step. Oddly enough, it was inspired by the two subjects on this section, the RNG-generated weather and the Follow me scripts, both requiring level scripts and only able to be executed once each map load.
Anyway, after some testing, that caused some problems that quickly become bothersome, like the fact waitmovement is a blocking function, and every step you need to wait for the other OW to follow you. That creates a form of lag that is slightly irritating, as walking has to stop each step it takes, and running is nearly impossible. I won't even get started with the bike... So, my approach was trying some of the other possible walking actions, like trainer events, but halt me nontheless. What I think is, by altering Waitmovement (or creating a spinoff) so that we have a movement-applying function that doesn't block us, it might be possible.

The other option, a level event, has so many checks required that the script would be gigantic. Remember that, with your custom moving around, you also need to check for movement permissions, behaviour bytes, wild battles, activate animations, call scripts, warps... And it must be the same one for all maps. In other words, you would have to script the game engine.

(Very possible, as we can just as easily check what button the player is pressing by comparing to a number found in a certain area of the RAM.
There are several locations with the Key configuration, but the most important here would be the game ones, located at 03003118, 0300311a and 0300311c. the difference between them is that 118 keeps a real keymap at all times, where 11a keeps only instant-keymaps (key presses, not key holds), and 11c keeps a keymap where in-game options were applied(like R = A). Because I don't know where the keys are found in-game other than in FR, 0x04000130 is the GBA location, but keep in mind the keys here are inverted, that is 0x3ff = no keys pressed.

ZodiacDaGreat
January 3rd, 2010, 08:22 PM
It's supped to be an up arrow xD
lol, yeah that's IDA Pro :P Anyway, I believe all games have a step counter or something, it increments every time the player takes a step.

HackChu
January 4th, 2010, 12:52 PM
JPAN is right I have thought of all kinds of scenarios for my yellow hack not even would you worry about a pokemon follow you but a script would be needed to make sure if a pokemon is deposited the ow would disappear and stuff, in other words ALOT of scripting needed for this and lets not start on backsprite recognization.

Spherical Ice
January 4th, 2010, 01:08 PM
HAI Y DONT U ASK PKMN LEEG CHMP BECOZ GREEN SAFIRE HAS IT!!!!!!!!!!!!!!!!!!!!!!!!!

-cough-

Good luck on this, guys. It's a shame I have hardly any knowledge in ASM/hex, but you know JPAN's hack has key recognition? I'm unsure if it's possible, but couldn't you manipulate it so that if START or SELECT or whatever, the OW comes out and then the script is executed or something? I don't know - the idea doesn't contribute much, I know, sorry. D:

Pokepal17
January 4th, 2010, 01:11 PM
Guys there's a "copy player" movement in Advance Map. Now I was able to make some sort of following from that but I think the ASM of that movement could be the key for this. The only problem is that when you push against the OW, the OW will move away a bit. Now I'm wondering if the routine could be edited then it'd work right. But then we'd have the depositing and entering maps to try and figure out. So, I think if we focus on the following and worry about the other bits later, this could be acheived. ;)

davidthefat
January 4th, 2010, 06:29 PM
I might have a solution for the map to map transition, make it OK for the pokemon to be on the same tile as the player but never 1 away from it. So make it if the player did not move, the poke does not move either, just dont check for collison for the pokemon, only player

interdpth
January 4th, 2010, 06:56 PM
Map to map transition is easy, just create the sprite virtually via a script! :)

Omega Zero
January 4th, 2010, 07:09 PM
Well as Full metal said that the reason giga universe's script isn't letting him interact with anything and Full metal said it was cause the game is checking for button presses

0m3GA ARS3NAL
January 4th, 2010, 07:17 PM
Map to map transition is easy, just create the sprite virtually via a script! :)

Whenever I tried it didn't work as I thought... would it work? Could we make it tangible so we can talk to it?

Well as Full metal said that the reason giga universe's script isn't letting him interact with anything and Full metal said it was cause the game is checking for button presses

Not exactly, he is stuck in an eternal loop...

Omega Zero
January 4th, 2010, 07:29 PM
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
January 5th, 2010, 02:56 AM
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
January 5th, 2010, 03:06 AM
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
January 5th, 2010, 10:00 AM
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.

Spherical Ice
January 6th, 2010, 07:58 AM
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
January 6th, 2010, 05:12 PM
i think the simple faceplayer should fix that prob :)
ur gonna need the same amount of OW in the end :)

Darthatron
January 6th, 2010, 06:32 PM
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
January 17th, 2010, 05:03 AM
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
January 17th, 2010, 11:38 AM
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)

HackMew
January 24th, 2010, 02:41 AM
[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.

0m3GA ARS3NAL
January 24th, 2010, 06:05 AM
Actually, last time I checked they were signed 16-bit values.

I see... well, then i guess it may be easier to understand.

pspdude
January 24th, 2010, 06:46 PM
this is sumthing i found: http://www.youtube.com/user/Mohh2haxer#p/u/1/22lSulNBcE8 i know its only an OW tho

Omega Zero
January 24th, 2010, 09:36 PM
Well that wouldn't help at all >_> it's an overworld not a person on Advance map..

Sagiri
January 31st, 2010, 03:56 PM
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
February 1st, 2010, 06:15 AM
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.

Sagiri
February 1st, 2010, 08:52 AM
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
March 2nd, 2010, 02:28 PM
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
March 4th, 2010, 04:12 AM
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.

.:batto:.
March 14th, 2010, 10:19 PM
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
March 27th, 2010, 08:57 PM
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.

NarutoActor
April 14th, 2010, 06:14 PM
Okay you know the problem about the time of exicution of the movement? Well i was thinking about changing the asm routine that moves the player when pressing a directional key, to not just move the player but also pickachu.

Shiny Quagsire
April 15th, 2010, 06:09 AM
Or, maybe there is a list of the players movements, and the pikachu echo's the movement.

Full Metal
May 9th, 2010, 12:15 PM
hm..rather than modding the keypress event, mod the player-move event?
that should help speed things up a little. let me do a little "mockup" in C/pokemon style code-thingy
<key has been pushed>
moveplayer (getplayerx()+1,getplayery()+1)
if (pokemonfollowmode!=0)
{
moveow(pokemon_ow [has been pre-determined],getplayerx()-1,getplayery()-1)
}
then, you simply choose an address to use for the "pokemonfollowmode" byte, and add a
push {r0}
ldr r0, address
strh #1,[r0,#0]
pop {r0}
just out of curiosity:
could i assemble that into BIN data, paste it with HW (into the correct byte alignment of course) and then, whenever that routine is called, i successfully "inserted" more code?
did that make sense?
So now i have a question
if we've all figured out how to do it in theory then why is it that we haven't done it yet? Is this routine particularly hard to find? Or is the challenge figuring out how to move the player? Or are there just too many things to check for that we shyed away from it? (really, questions, nothing more, because i'm not going to volunteer people for something i wouldn't (be able to) do my self)

dr4g0n12
June 2nd, 2010, 06:29 PM
An easier way might be to make a script that creates a sprite on the map, and set it's person number as 0xFF

simdu68
June 3rd, 2010, 03:25 AM
hey, you know what was my idea for a follow me pokémon?
it will surely seem stupid, but in my hack there is only one starter, and I thought I could remplace one bike (I am hacking on emerald so there are 2 bikes) by a sprite with the pokémon behind since there's anyway only one starter so I don't need to have many sprites of player with different pokémon behind, I'll just put the starter behind.......
like this you have one sprite but with player and pokémon behind

now, this idea is not that good either coz, I completely forgot about the evolutions of the pokémon, coz if the pokémon evolves and the following pokemon stays the same first pokemon it is really bad -_-'

but this idea can be useful if someone hacks on R/S/E or if not FR/LG but in this case there will be no more bike, and if there is only one choice of starter if not you would neet 3 different sprites, and if the starter pokemon doesn't evolve, it would only be useful in this case^^

I must find a new idea hmm.......

altariaking
June 3rd, 2010, 07:02 AM
no. that's a terrible idea. read above posts for reason

siper x
June 3rd, 2010, 11:08 AM
I have an idea, have the pokemon sprite have a follow player (advance map), aqnd have a script on every tile you can enter on (doors, water edges, and map edges) so the one behind you follows, and the others are hidden, and the script also makes the other one disappear.

just an idea, and don't know if someone tryed it, but it might work.

simdu68
June 3rd, 2010, 12:39 PM
ok I see, my idea was bad, but now I got another idea......
in fact I got it inspired by the post above^^
to be honest, I didn't completely understand what you said siper x, maybe it is the same thing as what I will say^^

well, in fact the sprite isn't obliged to follow you all the time, we could just put script in a faw important places like when village leaving the sprite runs from somewhere so you, when you enter a house the pokemon also comes, but durinf your walking just randomly the pokemon also can walk randomly, because what found out first was that I need a script on everytile if I want my pokemon to follow me (now I don't know exactly what you guys had for ideas coz it's today it's the first time I came on this thread^^)
yeah so as I said, we can't put scripts everywhere so just in important place that the pokémon is somewhere behind, don't know what he's doing^^ and when you go in a house or something so he runs behind you to catch you up, then again you walk along and then again do him catch you up......

sorry for my very bad english, I'm sure you will read my message 2 times to understand or you will read one time, not understand and give up^^
anyway, if someone understands what I mean, do you think it is possible like this?


edit: oh! I have seen all what you wrote already and finally I see that my idea is the worst idea ever -_-"
well, I'll still leave it^^

siper x
June 3rd, 2010, 03:49 PM
ok I see, my idea was bad, but now I got another idea......
in fact I got it inspired by the post above^^
to be honest, I didn't completely understand what you said siper x, maybe it is the same thing as what I will say^^

well, in fact the sprite isn't obliged to follow you all the time, we could just put script in a faw important places like when village leaving the sprite runs from somewhere so you, when you enter a house the pokemon also comes, but durinf your walking just randomly the pokemon also can walk randomly, because what found out first was that I need a script on everytile if I want my pokemon to follow me (now I don't know exactly what you guys had for ideas coz it's today it's the first time I came on this thread^^)
yeah so as I said, we can't put scripts everywhere so just in important place that the pokémon is somewhere behind, don't know what he's doing^^ and when you go in a house or something so he runs behind you to catch you up, then again you walk along and then again do him catch you up......

sorry for my very bad english, I'm sure you will read my message 2 times to understand or you will read one time, not understand and give up^^
anyway, if someone understands what I mean, do you think it is possible like this?


edit: oh! I have seen all what you wrote already and finally I see that my idea is the worst idea ever -_-"
well, I'll still leave it^^

very close to what i had. what i was saying was at points of entry have a o/w of the pokemon hidden (choice on advance map) so when you step on it the pokemon follows, and when you enter another map, the script adds the o/w of the pokemon and the other one dissapears. when the pokemon appears it is at the follow player (another advance map choice), so it looks like it followed you to the map, but it is just a new o/w.

altariaking
June 3rd, 2010, 04:16 PM
that would make the pokemon take a step after the player, which would be really bad looking and annoying

simdu68
June 4th, 2010, 02:54 AM
oh I see! yeah, I didn't thought about that, because we can't make a sprite change map right? I see, so your idea is better because at least it will work not like mine^^

edit: oh, in fact why not put at every map entrance a script applymovement like this the same OW can always follow and your not obliged to put on every map a new OW.....I know there is a script where you follow another OW to an another map, we can do the same but just of one tile like this it doens't seem like you are walking unfreely
...
...
aarrghhh!!! I hate my english, I can never explain clearly what I want to say!! I bet no one understood what I mean -_-'
I must really improve in scripting and in english to explein ly ideas.....

Shiny Quagsire
June 4th, 2010, 07:52 AM
Let's just be cheap and put the pokemon away when the person rides the bike!

Anyways, I noticed while playing heart gold, that the pokemon just echo's the player's movements, like this:

player moves up
player moves up - pokemon moves up
player moves down - pokemon moves up
player moves right - pokemon moves down

...

and so on. Why don't we just make a list of the player's last three movements somewhere in the RAM, then use an ASM routine to apply it to the pokemon.

Full Metal
June 4th, 2010, 07:57 AM
Well, correct me if i'm wrong but...don't we have to find the routine that is executed on the player's movement?

colcolstyles
September 23rd, 2010, 10:44 PM
Good thing there's no revival rule here...

A discussion in my Physics class today (don't ask) prompted me to give this idea a concentrated effort. After several straight hours of hacking, I managed to create the following:

UuQ_RbpeLPM

It's pretty basic at the moment. For example, I haven't added support for ledges, running, or biking, I haven't tested what happens when the player changes maps, the following NPC can't be passed through, and I'm sure there are a bunch of other bugs I have yet to discover as well. However, I'm still happy with it. ^_^

Derlo
September 24th, 2010, 04:36 AM
Simply wonderful!
But I have a question.
This system also works in FR / LG, or only in R / S?

colcolstyles
September 24th, 2010, 04:54 PM
Simply wonderful!
But I have a question.
This system also works in FR / LG, or only in R / S?

I'm fairly certain that it could be ported to FR/LG but I have no interest in doing so.

Omega Zero
September 24th, 2010, 06:59 PM
wow! this is awesome it'll answer all our prayers if ported to Fr lg as well
but it'll soon be overused ;_;

AimayBee
April 8th, 2011, 06:14 PM
Good thing there's no revival rule here...

A discussion in my Physics class today (don't ask) prompted me to give this idea a concentrated effort. After several straight hours of hacking, I managed to create the following:

UuQ_RbpeLPM

It's pretty basic at the moment. For example, I haven't added support for ledges, running, or biking, I haven't tested what happens when the player changes maps, the following NPC can't be passed through, and I'm sure there are a bunch of other bugs I have yet to discover as well. However, I'm still happy with it. ^_^

That is really amazing, have you made any improvements on it since posting this? x

colcolstyles
April 8th, 2011, 07:02 PM
That is really amazing, have you made any improvements on it since posting this? x

I added functionality for running and ledge jumping. My system doesn't support map switching but I don't need that feature for my purposes.

AimayBee
April 9th, 2011, 11:37 AM
I added functionality for running and ledge jumping. My system doesn't support map switching but I don't need that feature for my purposes.

Have you tried to convert it over to firered? x

colcolstyles
April 9th, 2011, 10:18 PM
Have you tried to convert it over to firered? x

I have not and, as I mentioned earlier, I have no intention of attempting to.

AimayBee
April 10th, 2011, 03:10 AM
I have not and, as I mentioned earlier, I have no intention of attempting to.

Would you give it to someone who would attempt it? x

Darthatron
April 10th, 2011, 05:08 AM
Would you give it to someone who would attempt it? x
And capable.

Darthatron, for example.

Crimson Stardust
April 10th, 2011, 05:20 AM
And capable.

Darthatron, for example.
haha..yeah!
It would be great..

knizz
April 10th, 2011, 09:29 AM
And capable.

Darthatron, for example.

And don't forget me. I have the database.

AimayBee
April 10th, 2011, 10:06 AM
And capable.

Darthatron, for example.

And don't forget me. I have the database.

Like these people. lol They could do it. ^^

Full Metal
April 10th, 2011, 05:03 PM
Don't count me out!
I wouldn't even use it for a hack, only for a learning experience; IE To better myself. :)

colcolstyles
April 10th, 2011, 06:18 PM
...friggin' peer pressure.

Eh, I'll think about it. There's too much PC drama at the moment.

AimayBee
April 10th, 2011, 07:05 PM
...friggin' peer pressure.

Eh, I'll think about it. There's too much PC drama at the moment.

I guess it is peer pressure but people really like the follow me idea.

Even I have a way I could use it in my hack. lol

Also, isn't your post off topic? :P x

Jocaro
June 3rd, 2011, 09:45 AM
Maybe this can help us with this little trouble:

"02037078 is a structure that controls the movement of, and only of, the player. However it can be associated to any NPC on screen.

The first two bits (0x03) of 02037078+0 determine the speed. 1 is normal. 2 is bike speed. 3 gives you a bike and changes itself to 2.

No matter what you write to 02037078+1 it is set to 0 again. If the value was 2 before the reset you get a bike. If you change the bike-byte the NPC turns into the hero.

02037078+2 and 02037078+3 behave like this:
0 0 Nothing pressed
0 0 Nothing pressed
1 1 Pressed forward
2 1 Pressed forward
2 1 Pressed forward
2 1 Pressed forward
0 0 Nothing pressed
2 1 Pressed forward
2 1 Pressed forward
0 0 Nothing pressed
0 0 Nothing pressed
1 1 Pressed forward
2 1 Pressed forward
2 1 Pressed forward

I don't know about 02037078+4.
02037078+5 sets the npc-id that is controlled by the keypad. (I wonder which numbers the npcs from connected maps have)
02037078+6 locks all movement when set to 1

More info about the NPCs is stored at 02036E38 in 16 0x24-byte long structures (Does that mean that there can't be more than 16 npcs in the overworld at the same time?!)
0x00 bits 7 and 6 are set when this npc is talking
0x01-0x0A unknown
0x0B height
0x0C-0x0F unknown
0x10 from (coords)
0x14 to (coords)
0x18 unknown
0x19 direction (in which the character actually looks)
0x1A unknown
0x1C direction (set when talked to but not always copied to 0x19)
0x1E unknown
0x20 direction (set after talk)
0x21-0x23 unknown

coordinates are saved as two halfwords (x and y)

The code for moving uses a table to convert the direction to relative coordinates.
Table: 083A64C8
Function that uses the table above: 08063A20
Function that uses the function above to move npcs: 0805C4F4

Note that the table contains 9 and not 5 directions. Yes. Game Freak planned to have diagonally moving npcs."

Thanks to Knizz quote in other thread.

I tryed this but the only troubles are that change in 02037078+5 dissapear whit warping or optios menu.

i xpect have contrbute to this theme :)

Maybe this some Knizz have info about the NPC's moves or moving in a map FR

showthread.php?t=205158&page=4 'in this site
showthread.php?t=205158&page=3 'in this site

Meta Paradox
June 6th, 2011, 05:24 AM
Yah, about the Hacked Engine. Darthatron's level script for the follow-me thingy can be translated into a normal script, I guess. So compile the script and replace it with JPAN's behavior byte hack to overwrite the behavior bytes' scripts, and voila!

Oh, and yeah, that was merely a suggestion. :D

cbd98
June 6th, 2011, 01:29 PM
i have an idea... does anybody else remember the old mew from faraway island that would move the same way you did? maybe if you tried edit that script a little, it would work. of course it probably wouldn't, but its a thought

Hi-Techneon
June 7th, 2011, 02:43 AM
i have an idea... does anybody else remember the old mew from faraway island that would move the same way you did? maybe if you tried edit that script a little, it would work. of course it probably wouldn't, but its a thought

The Mew from Faraway Island moved exactly like you do, it didn't follow you. For example, if you first go up, and then you go left, the Mew would do exactly the same, instead of going up two times like a perfectly working following script.

Full Metal
June 7th, 2011, 04:29 AM
i have an idea... does anybody else remember the old mew from faraway island that would move the same way you did? maybe if you tried edit that script a little, it would work. of course it probably wouldn't, but its a thought

Although it's not quite what we're looking for, it's a good place to look at. We could probably get some info on how to animate the pokemon's sprite and move it along with the player. :)

Spiky-Eared Pichu
June 7th, 2011, 06:45 AM
If my memory doesn't fail, in Route 119 there's the "Mimic Circle". I don't know how the overworlds there are programmed, but they mirror the movements you do while in the grass. We could take a look at how they are programmed, maybe we have an official "follow me" script in front of us and we haven't noticed it. I may be wrong, though. I haven't hacked GBA since long time ago, when I moved to DS. Making a follow me script in DPPt is way easier, as there's a scripting command programmed for its use in the Amity Square.

cbd98
June 7th, 2011, 06:04 PM
If my memory doesn't fail, in Route 119 there's the "Mimic Circle". I don't know how the overworlds there are programmed, but they mirror the movements you do while in the grass. We could take a look at how they are programmed, maybe we have an official "follow me" script in front of us and we haven't noticed it. I may be wrong, though. I haven't hacked GBA since long time ago, when I moved to DS. Making a follow me script in DPPt is way easier, as there's a scripting command programmed for its use in the Amity Square.

yeah, i think the mimic people move the same way the mew does. but i dont think it would be possible to take the amity square script and move it back a generation. though i havent tried, so idk.

AimayBee
June 7th, 2011, 07:17 PM
yeah, i think the mimic people move the same way the mew does. but i dont think it would be possible to take the amity square script and move it back a generation. though i havent tried, so idk.

Would be nice if someone was to post that script on this thread so we can try and convert it. :P

We know people have done the folow me script but aren't telling, so it IS possible.

Spiky-Eared Pichu
June 8th, 2011, 07:54 AM
Would be nice if someone was to post that script on this thread so we can try and convert it. :P

We know people have done the folow me script but aren't telling, so it IS possible.

I work with Diamond and I could post it, but the problem is that it's not a script, it's a command. I mean, it's like one of these commands you use to insert a message box or start a battle. It's coded into the game specifically for the Amity Square, as well as the 5 tag trainers around Sinnoh.

The script works like this:

1. A command draws an overworld in the map for the following Pokémon/trainer (you can do this in GBA easily).

2. A special command sets that overworld to follow you. You can also set a value that enables it to follow you even if you change maps. (Here's the reason of why it can't be ported)

There's also another command which disables the following, and of course there's also one that erases the overworld from the map.

Angeldelivery
June 8th, 2011, 12:13 PM
If someone would learn ASM i think it can be done. But you won't be ever able to convert D/P/Pt scripts to GBA scripts.

Full Metal
June 12th, 2011, 03:54 PM
^ Yes, thank you very much for your input. It wasn't obvious at all. :)
Anyways, I've decided to start looking into this myself. I'm really wanting to see this work. Really badly. So, here goes.
First thing I noticed, the player's OW ( OAM ) does not move. It animates, and sets rotation flags, but that's about it ( Which makes sense considering how weird the OAM system is anyways ( ... ) ). Which after a little bit of brain-scratching, I figured out, ohai, the player only looks like he's moving -- it's an illusion! How does that work? The camera moves. :) </rantofnubbliness>
I'm bpw-ing the camera positions ( Credits to this (http://www.pokecommunity.com/showpost.php?p=5609251&postcount=5) post. )

*edit* Okay, I'm looking at some other stuffs as well.
the camera position is written around the area
08059564
This (http://www.pokecommunity.com/showpost.php?p=6102855&postcount=33) post looks useful as well, so I'm keeping it on *this* post. haha.
I also have bookmarked a page on the pern project for OAM and sprites information. That should come in handy when I write a routine to actually move the sprite.
**edit2**

0805945A bc10 pop {r4} R00=00000000 R01=0805945b R02=00000027 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd0 R14=0805945b R15=0805945c
0805945C bc02 pop {r1} R00=00000000 R01=0805945b R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd4 R14=0805945b R15=0805945e
0805945E 4708 bx r1 R00=00000000 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059460
08059554 1c07 add r7, r0, #0x0 R00=00000000 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059556
08059556 1c78 add r0, r7, #0x1 R00=00000000 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059558
08059558 2801 cmp r0, #0x1 R00=00000001 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=0805955a
0805955A d80d bhi $08059578 R00=00000001 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=0805955c
0805955C 4805 ldr r0, [$08059574] (=$03005008) R00=00000001 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=0805955e
0805955E 6801 ldr r1, [r0, #0x0] R00=03005008 R01=08059555 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059560
08059560 8808 ldrh r0, [r1, #0x0] R00=03005008 R01=02025580 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059562
08059562 4450 add r0, r10 R00=00000003 R01=02025580 R02=00000027 R03=00000000 R04=00000001 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000001 R11=00000000 R12=02021737 R13=03007dd8 R14=0805945b R15=08059564

^ There's a trace I did. Notice that LR is pointing to 0805945b.
I'm now going to look at that code.

***edit 3***

080636f0 1c28 add r0, r5, #0x0
080636f2 1c21 add r1, r4, #0x0
080636f4 f7f5 bl $08059334
080636f8 2101 mov r1, #0x1
080636fa 4249 neg r1, r1
080636fc 4288 cmp r0, r1
080636fe d011 beq $08063724
08063700 1c30 add r0, r6, #0x0
08063702 1c29 add r1, r5, #0x0
08063704 1c22 add r2, r4, #0x0
08063706 1c3b add r3, r7, #0x0
08063708 f000 bl $080638ac
0806370c 0600 lsl r0, r0, #0x18
0806370e 2800 cmp r0, #0x0
08063710 d108 bne $08063724
08063712 7870 ldrb r0, [r6, #0x1]
08063714 09c0 lsr r0, r0, #0x07
08063716 2800 cmp r0, #0x0

The code in red calls the routine that calls the routine 0805945b, and I'm trying to figure out what the value of each of the registers here are.

cbd98
June 13th, 2011, 05:25 PM
@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.

Full Metal
June 13th, 2011, 06:04 PM
No. That's not gonna work.
using a Pokemon script would be ridiculously painful. :\

AimayBee
June 13th, 2011, 08:54 PM
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
June 20th, 2011, 09:25 AM
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
June 20th, 2011, 12:22 PM
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
June 24th, 2011, 08:21 AM
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
June 24th, 2011, 11:47 AM
@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

0m3GA ARS3NAL
June 24th, 2011, 01:52 PM
colcolstyles has a working follow me...
Just thought I'd point it out.

Full Metal
June 24th, 2011, 03:45 PM
@OA - I don't think he's wanting to share it, which is understandable.

miksy91
June 25th, 2011, 08:43 AM
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
June 25th, 2011, 12:03 PM
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
June 25th, 2011, 06:58 PM
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
June 25th, 2011, 11:04 PM
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
June 25th, 2011, 11:37 PM
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
June 27th, 2011, 06:30 PM
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. :PSorry 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
June 28th, 2011, 02:25 PM
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
June 28th, 2011, 03:34 PM
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
June 29th, 2011, 12:53 AM
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.

hi sir tomato my password is syvniti
June 29th, 2011, 01:40 AM
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
June 29th, 2011, 04:26 AM
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

knizz
July 1st, 2011, 03:14 AM
This patch will allow npcs that use the 'imitate player' mode to walk through other npcs when their trainer-byte is set to 8.

eh 08062A0A 0x5EAA
eh 08062A0C 0x1C20
eh 08062A0E 0x1C33
eh 08062A10 0xF000
eh 08062A12 0xFE4C
eh 08062A14 0x79E1
eh 08062A16 0x0040
eh 08062A18 0x4388
eh 08062A1A 0xD110

Guess why this is relevant.

Full Metal
July 1st, 2011, 07:16 AM
Because...you found out how to create an OAM via map loading routine?
Uhh, and then having crazy hair!
^ Debateably( SP? ) his best achievement. :3

Darthatron
July 2nd, 2011, 07:45 AM
Owc5nLdZnaA

Winning?

TIGER BLOOD!

knizz did this. Not me.

~Anbuja
July 2nd, 2011, 08:03 AM
Owc5nLdZnaA

Winning?

TIGER BLOOD!

knizz did this. Not me.

this is amazing:D:D:D:D
but why the fat guy coming after u?
and the grass animation seems to not work anymore?
and the following ow shouldnt walk throguh u like that.he should everytime be behind u.
but good job keep it up:D

knizz
July 2nd, 2011, 08:12 AM
And the following OW shouldn't walk through you like that. He should always be behind you.

Are you aware that 5 hours of hard work were necessary to make this possible? The whole hack is RAW HEX. It's not even ASM.
EDIT: Not the whole patch. That took even longer. I meant that it took that many hours to allow the follower to walkthrough the NPC and the other way round.

sab
July 2nd, 2011, 08:13 AM
I don't know if this is actually useful, but in ruby the bytes that change when buttons are pressed are at 4000130 and 4000131. For example if I pressed up it would put BF at 4000130 and 03 at 4000131. Down would be 7F at 4000130 and 03 at 4000131. Left would be DF at 4000130, and right would be EF at 4000130. From what I can tell, 4000131 is used for "A" and "B", but not much else. I tried to use this to get a script to work on ruby but it failed misserably. This was meant to start when the player was standing on top of the person following.

#org @youroffset
Msgbox @message1offset MSG_NORMAL
waitkeypress
pause 0x20
goto @youroffset2

#org @youroffset2
comparefarbytetobyte 0x4000130 0xFF
if 0x1 goto @youroffset2
comparefarbytetobyte 0x4000130 0xFE
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFD
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xF7
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFC
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFB
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0x7f
if 0x1 goto @down
comparefarbytetobyte 0x4000130 0xBF
if 0x1 goto @up
comparefarbytetobyte 0x4000130 0xDf
if 0x1 goto @left
comparefarbytetobyte 0x4000130 0xEF
if 0x1 goto @right
goto @youroffset2

#org @yetanotheroffset
comparefarbytetobyte 0x4000130 0xFF
if 0x1 goto @yetanotheroffset
comparefarbytetobyte 0x4000130 0xFE
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFD
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xF7
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFC
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0xFB
if 0x1 goto @end
comparefarbytetobyte 0x4000130 0x7f
if 0x1 goto @down2
comparefarbytetobyte 0x4000130 0xBF
if 0x1 goto @up2
comparefarbytetobyte 0x4000130 0xDf
if 0x1 goto @left2
comparefarbytetobyte 0x4000130 0xEF
if 0x1 goto @right2
goto @yetanotheroffset

#org @right2
applymovement 0xff @rightmovement
writebytetooffset 0xEF 0x087F0000
comparefarbytetobyte 0x087F0001 0x7F
if 0x1 goto @down2otherperson
comparefarbytetobyte 0x087F0001 0xBF
if 0x1 goto @up2otherperson
comparefarbytetobyte 0x087F0001 0xDf
if 0x1 goto @left2otherperson
comparefarbytetobyte 0x087F0001 0xEF
if 0x1 goto @right2otherperson
goto @right2

#org @left2
applymovement 0xff @leftmovement
writebytetooffset 0xDF 0x087F0000
comparefarbytetobyte 0x087F0001 0x7F
if 0x1 goto @down2otherperson
comparefarbytetobyte 0x087F0001 0xBF
if 0x1 goto @up2otherperson
comparefarbytetobyte 0x087F0001 0xDf
if 0x1 goto @left2otherperson
comparefarbytetobyte 0x087F0001 0xEF
if 0x1 goto @right2otherperson
goto @left2

#org @up2
applymovement 0xff @upmovement
writebytetooffset 0xBF 0x087F0000
comparefarbytetobyte 0x087F0001 0x7F
if 0x1 goto @down2otherperson
comparefarbytetobyte 0x087F0001 0xBF
if 0x1 goto @up2otherperson
comparefarbytetobyte 0x087F0001 0xDf
if 0x1 goto @left2otherperson
comparefarbytetobyte 0x087F0001 0xEF
if 0x1 goto @right2otherperson
goto @up2

#org @down2
applymovement 0xff @downmovement
writebytetooffset 0x7f 0x087F0000
comparefarbytetobyte 0x087F0001 0x7F
if 0x1 goto @down2otherperson
comparefarbytetobyte 0x087F0001 0xBF
if 0x1 goto @up2otherperson
comparefarbytetobyte 0x087F0001 0xDf
if 0x1 goto @left2otherperson
comparefarbytetobyte 0x087F0001 0xEF
if 0x1 goto @right2otherperson
goto @down2

#org @right
applymovement 0xff @rightmovement
writebytetooffset 0xEF 0x087F0001
checkflag 0x2d0
if 0x0 goto @setflag
comparefarbytetobyte 0x087F0000 0x7F
if 0x1 goto @downotherperson
comparefarbytetobyte 0x087F0000 0xBF
if 0x1 goto @upotherperson
comparefarbytetobyte 0x087F0000 0xDf
if 0x1 goto @leftotherperson
comparefarbytetobyte 0x087F0000 0xEF
if 0x1 goto @rightotherperson
goto @right

#org @left
applymovement 0xff @leftmovement
writebytetooffset 0xDF 0x087F0001
checkflag 0x2d0
if 0x0 goto @setflag
comparefarbytetobyte 0x087F0000 0x7F
if 0x1 goto @downotherperson
comparefarbytetobyte 0x087F0000 0xBF
if 0x1 goto @upotherperson
comparefarbytetobyte 0x087F0000 0xDf
if 0x1 goto @leftotherperson
comparefarbytetobyte 0x087F0000 0xEF
if 0x1 goto @rightotherperson
goto @left

#org @up
applymovement 0xff @upmovement
writebytetooffset 0xBF 0x087F0001
checkflag 0x2d0
if 0x0 goto @setflag
comparefarbytetobyte 0x087F0000 0x7F
if 0x1 goto @downotherperson
comparefarbytetobyte 0x087F0000 0xBF
if 0x1 goto @upotherperson
comparefarbytetobyte 0x087F0000 0xDf
if 0x1 goto @leftotherperson
comparefarbytetobyte 0x087F0000 0xEF
if 0x1 goto @rightotherperson
goto @up

#org @down
applymovement 0xff @downmovement
writebytetooffset 0x7F 0x087F0001
checkflag 0x2d0
if 0x0 goto @setflag
comparefarbytetobyte 0x087F0000 0x7F
if 0x1 goto @downotherperson
comparefarbytetobyte 0x087F0000 0xBF
if 0x1 goto @upotherperson
comparefarbytetobyte 0x087F0000 0xDf
if 0x1 goto @leftotherperson
comparefarbytetobyte 0x087F0000 0xEF
if 0x1 goto @rightotherperson
goto @down

#org @right2otherperson
applymovement 27 @rightmovement
goto @youroffset2

#org @left2otherperson
applymovement 27 @leftmovement
goto @youroffset2

#org @down2otherperson
applymovement 27 @downmovement
goto @youroffset2

#org @up2otherperson
applymovement 27 @upmovement
goto @youroffset2

#org @rightotherperson
applymovement 27 @rightmovement
goto @yetanotheroffset

#org @leftotherperson
applymovement 27 @leftmovement
goto @yetanotheroffset

#org @downotherperson
applymovement 27 @downmovement
goto @yetanotheroffset

#org @upotherperson
applymovement 27 @upmovement
goto @yetanotheroffset

#org @end
msgbox @message2offset MSG_NORMAL
writebytetooffset 0x0 0x087F0001
writebytetooffset 0x0 0x087F0000
clearflag 0x2d0
end

#org @setflag
setflag 0x2d0
applymovement 222 @downmovement
goto @yetanotheroffset

#org @message1offset
= some text stating that the person will follow you.

#org @message2offset
= some text stating that the person will stop following you because you didn't press an arrow key.

#org @rightmovement
#raw 0x0B
#raw 0xFE

#org @leftmovement
#raw 0x0A
#raw 0xFE

#org @upmovement
#raw 0x09
#raw 0xFE

#org @downmovement
#raw 0x08
#raw 0xFE

Lord Varion
July 2nd, 2011, 08:16 AM
Owc5nLdZnaA

Winning?

TIGER BLOOD!

knizz did this. Not me.

Wow!
Alot of effort musta gone into to that there.
Just wondering but would the follower still be with you if you were to enter a building ... or will the dissappear.

colcolstyles
July 2nd, 2011, 08:30 AM
It's pretty glitchy but congratulations on getting the map switching to work. Nice job. :)

Darthatron
July 2nd, 2011, 03:30 PM
All those glitches are fixed now. The only problem I'm having now is with ledges...

knizz
July 3rd, 2011, 01:13 AM
Put the modified source into my Dropbox. Or do you not have write-access?

Darthatron
July 3rd, 2011, 03:05 AM
Put the modified source into my Dropbox. Or do you not have write-access?

Done.

-

2fzV53EDS_Y

Ledge problems. I have some ideas, but they are tedious...

Chimchar 9
July 3rd, 2011, 10:33 AM
Now, that's very impressive! Would there possibly be an option to make it disappear or reappear? Or even change it's sprite?

diegoisawesome
July 3rd, 2011, 11:22 AM
To Darthatron: It's almost perfect! Nice job!
I wonder if Jambo51 could help with the ledge bit.

Team Fail
July 3rd, 2011, 11:40 AM
To Darthatron: It's almost perfect! Nice job!
I wonder if Jambo51 could help with the ledge bit.

From what I just heard, he almost has it solved. But, I wonder how it'll work. I hope it is that the following NPC can read tile movements and will read the fact that they must "jump" over a ledge when your sprite stands off to the side.

Full Metal
July 3rd, 2011, 01:25 PM
Now, that's very impressive! Would there possibly be an option to make it disappear or reappear? Or even change it's sprite?

That would be as simple as copying your own OW into the TILEAREA and setting the NPC's OAM entry to point to your OW in the TILEAREA ( charset, I believe ). I believe FR uses a 'mirror memory' -- I would look up 'yet another asm tutorial' by Knizz to figure out how to find where to write your OW pixels to so that it's not automatically over-written by the game's engine.

EdensElite
July 5th, 2011, 11:36 AM
I had a couple of ideas.

Firstly, I have noticed that lake water, reflects the image of those on it, It is similar to the surfing thing, but it might be worth a look into.

Secondly, You have obviously noticed that the height parameters required for the sprite editing is much higher than necessary. For every sprite you could just slot a pikachu behind him? The sides would be a problem though :/

Chimchar 9
July 6th, 2011, 06:07 PM
That would be as simple as copying your own OW into the TILEAREA and setting the NPC's OAM entry to point to your OW in the TILEAREA ( charset, I believe ). I believe FR uses a 'mirror memory' -- I would look up 'yet another asm tutorial' by Knizz to figure out how to find where to write your OW pixels to so that it's not automatically over-written by the game's engine.
Oh, really? That sounds very positive then. I also hope you figure that problem out. :)

Full Metal
July 6th, 2011, 06:23 PM
I had a couple of ideas.

Firstly, I have noticed that lake water, reflects the image of those on it, It is similar to the surfing thing, but it might be worth a look into.

Secondly, You have obviously noticed that the height parameters required for the sprite editing is much higher than necessary. For every sprite you could just slot a pikachu behind him? The sides would be a problem though :/
This idea has been shot down many times. The system we have now works better anyways.


Oh, really? That sounds very positive then. I also hope you figure that problem out. :)
Psh. I doubt I use this anyways. I'm not working on a hack. :P
I'm just wanting to see it work, do it myself and understand it.
Then move on to the next subject.

Satoshi Ookami
July 7th, 2011, 12:09 AM
Wow... I simply cannot believe what you guys did.
You are so awesome!
If this were to be perfected then the 3rd gen hacking would advance to the next level.
Thank you for that!

Jambo51
July 10th, 2011, 06:12 PM
I've not done any work on this for a couple of days, but have a look anyway :D

http://www.youtube.com/watch?v=y2hUoO2yxcA

AimayBee
July 11th, 2011, 01:03 AM
I've not done any work on this for a couple of days, but have a look anyway :D

http://www.youtube.com/watch?v=y2hUoO2yxcA

This looks amazing, love how you made her walk all the time.

Did you use ASM for this then? x

EdensElite
July 11th, 2011, 04:28 AM
Oh. I posted before viewing the video, this is getting really awesome! Are you going to release the data for this when it has been perfected? and if so how, like a patch or something?

p.s Is that a Genesect cry at about 30 second 0.o?

metapod23
July 11th, 2011, 06:14 AM
I've not done any work on this for a couple of days, but have a look anyway :D

http://www.youtube.com/watch?v=y2hUoO2yxcA

Very awesome. Just wanted to say great work.
It would be a great present if the code was ever released to the public.

Satoshi Ookami
July 11th, 2011, 10:39 AM
Awesome, plain awesomeness... =)
Just like the posters above I'd really love to see this feature in a patch so we could use it in our hacks :D

Jambo51
July 11th, 2011, 01:45 PM
This looks amazing, love how you made her walk all the time.

Did you use ASM for this then? x

Yeah, this uses ASM to write directly to the pre-OAM storage area, forcing the sprite to walk onto the tile which the player has just left.

Oh. I posted before viewing the video, this is getting really awesome! Are you going to release the data for this when it has been perfected? and if so how, like a patch or something?

p.s Is that a Genesect cry at about 30 second 0.o?

Yes, that is indeed a Genesect cry at 30 seconds.

Very awesome. Just wanted to say great work.
It would be a great present if the code was ever released to the public.

Awesome, plain awesomeness... =)
Just like the posters above I'd really love to see this feature in a patch so we could use it in our hacks :D

I'll release the code if and when I deem it to be ready for use.
That video shows the working aspects of the routines, but there are still plenty of things which won't work yet as well. Warping is a HUGE problem related to this.

EdensElite
July 13th, 2011, 04:05 PM
One thing to consider is that once you've done this first step. Possibly some advanced code to imitate HG/SS If you can do it for two pokemon you can do it for 100 its just the space required. I assume that the 'follower' is determined by an offset? So you could be like "if charmander is 1st in party use this offset, if bulbasaur etc."

Jambo51
July 14th, 2011, 01:02 AM
One thing to consider is that once you've done this first step. Possibly some advanced code to imitate HG/SS If you can do it for two pokemon you can do it for 100 its just the space required. I assume that the 'follower' is determined by an offset? So you could be like "if charmander is 1st in party use this offset, if bulbasaur etc."

Actually, if you wanted to imitate HGSS, you would just make the following sprite dynamic based on what Pokemon is top of your party.

KingCyndaquil
July 17th, 2011, 05:14 PM
this may sound dumb, but i know there is a way to write an asm code to change a sprites clothing to the same clothing that the NPC is wearing.

Example: v/WteLk6tXwDA

cant you re-modify that code to make the ow follow the player? it sounds farfetched (no pun intended) but its worth a shot... so what do you guys think?

Quickster
July 18th, 2011, 05:21 AM
this may sound dumb, but i know there is a way to write an asm code to change a sprites clothing to the same clothing that the NPC is wearing.

Example: v/WteLk6tXwDA

cant you re-modify that code to make the ow follow the player? it sounds farfetched (no pun intended) but its worth a shot... so what do you guys think?

Now Im no ASM expert so anyone can correct me if Im wrong, but that is a totally different concept. All its doing is switching what the OW looks like that the player controls. In theory, you could modify any code to make an OW follow the player, but Jambo looks pretty far along, and you can see he has made enough progress to be followed, so why make a new code?

KingCyndaquil
July 20th, 2011, 09:03 AM
Now Im no ASM expert so anyone can correct me if Im wrong, but that is a totally different concept. All its doing is switching what the OW looks like that the player controls. In theory, you could modify any code to make an OW follow the player, but Jambo looks pretty far along, and you can see he has made enough progress to be followed, so why make a new code?
jambo said himself (i asked him on msn) that he still has a good amount of work to do before he finishes it, and its not exactly a new code, a modified one, ehhh but i guess your right about it not making sense i was just trying to help lol, i dont much about asm myself.

Teh Blazer
July 20th, 2011, 10:42 AM
This may sound like an often repeated intro that many people say when starting off their ideas, but what will the following overworld do when you in the middle of a script. For instance, if I make a script that makes the player step forward one tile, will I also have to add in another applymovement for the following overworld so they are still in sync, or will it do that automatically?

Jambo51
July 20th, 2011, 02:00 PM
This may sound like an often repeated intro that many people say when starting off their ideas, but what will the following overworld do when you in the middle of a script. For instance, if I make a script that makes the player step forward one tile, will I also have to add in another applymovement for the following overworld so they are still in sync, or will it do that automatically?

With my system, it SHOULD move, as normal, since it's based on the pixel movement of the player's sprite, rather than button presses.
Don't quote me on that though, as I haven't tested it.

Darthatron
July 20th, 2011, 06:33 PM
Can you interact with the NPC in your method Jambo? :\ With the way you've done it, it seems like you'll need to add another routine somewhere to make it seem as though interaction works.

Jambo51
July 21st, 2011, 11:13 AM
Can you interact with the NPC in your method Jambo? :\ With the way you've done it, it seems like you'll need to add another routine somewhere to make it seem as though interaction works.

Yeah, it's possible to interact with NPC's in my version. I tried to show that in my videos, IIRC.

I showed in the first 2 certainly, that normal NPC interaction worked, and so did tile scripts.

EDIT: Wait, I see now that you meant the following NPC. Yes, I can interact with it.

KingCyndaquil
July 22nd, 2011, 10:13 AM
Yeah, it's possible to interact with NPC's in my version. I tried to show that in my videos, IIRC.

I showed in the first 2 certainly, that normal NPC interaction worked, and so did tile scripts.

EDIT: Wait, I see now that you meant the following NPC. Yes, I can interact with it.
did you test for fadescreen and healingspot? it seems that my be difficult to accomplish

hi sir tomato my password is syvniti
July 22nd, 2011, 11:34 AM
this may sound dumb, but i know there is a way to write an asm code to change a sprites clothing to the same clothing that the NPC is wearing.

Example: v/WteLk6tXwDA

cant you re-modify that code to make the ow follow the player? it sounds farfetched (no pun intended) but its worth a shot... so what do you guys think?
That's not how you spell shop? :S

Jambo51
July 23rd, 2011, 12:54 AM
I tested many things related to mine.

Saving, quitting and restarting: Check
Map to map connections: Check
Walking: Check
Running: Check
Ledges: Check
Tile Scripts: Check
Trainer and Wild battles: Check
Warping: Not working
Biking: Not working
Surfing: Not working
Flying (Kind of warping here...): Not working
Scripts moving the player: No idea XD

I have ideas for biking and surfing, but haven't really got any idea whatsoever how I can accomplish the warping. Obviously, the sprite should appear from the tile which you were warped to after you move from it, but until I find the routine which creates the player sprite in the RAM and OAM, I can't look any further into this. As far as I know, the entire map is reloaded on warping, even if you warp to the same map that you were already on. So that could be a small blessing.

Roboto-kun
July 26th, 2011, 10:47 PM
Are you ever going to release the codes? I mean, it's ok if you don't but, I'm just wondering.

Jambo51
July 26th, 2011, 11:54 PM
Are you ever going to release the codes? I mean, it's ok if you don't but, I'm just wondering.

I'll release the code if and when I deem it to be ready for use.
That video shows the working aspects of the routines, but there are still plenty of things which won't work yet as well. Warping is a HUGE problem related to this.

I think that's an adequate answer! Lol.

KNC
August 22nd, 2011, 07:02 AM
Wondering how far you got with this script so far? I'm considering doing a hack but I'd need to get a specific pokemon to follow me for story purposes.

I'd also have an idea on how to possibly deal with the warp problem, I wouldn't know wether it could possibly work though, since you haven't published anything that explains how it works, or what part of warping is such an big problem.

But given you have an routine that draws sprites upon walking and letting them follow you, wouldn't it be possible to include a flag on wether there is currently a pokemon following you, and when it is, to simply always create the sprite when you move? That way the sprite wouldn't appear the moment you entered the house but rather the moment you take your first step inside. Like when your follower still stands outside, because you block the way, and waits for you to move a step.

DavidJCobb
August 22nd, 2011, 07:09 AM
But given you have an routine that draws sprites upon walking and letting them follow you, wouldn't it be possible to include a flag on wether there is currently a pokemon following you, and when it is, to simply always create the sprite when you move? That way the sprite wouldn't appear the moment you entered the house but rather the moment you take your first step inside. Like when your follower still stands outside, because you block the way, and waits for you to move a step.
THAT... sounds like it could work. But what about map connections?

KNC
August 23rd, 2011, 05:15 AM
I tested many things related to mine.

Saving, quitting and restarting: Check
Map to map connections: Check
Walking: Check
Running: Check
Ledges: Check
Tile Scripts: Check
Trainer and Wild battles: Check
Warping: Not working
Biking: Not working
Surfing: Not working
Flying (Kind of warping here...): Not working
Scripts moving the player: No idea XD

I have ideas for biking and surfing, but haven't really got any idea whatsoever how I can accomplish the warping. Obviously, the sprite should appear from the tile which you were warped to after you move from it, but until I find the routine which creates the player sprite in the RAM and OAM, I can't look any further into this. As far as I know, the entire map is reloaded on warping, even if you warp to the same map that you were already on. So that could be a small blessing.
Hence it seems like map connections already work like they are supposed to. I also know that my idea definitely can work. Still as long as only Jambo51 has the code it's up to him to know wether it fits within his solution.

Well damn it'd certainly be easier if not everyone who tries to make this keeps his code for himself after all when it's supposed to be released afterwards anyways. If at least others could join in on the work instead of just watching or starting from scratch themselves...

Jambo51
August 26th, 2011, 11:52 AM
Well damn it'd certainly be easier if not everyone who tries to make this keeps his code for himself after all when it's supposed to be released afterwards anyways. If at least others could join in on the work instead of just watching or starting from scratch themselves...

JEEZ! It couldn't possibly be that i've been unwell, busy working or sorting out my University stuff. No, it must be that I've decided to be a d**k and keep the code to myself.

Also, if I decided to keep the code to myself, I'd be well within my rights to do so. It's my perogative. There's no rule explicitly stating that I must post every single discovery I make! Just remember that!

However, I'm not an elitist snob. I only got where I am now by reading other people's discoveries and understanding how they were made. So I CHOOSE to post discovered information when I discover it for the benefit of the whole community.

In all fairness though, I've not really worked on the routines for a while now. They're not finished, and as I stated above, when they're finished, I'll release them. Not before.

knizz
August 26th, 2011, 01:28 PM
Well damn it'd certainly be easier if not everyone who tries to make this keeps his code for himself after all when it's supposed to be released afterwards anyways. If at least others could join in on the work instead of just watching or starting from scratch themselves...
Do you have any idea what the work in progress of a patch like that looks like? I doubt anyone could help. And those who do exchange their knowledge already.

I'd need to get a specific pokemon to follow me for story purposes.
that will certainly make you special.

Seriously... why do people hack pokemon for the STORY...

KNC
August 26th, 2011, 06:07 PM
JEEZ! It couldn't possibly be that i've been unwell, busy working or sorting out my University stuff. No, it must be that I've decided to be a d**k and keep the code to myself.

Also, if I decided to keep the code to myself, I'd be well within my rights to do so. It's my perogative. There's no rule explicitly stating that I must post every single discovery I make! Just remember that!

Jeez, I wasn't pointing at anyone calling them a d**k...

That's not what I said and I wasn't trying to offend anyone. I'm honestly sorry if it came over like that.

I was rather pointing at the fact this thread is around for more than a year and that while reading through it I noticed quite a few people talking about going on their own approach, with sorta everyone ending at a different point, which seems to be a rather sad end for a patch project that's been dragging on for so long.
Again, sorry if it came over as harsh and offensive.

Do you have any idea what the work in progress of a patch like that looks like? I doubt anyone could help. And those who do exchange their knowledge already.
I do know pretty good that it's a great workload doing such a patch since I'm getting myself into several other languages besides scripting. As such I totally don't want to make down the work of anyone there.
Also the chance that someone else has that one fitting idea might not be big but it isn't zero either.

Seriously... why do people hack pokemon for the STORY...
Well I think that the supplied story of a game should be either sort of good or non-existent if it's solely about gameplay. And one of the weaknesses of pokemon is that it always includes a half-brewed story (only talking about the editions) that barely contributes for anything. So I'd either remove it completely or give it a try at making the story worthwhile.
Well that's just my personal opinion there.

giradialkia
August 26th, 2011, 07:02 PM
Right, that's a little argument settled, then. On-topic from here, please! :)

EdensElite
August 29th, 2011, 11:20 AM
I don't know if it has already been suggested, and it might be a bit of work, but if when you get it to work, you could use a dynamic offset to say which ever pokemon is at the top of your party the sprite could be recalled etc etc. Creating a HGSS Effect. Suggestions?

KNC
September 1st, 2011, 07:27 AM
I don't know if it has already been suggested, and it might be a bit of work, but if when you get it to work, you could use a dynamic offset to say which ever pokemon is at the top of your party the sprite could be recalled etc etc. Creating a HGSS Effect. Suggestions?
Taking a look at this list I don't quite think that's necessery, I'm just quoting it again:

Saving, quitting and restarting: Check
Map to map connections: Check
Walking: Check
Running: Check
Ledges: Check
Tile Scripts: Check
Trainer and Wild battles: Check
Warping: Not working
Biking: Not working
Surfing: Not working
Flying (Kind of warping here...): Not working
Scripts moving the player: No idea XD

So Ideas should go about the things not marked with an check, namely Warping/Biking/Flying and the Scripts.

For warping I posted my idea already a few posts above.

For biking, well that depends on what you'd want to achieve...
1: Just pretend you take the pokemon back into their ball, nothing big to do for this necessery I guess. But then again depends on what approach you take on the script.
2: Pokemon follows your bike... well for some pokemon which are fast that'd work, but it'd be strange to have pokemon not as fast follow you. Then it'd be the same approach as basic walking given you can identify the current state.
3: Optionally you can have the pokemon on the back of the back, right behind you. That would just work again with a few specific pokemon though. So I wouldn't basically integrate this approach as well as the one above. This could simply be achieved through editing the sprites though, given of course you have only one specific pokemon following you.

For flying... well though it is sorta warping I don't quite think my idea is the perfect fit. Given the space below you is always free open ariving at one spot I guess you could edit the ariving points for flying since there aren't that much around, and let the pokemon pop up below after landing.


Scripts moving the player: No idea XD

I don't quite get the meaning of this part though. I assume you're talking about the scripts that are checking the buttons and applying movement I guess though?

DavidJCobb
September 1st, 2011, 07:43 AM
I don't quite get the meaning of this part though. I assume you're talking about the scripts that are checking the buttons and applying movement I guess though?nope.avi

He's referring to applymovement, applymovementpos, waitmovement, and waitmovementpos. And possibly also movesprite and some others.

NarutoActor
September 1st, 2011, 07:47 AM
He means scripts that contain applymovement 0xff. You know like the script right in the beginning of the original fr, When you and oke walk to his lab? How would that affect the pokemon walking with you? That is his predicament.

KNC
September 1st, 2011, 06:48 PM
Ah, yeah now I get it. That was somewhere around what I was thinking already but I wasn't quite there yet, thanks for the heads up on this one.

AimayBee
September 2nd, 2011, 04:18 AM
He means scripts that contain applymovement 0xff. You know like the script right in the beginning of the original fr, When you and oke walk to his lab? How would that affect the pokemon walking with you? That is his predicament.

That seems simple enough, if the lockall command is used the following sprite will need extra movement controls and if not it should still follow you.

Although I don't have the script so I can't really check it.

NarutoActor
September 2nd, 2011, 10:29 AM
Not just that script but every script that contains an applymovement with the player moving.

eing15
September 13th, 2011, 06:18 PM
Saving, quitting and restarting: Check
Map to map connections: Check
Walking: Check
Running: Check
Ledges: Check
Tile Scripts: Check
Trainer and Wild battles: Check
Warping: Not working
Biking: Not working
Surfing: Not working
Flying (Kind of warping here...): Not working
Scripts moving the player: No idea XD

About scripts moving the player, i think that.. if the other OW, is -1 coordenate,behind you, why you cannot imitate it?
For example;
#org 0x672130
applymovement 0xFF 0x8offset1
waitmovement 0x0
end

#offset1
#binary up, up, left.
(I'm to lazy to write every offset, and moves)
Mi idea:
First, the second OW move to the last X/Y player coordenate, (player it's moving..) and then move the same as player moves. (before that, i think u must "save" the movements of the player in the ram)

Sorry for my bad english, and i hope that mi idea works or something xD

TheDarkShark
September 14th, 2011, 04:40 AM
If I get your idea right, you would let the follower walk to the player's previous position and then move it into the same direction in which the player is moving, right? Doing it like that, the follower would be on the exact same position as the player, meaning they would collide.
Also, I don't understand what you think the script you posted has to do with what you previously said: About scripts moving the player, i think that.. if the other OW, is -1 coordenate,behind you, why you cannot imitate it?
For example;I thought you would apply the same movements to the follower (which would end up in a not very beautiful desync) first, but the script doesn't fit.

M.L
September 14th, 2011, 08:51 AM
well honsetly i think we have figured out doing this (properly) in a script is not ganna happen but i would like to ask how far have you come with this in a script and is it possible to see a SCRIPT you have created that works(well by that i meen it justs needs to follow know direction changes ledges[maybe] and that sort and if possible interaction)
i havnt seen one i have only seen the asm scripts ...

TheDarkShark
September 14th, 2011, 09:26 AM
Well, interaction won't work without ASM, sorry. If you had read the thread, you would have seen a script by Giga Universe (wasn't it him? if not, sorry) that had support for ledges and some other behaviour bytes, too, if I remember correctly. You had to use JPAN's Firered Hacked Engine patch in order to make it work, though. Just read the thread from the beginning, man... or, if you are to lazy to do so, why do you even ask? Just wondering...

DavidJCobb
September 14th, 2011, 08:41 PM
is it possible to see a SCRIPT you have created that worksYou answered your own question in the exact same post that you asked it:
well honsetly i think we have figured out doing this (properly) in a script is not ganna happen




so yea i think you should read through or if your lazy why did you reply to me question?He's not "lazy" and you have no right to denounce him as such. He has clearly read this thread -- and he comprehends the subject matter far better than you have -- and he has been attempting to help you understand said subject matter.

My intention isn't to do any kind of backseat moderation, but seriously, M.L., learn some respect.

zacdee316
February 19th, 2012, 12:14 PM
You answered your own question in the exact same post that you asked it:





He's not "lazy" and you have no right to denounce him as such. He has clearly read this thread -- and he comprehends the subject matter far better than you have -- and he has been attempting to help you understand said subject matter.

My intention isn't to do any kind of backseat moderation, but seriously, M.L., learn some respect.


It's sad to see this project end on such a bad note. Has anyone made any progress with this since? When I originally started reading the thread, I had it in my head to use HEX, but that idea was shot to hell the more I read (or am I wrong in that regard too?). And what had been accomplished looked promising, so I'm just curious.

Jambo51
February 28th, 2012, 03:57 AM
It's sad to see this project end on such a bad note. Has anyone made any progress with this since? When I originally started reading the thread, I had it in my head to use HEX, but that idea was shot to hell the more I read (or am I wrong in that regard too?). And what had been accomplished looked promising, so I'm just curious.

The project is still being worked on. No matter what we do, it will require ASM to take care of this, which requires hex editing to insert, so you're not too far off.

The thing is, the really complicated stuff currently has me stumped. I don't understand how the player sprite is created on a map after warping/flying (although I'd hazard a guess it has something to do with the createsprite command that is otherwise unused).

As things currently stand I have 2 versions of it running:
Fire Red (Can't warp/fly, ride bike/surf, but most everything else should work)
Emerald (Can only walk/run)

The systems used for movement are identical between the 2 versions, so it's a case of porting routines, as opposed to research and then development for Emerald. The routines are far from perfect however, and I think I'm gonna restart the whole project after I've dealt with the 649 Patch, to add the extra stuff which it needs and to tidy up and improve the routines.

sonic1
February 28th, 2012, 09:47 AM
Hey, could you give a heads up (hint) on the emerald version? Routines locations, offsets, something?
Because i have a fairly document ida database of it, including OAM, Npcs, Steps, running mechanics, so i thought you could give us some hints on it.

Thanks!

EdensElite
March 3rd, 2012, 10:06 AM
I have a kind newby solution to the warp issue. Allbeit it's a pain in the bum, but it could work. You said that you had a Problem with creating sprites, but what if you place them in Amap, hid them from view and place a script at the start of each map that makes them appear. It would also check your position and then place them behind you. You would have to have a script for each place on every map though which would be annoying.

droomph
March 7th, 2012, 04:29 PM
What I think we should do is to set a byte in the RAM that isn't used (but still saved), and each time the player warps/flies and appears in the new map, it checks to see if it is set. If it's set, which means that you still want to have them follow you, the next time the player starts moving, it makes a sprite below you, and then deals with the other (working) stuff normally. And if it's a warp-panel, you could delay the screen-fading effect a bit and stick in another "warp" animation for the character behind you.

As for surfing, you should make them jump on a "Wailmer" or seperate bike behind you. When you go onto land again, it checks to see if it's still set, and if it is, it will change the "following" sprite back to normal.

And you don't even have to do that. You could just branch an "It's not very polite when you do that..." or "He needs a POKéMON to surf." to appear whenever you try to surf or bike while someone's following you.

I would want do that, but I don't know how to even begin...

Spherical Ice
October 9th, 2012, 10:04 AM
The Mirror Player functions in FireRed arent perfect, they dont always mimick the player's movement, but maybe some hacking could "fix" that? Would that be a helpful thing? Idk.

Naruto200
November 3rd, 2012, 08:21 AM
Um I don't know if you know this, but an easy way to do a follow me script is

*the start of your script*
playsong 0x *follow me or follow me alt offset* 0x0
applymovement 0x person number @movement1
applymovement 0x FF (player) @movement2
wait movement 0x person number
fadedefault(This just makes it fade to the default song of the map you're on)
*the rest of the script*

I have done this and it works, you just copy the movement data from the person the player is following, paste it, and rename the pointer to the movement data of the player.

I don't know how well it works the other way around, but it should work just the same.(Just do a script event instead of a person event and swap the player movement with the person movement in the main script) I have a working script of that if anyone wants to see it.

diegoisawesome
November 3rd, 2012, 08:38 AM
Um I don't know if you know this, but an easy way to do a follow me script is

*the start of your script*
playsong 0x *follow me or follow me alt offset* 0x0
applymovement 0x person number @movement1
applymovement 0x FF (player) @movement2
wait movement 0x person number
fadedefault(This just makes it fade to the default song of the map you're on)
*the rest of the script*

I have done this and it works, you just copy the movement data from the person the player is following, paste it, and rename the pointer to the movement data of the player.

I don't know how well it works the other way around, but it should work just the same.(Just do a script event instead of a person event and swap the player movement with the person movement in the main script) I have a working script of that if anyone wants to see it.
Sorry to inform you, but you missed the point of this thread. Here, we're trying to make a system where the player has full control over his movement, but a sprite behind him moves with him.

Naruto200
November 3rd, 2012, 08:50 AM
Here's an idea, how about looking for the movement commands that the D-pad uses to move the player? There must be some offset somewhere (by offset I mean command) since it's the most used command in the game.

If you could find whatever script does that, I'm sure it wouldn't take a lot of guessing to add the follow me stuff.

SBird
November 3rd, 2012, 05:18 PM
In fact all that is just done by the main routine, it gets all the hardware registers and parses them correctly and executes the movement routines. Adding something here can have bad influence on the game, since there is, as far as i know, no sort of vblank interrupt that keeps the game on a constant speed of execution and "rendering".
Also you needed to find out how you can actually move another person, since they are slightly different to the player, as long as you do not want to use your own OAM.

~SBird

Naruto200
November 26th, 2012, 07:24 PM
Hmm....you know, there's a little side thing in Black 2 that's basically what you're after.

It's in Humilao City. The last house on the piers before you enter route 22 has an old lady and an overworld version of Man-fo.

She asks you if you will walk her little Man Fo, and if you say yes the Man Fo follows you around inside the house.
So I say find out what's going on in that data, find how to port it to other games, and presto.

Mr. Magius
December 15th, 2012, 09:47 AM
Hmm....you know, there's a little side thing in Black 2 that's basically what you're after.

It's in Humilao City. The last house on the piers before you enter route 22 has an old lady and an overworld version of Man-fo.

She asks you if you will walk her little Man Fo, and if you say yes the Man Fo follows you around inside the house.
So I say find out what's going on in that data, find how to port it to other games, and presto.Well see, we already have semi-working Follow Me scripts for walking and running and all those basic movements. The problem is with warping, surfing, biking, flying, etc. Maybe warping is used in that specific script, but other than that it would be useless.
We're not that far into NDS hacking that we can simply borrow data from B/W's scripts as well. Look how advanced we are at 3rd Gen hacking, yet we can't do this script just yet.

I'll try and look into this a little more and help everyone out. I'm a noob when it comes to hexing and assembly, but it wouldn't hurt.

Kaphotics
December 18th, 2012, 11:26 AM
Well see, we already have semi-working Follow Me scripts for walking and running and all those basic movements. The problem is with warping, surfing, biking, flying, etc. Maybe warping is used in that specific script, but other than that it would be useless.
We're not that far into NDS hacking that we can simply borrow data from B/W's scripts as well. Look how advanced we are at 3rd Gen hacking, yet we can't do this script just yet.

I'll try and look into this a little more and help everyone out. I'm a noob when it comes to hexing and assembly, but it wouldn't hurt.

Not entirely correct; we know a lot about B/W scripts.

I can tell you for a fact that the script @ Humilau does not support warping. I can override the Lady's trigger to let me walk outside (by un-toggling the const_16 value from 1 to 0, the floor trigger stops making the lady bring you back inside. It's located at 02225542 in W2-U and 02225522 @ B2-U). After stepping outside the functionality stops presumably due to the Overworld NPC and script functionality not being present at the warped-to map.

I've been dabbling with NPRE and I have a pretty good parsing capability for B2W2.

Here's the parsing output, all commands currently have temp names and there's a few commands that aren't implemented (thus breaking functionality).


=== Script 0 ===

Offset: 52 LockAll
Offset: 54 StoreFlag 15
Offset: 58 CompareTo 1
Offset: 62 Condition EQUAL
Offset: 66 If TRUEUP Function 0 (81 )
Offset: 73 2BA
Offset: 75 400E
Offset: 77 Logic06 0x400E
Offset: 81 StoreFlag 2768
Offset: 85 CompareTo 1
Offset: 89 Condition EQUAL
Offset: 93 If TRUEUP Function 1 (126 )
Offset: 100 PlaySound 1351
Offset: 104 FacePlayer
Offset: 106 Message2 0 4 10 0 0 = ' But if you change your mind,\nI don't mind asking you to walk\c\nwith my Mienfoo again. '
Offset: 116 WaitButton
Offset: 118 CloseMessageKeyPress
Offset: 120 Jump Function 2 (810 )

=== Function0===

Offset: 126 StoreFlag 2768
Offset: 130 CompareTo 0
Offset: 134 Condition EQUAL
Offset: 138 StoreFlag 15
Offset: 142 CompareTo 0
Offset: 146 Condition EQUAL
Offset: 150 Condition UNK
Offset: 154 If TRUEUP Function 3 (483 )
Offset: 161 PlaySound 1351
Offset: 165 FacePlayer
Offset: 167 Message 0 4 0 1 0 0 = ' Hey, you!\nWould you walk with my dear Mienfoo?\r '
Offset: 179 YesNoBox 0x8010
Offset: 183 StoreVar 0x8010
Offset: 187 CompareTo 0
Offset: 191 Condition EQUAL
Offset: 195 If TRUEUP Function 4 (461 )
Offset: 202 SetVarEqVal 0x400E 0
Offset: 208 Message 0 4 1 1 0 0 = ' Oh my!\nYou're very understanding!\r\nWonderful. Please walk a lot\nwith my cute Mienfoo!\r\nBut...\nPlease don't go out of this house!\r\nIt's dangerous outside.\nAll right. Take good care of my Mienfoo!\r '
Offset: 220 CloseMessageKeyPress2
Offset: 222 0x6E 0x8020
Offset: 226 Compare 0x8020 0
Offset: 232 If EQUAL Function 5 (245 )
Offset: 239 Jump Function 6 (273 )

=== Function1===

Offset: 245 ApplyMovement 255 Movement 0 (2672 )
Offset: 253 24F 0 5
Offset: 259 CallRoutine 0
Offset: 263 CompareTo 0
Offset: 267 Jump Function 7 (367 )

=== Function2===

Offset: 273 Compare 0x8020 1
Offset: 279 If EQUAL Function 8 (292 )
Offset: 286 Jump Function 9 (320 )

=== Function3===

Offset: 292 ApplyMovement 255 Movement 0 (2672 )
Offset: 300 24F 0 5
Offset: 306 End
Offset 310 :8
Offset 311 :0
Offset 312 :0
Offset 313 :0
Offset 314 :30
Offset 315 :0
Offset 316 :47
Offset 317 :0
Offset 318 :0
Offset 319 :0

=== Function4===

Offset: 320 Compare 0x8020 2
Offset: 326 If EQUAL Function 10 (339 )
Offset: 333 Jump Function 7 (367 )

=== Function5===

Offset: 339 ApplyMovement 255 Movement 1 (2656 )
Offset: 347 24F 0 7
Offset: 353 End
Offset 357 :8
Offset 358 :0
Offset 359 :0
Offset 360 :0
Offset 361 :30
Offset 362 :0
Offset 363 :0
Offset 364 :0
Offset 365 :0
Offset 366 :0

=== Function6===

Offset: 367 WaitMovement
Offset: 369 StoreVar 0x8000
Offset: 373 StoreVar 0x8001
Offset: 377 StoreVar 0x8002
Offset: 381 StoreVar 0x8003
Offset: 385 StoreVar 0x8004
Offset: 389 SetVar2A 0x8000 0
Offset: 395 SetVar2A 0x8001 4
Offset: 401 SetVar2A 0x8002 0
Offset: 407 SetVar2A 0x8003 0
Offset: 413 SetVar2A 0x8004 2
Offset: 419 CallStd 39 41
Offset: 423 ClearVar 0x8004
Offset: 427 ClearVar 0x8003
Offset: 431 ClearVar 0x8002
Offset: 435 ClearVar 0x8001
Offset: 439 ClearVar 0x8000
Offset: 443 2B8
Offset: 445 SetVarEqVal 0x400F 1
Offset: 451 SetFlag 15
Offset: 455 Jump Function 11 (477 )

=== Function7===

Offset: 461 Message 0 4 2 1 0 0 = ' Oh my!\r\nYou turned down my request.\nYou're mean.\r\nSome people say that I should walk\nmy Mienfoo myself.\r\nBut, it's impossible, because I've never\ncarried anything heavier than\c\na Poké Ball!\r\n...But if you change your mind,\nI don't mind asking you to walk\c\nmy Mienfoo again. '
Offset: 473 WaitButton
Offset: 475 CloseMessageKeyPress2
Offset: 477 Jump Function 2 (810 )

=== Function8===

Offset: 483 StoreVar 0x400E
Offset: 487 CompareTo 365
Offset: 491 Condition LOWER
Offset: 495 StoreFlag 15
Offset: 499 CompareTo 1
Offset: 503 Condition EQUAL
Offset: 507 Condition UNK
Offset: 511 If TRUEUP Function 12 (684 )
Offset: 518 PlaySound 1351
Offset: 522 FacePlayer
Offset: 524 SetVarEqVal 0x8025 0
Offset: 530 Message 0 4 5 1 4 0 = ' You've just started walking.\nPlease walk more!\r\n...Whaaat?\r\nYou're not going to say\nyou will quit in the middle of\c\nwalking my cute Mienfoo, are you?\r '
Offset: 542 Multi2 31 5 0 0 9473 128
Offset: 551 SetTextScriptMessage 6 0xFFFF 0 = ' Continue '
Offset: 559 SetTextScriptMessage 7 0xFFFF 1 = ' Quit '
Offset: 567 CloseMulti
Offset: 569 StoreVar 0x8025
Offset: 573 CompareTo 1
Offset: 577 Condition EQUAL
Offset: 581 If TRUEUP Function 13 (662 )
Offset: 588 Message 0 4 9 1 0 0 = ' Oh my!\nWhat's the matter with you?\r\nIt looks like my cute Mienfoo still\nwants to walk!\r\nIn that case, I can't give you a\nthank-you gift.\r\n...But if you change your mind,\nI don't mind asking you to walk\c\nwith my Mienfoo again.\r '
Offset: 600 CloseMessageKeyPress2
Offset: 602 StoreVar 0x8000
Offset: 606 StoreVar 0x8001
Offset: 610 SetVar2A 0x8000 2
Offset: 616 SetVar2A 0x8001 0
Offset: 622 CallStd 40 41
Offset: 626 ClearVar 0x8001
Offset: 630 ClearVar 0x8000
Offset: 634 CallRoutine 176 0
Offset: 640 2B9
Offset: 642 SetVarEqVal 0x400F 0
Offset: 648 SetFlag 2768
Offset: 652 ClearFlag 15
Offset: 656 Jump Function 14 (678 )

=== Function9===

Offset: 662 Message 0 4 8 1 0 0 = ' Of course!\r\nPlease walk my cute Mienfoo\nuntil it is totally satisfied. '
Offset: 674 WaitButton
Offset: 676 CloseMessageKeyPress2
Offset: 678 Jump Function 2 (810 )

=== Function10===

Offset: 684 PlaySound 1351
Offset: 688 FacePlayer
Offset: 690 Message 0 4 3 1 0 0 = ' Oh my!\r\nMy cute Mienfoo\nlooks very tough now.\r\nThank you very much\nfor walking my Mienfoo.\r\nI'll give this to you\nas a token of my appreciation.\r '
Offset: 702 CloseMessageKeyPress2
Offset: 704 StoreVar 0x8000
Offset: 708 StoreVar 0x8001
Offset: 712 SetVar2A 0x8000 88
Offset: 718 SetVar2A 0x8001 1
Offset: 724 CallStd 245 10
Offset: 728 ClearVar 0x8001
Offset: 732 ClearVar 0x8000
Offset: 736 StoreVar 0x8000
Offset: 740 StoreVar 0x8001
Offset: 744 SetVar2A 0x8000 2
Offset: 750 SetVar2A 0x8001 0
Offset: 756 CallStd 40 41
Offset: 760 ClearVar 0x8001
Offset: 764 ClearVar 0x8000
Offset: 768 CallRoutine 42 0
Offset: 774 Message 0 4 4 1 0 0 = ' Please walk my cute Mienfoo again! '
Offset: 786 WaitButton
Offset: 788 CloseMessageKeyPress2
Offset: 790 2B9
Offset: 792 SetVarEqVal 0x400F 0
Offset: 798 SetFlag 2768
Offset: 802 SetFlag 2783
Offset: 806 ClearFlag 15
Offset: 810 WaitMoment
Offset: 812 UnlockAll
Offset: 814 End
Offset: 816 StoreHeroPosition 0x68 0x8021 0x8022
Offset: 822 0x6E 0x8020
Offset: 826 67 0 0x8023 0x8024
Offset: 834 StoreVar 0x8020
Offset: 838 CompareTo 1
Offset: 842 Condition EQUAL
Offset: 846 StoreVar 0x8023
Offset: 850 CompareTo 5
Offset: 854 Condition EQUAL
Offset: 858 StoreVar 0x8024
Offset: 862 CompareTo 2
Offset: 866 Condition EQUAL
Offset: 870 Condition UNK
Offset: 874 Condition UNK
Offset: 878 If TRUEUP Function 15 (899 )
Offset: 885 ApplyMovement 0 Movement 2 (1668 )
Offset: 893 Jump Function 16 (1587 )

=== Function11===

Offset: 899 StoreVar 0x8020
Offset: 903 CompareTo 1
Offset: 907 Condition EQUAL
Offset: 911 StoreVar 0x8023
Offset: 915 CompareTo 7
Offset: 919 Condition EQUAL
Offset: 923 StoreVar 0x8024
Offset: 927 CompareTo 2
Offset: 931 Condition EQUAL
Offset: 935 Condition UNK
Offset: 939 Condition UNK
Offset: 943 If TRUEUP Function 17 (964 )
Offset: 950 ApplyMovement 0 Movement 3 (1680 )
Offset: 958 Jump Function 16 (1587 )

=== Function12===

Offset: 964 StoreVar 0x8020
Offset: 968 CompareTo 2
Offset: 972 Condition EQUAL
Offset: 976 StoreVar 0x8023
Offset: 980 CompareTo 7
Offset: 984 Condition EQUAL
Offset: 988 StoreVar 0x8024
Offset: 992 CompareTo 2
Offset: 996 Condition EQUAL
Offset: 1000 Condition UNK
Offset: 1004 Condition UNK
Offset: 1008 If TRUEUP Function 18 (1029 )
Offset: 1015 ApplyMovement 0 Movement 4 (1700 )
Offset: 1023 Jump Function 16 (1587 )

=== Function13===

Offset: 1029 StoreVar 0x8020
Offset: 1033 CompareTo 2
Offset: 1037 Condition EQUAL
Offset: 1041 StoreVar 0x8023
Offset: 1045 CompareTo 8
Offset: 1049 Condition EQUAL
Offset: 1053 StoreVar 0x8024
Offset: 1057 CompareTo 3
Offset: 1061 Condition EQUAL
Offset: 1065 Condition UNK
Offset: 1069 Condition UNK
Offset: 1073 If TRUEUP Function 19 (1094 )
Offset: 1080 ApplyMovement 0 Movement 5 (1716 )
Offset: 1088 Jump Function 16 (1587 )

=== Function14===

Offset: 1094 StoreVar 0x8020
Offset: 1098 CompareTo 2
Offset: 1102 Condition EQUAL
Offset: 1106 StoreVar 0x8023
Offset: 1110 CompareTo 7
Offset: 1114 Condition EQUAL
Offset: 1118 StoreVar 0x8024
Offset: 1122 CompareTo 4
Offset: 1126 Condition EQUAL
Offset: 1130 Condition UNK
Offset: 1134 Condition UNK
Offset: 1138 If TRUEUP Function 20 (1159 )
Offset: 1145 ApplyMovement 0 Movement 6 (1736 )
Offset: 1153 Jump Function 16 (1587 )

=== Function15===

Offset: 1159 StoreVar 0x8020
Offset: 1163 CompareTo 0
Offset: 1167 Condition EQUAL
Offset: 1171 StoreVar 0x8023
Offset: 1175 CompareTo 7
Offset: 1179 Condition EQUAL
Offset: 1183 StoreVar 0x8024
Offset: 1187 CompareTo 4
Offset: 1191 Condition EQUAL
Offset: 1195 Condition UNK
Offset: 1199 Condition UNK
Offset: 1203 If TRUEUP Function 21 (1224 )
Offset: 1210 ApplyMovement 0 Movement 7 (1752 )
Offset: 1218 Jump Function 16 (1587 )

=== Function16===

Offset: 1224 StoreVar 0x8020
Offset: 1228 CompareTo 0
Offset: 1232 Condition EQUAL
Offset: 1236 StoreVar 0x8023
Offset: 1240 CompareTo 6
Offset: 1244 Condition EQUAL
Offset: 1248 StoreVar 0x8024
Offset: 1252 CompareTo 5
Offset: 1256 Condition EQUAL
Offset: 1260 Condition UNK
Offset: 1264 Condition UNK
Offset: 1268 If TRUEUP Function 22 (1289 )
Offset: 1275 ApplyMovement 0 Movement 8 (1772 )
Offset: 1283 Jump Function 16 (1587 )

=== Function17===

Offset: 1289 StoreVar 0x8020
Offset: 1293 CompareTo 0
Offset: 1297 Condition EQUAL
Offset: 1301 StoreVar 0x8023
Offset: 1305 CompareTo 5
Offset: 1309 Condition EQUAL
Offset: 1313 StoreVar 0x8024
Offset: 1317 CompareTo 4
Offset: 1321 Condition EQUAL
Offset: 1325 Condition UNK
Offset: 1329 Condition UNK
Offset: 1333 If TRUEUP Function 23 (1354 )
Offset: 1340 ApplyMovement 0 Movement 9 (1788 )
Offset: 1348 Jump Function 16 (1587 )

=== Function18===

Offset: 1354 StoreVar 0x8020
Offset: 1358 CompareTo 3
Offset: 1362 Condition EQUAL
Offset: 1366 StoreVar 0x8023
Offset: 1370 CompareTo 5
Offset: 1374 Condition EQUAL
Offset: 1378 StoreVar 0x8024
Offset: 1382 CompareTo 4
Offset: 1386 Condition EQUAL
Offset: 1390 Condition UNK
Offset: 1394 Condition UNK
Offset: 1398 If TRUEUP Function 24 (1427 )
Offset: 1405 ApplyMovement 0 Movement 10 (1800 )
Offset: 1413 ApplyMovement 255 Movement 11 (1632 )
Offset: 1421 Jump Function 16 (1587 )

=== Function19===

Offset: 1427 StoreVar 0x8020
Offset: 1431 CompareTo 3
Offset: 1435 Condition EQUAL
Offset: 1439 StoreVar 0x8023
Offset: 1443 CompareTo 4
Offset: 1447 Condition EQUAL
Offset: 1451 StoreVar 0x8024
Offset: 1455 CompareTo 3
Offset: 1459 Condition EQUAL
Offset: 1463 Condition UNK
Offset: 1467 Condition UNK
Offset: 1471 If TRUEUP Function 25 (1500 )
Offset: 1478 ApplyMovement 0 Movement 12 (1812 )
Offset: 1486 ApplyMovement 255 Movement 13 (1652 )
Offset: 1494 Jump Function 16 (1587 )

=== Function20===

Offset: 1500 StoreVar 0x8020
Offset: 1504 CompareTo 3
Offset: 1508 Condition EQUAL
Offset: 1512 StoreVar 0x8023
Offset: 1516 CompareTo 5
Offset: 1520 Condition EQUAL
Offset: 1524 StoreVar 0x8024
Offset: 1528 CompareTo 2
Offset: 1532 Condition EQUAL
Offset: 1536 Condition UNK
Offset: 1540 Condition UNK
Offset: 1544 If TRUEUP Function 26 (1573 )
Offset: 1551 ApplyMovement 0 Movement 14 (1820 )
Offset: 1559 ApplyMovement 255 Movement 13 (1652 )
Offset: 1567 Jump Function 16 (1587 )

=== Function21===

Offset: 1573 24F 0 5
Offset: 1579 ReturnAfterDelay 1
Offset: 1583 CompareTo 0
Offset: 1587 WaitMovement
Offset: 1589 EndFunction
Offset 1591 :0
Offset 1592 :0
Offset 1593 :0
Offset 1594 :1
Offset 1595 :0
Offset 1596 :71
Offset 1597 :0
Offset 1598 :1
Offset 1599 :0
Offset 1600 :13
Offset 1601 :0
Offset 1602 :1
Offset 1603 :0
Offset 1604 :72
Offset 1605 :0
Offset 1606 :1
Offset 1607 :0
Offset 1608 :254
Offset 1609 :0
Offset 1610 :0
Offset 1611 :0
Offset 1612 :0
Offset 1613 :0
Offset 1614 :1
Offset 1615 :0
Offset 1616 :71
Offset 1617 :0
Offset 1618 :1
Offset 1619 :0
Offset 1620 :12
Offset 1621 :0
Offset 1622 :1
Offset 1623 :0
Offset 1624 :72
Offset 1625 :0
Offset 1626 :1
Offset 1627 :0
Offset 1628 :254
Offset 1629 :0
Offset 1630 :0
Offset 1631 :0

=== Movement 0 ===

Offset: 1632 m14 0x0
Offset: 1634 m1 0x0
Offset: 1636 m13 0x0
Offset: 1638 m1 0x0
Offset: 1640 m15 0x0
Offset: 1642 m2 0x0
Offset: 1644 m32 0x0
Offset: 1646 m1 0x0
Offset: 1648 m254 0x0
Offset 1650 :0
Offset 1651 :0

=== Movement 1 ===

Offset: 1652 m13 0x0
Offset: 1654 m1 0x0
Offset: 1656 m15 0x0
Offset: 1658 m1 0x0
Offset: 1660 m32 0x0
Offset: 1662 m1 0x0
Offset: 1664 m254 0x0
Offset 1666 :0
Offset 1667 :0

=== Movement 2 ===

Offset: 1668 m13 0x0
Offset: 1670 m1 0x0
Offset: 1672 m35 0x0
Offset: 1674 m1 0x0
Offset: 1676 m254 0x0
Offset 1678 :0
Offset 1679 :0

=== Movement 3 ===

Offset: 1680 m13 0x0
Offset: 1682 m2 0x0
Offset: 1684 m14 0x0
Offset: 1686 m2 0x0
Offset: 1688 m12 0x0
Offset: 1690 m1 0x0
Offset: 1692 m35 0x0
Offset: 1694 m1 0x0
Offset: 1696 m254 0x0
Offset 1698 :0
Offset 1699 :0

=== Movement 4 ===

Offset: 1700 m14 0x0
Offset: 1702 m2 0x0
Offset: 1704 m13 0x0
Offset: 1706 m1 0x0
Offset: 1708 m35 0x0
Offset: 1710 m1 0x0
Offset: 1712 m254 0x0
Offset 1714 :0
Offset 1715 :0

=== Movement 5 ===

Offset: 1716 m13 0x0
Offset: 1718 m1 0x0
Offset: 1720 m14 0x0
Offset: 1722 m3 0x0
Offset: 1724 m12 0x0
Offset: 1726 m1 0x0
Offset: 1728 m35 0x0
Offset: 1730 m1 0x0
Offset: 1732 m254 0x0
Offset 1734 :0
Offset 1735 :0

=== Movement 6 ===

Offset: 1736 m14 0x0
Offset: 1738 m2 0x0
Offset: 1740 m12 0x0
Offset: 1742 m1 0x0
Offset: 1744 m35 0x0
Offset: 1746 m1 0x0
Offset: 1748 m254 0x0
Offset 1750 :0
Offset 1751 :0

=== Movement 7 ===

Offset: 1752 m13 0x0
Offset: 1754 m1 0x0
Offset: 1756 m14 0x0
Offset: 1758 m2 0x0
Offset: 1760 m12 0x0
Offset: 1762 m2 0x0
Offset: 1764 m35 0x0
Offset: 1766 m1 0x0
Offset: 1768 m254 0x0
Offset 1770 :0
Offset 1771 :0

=== Movement 8 ===

Offset: 1772 m14 0x0
Offset: 1774 m1 0x0
Offset: 1776 m12 0x0
Offset: 1778 m2 0x0
Offset: 1780 m35 0x0
Offset: 1782 m1 0x0
Offset: 1784 m254 0x0
Offset 1786 :0
Offset 1787 :0

=== Movement 9 ===

Offset: 1788 m12 0x0
Offset: 1790 m1 0x0
Offset: 1792 m35 0x0
Offset: 1794 m1 0x0
Offset: 1796 m254 0x0
Offset 1798 :0
Offset 1799 :0

=== Movement 10 ===

Offset: 1800 m12 0x0
Offset: 1802 m1 0x0
Offset: 1804 m35 0x0
Offset: 1806 m1 0x0
Offset: 1808 m254 0x0
Offset 1810 :0
Offset 1811 :0

=== Movement 11 ===

Offset: 1812 m15 0x0
Offset: 1814 m1 0x0
Offset: 1816 m254 0x0
Offset 1818 :0
Offset 1819 :0

=== Movement 12 ===

Offset: 1820 m13 0x0
Offset: 1822 m1 0x0
Offset: 1824 m35 0x0
Offset: 1826 m1 0x0
Offset: 1828 m254 0x0
Offset 1830 :0

=== Script 1 ===

Offset: 1832 LockAll
Offset: 1834 StoreFlag 2406
Offset: 1838 CompareTo 0
Offset: 1842 Condition EQUAL
Offset: 1846 StoreFlag 2768
Offset: 1850 CompareTo 0
Offset: 1854 Condition EQUAL
Offset: 1858 Condition UNK
Offset: 1862 If TRUEUP Function 27 (1903 )
Offset: 1869 PlaySound 1351
Offset: 1873 FacePlayer
Offset: 1875 Cry 619 0
Offset: 1881 Message2 0 4 15 0 0 = ' ...Yeep? '
Offset: 1891 WaitCry
Offset: 1893 WaitButton
Offset: 1895 CloseMessageKeyPress
Offset: 1897 Jump Function 28 (2224 )

=== Function22===

Offset: 1903 StoreFlag 2768
Offset: 1907 CompareTo 1
Offset: 1911 Condition EQUAL
Offset: 1915 StoreFlag 2783
Offset: 1919 CompareTo 1
Offset: 1923 Condition EQUAL
Offset: 1927 Condition UNK
Offset: 1931 If TRUEUP Function 29 (1972 )
Offset: 1938 PlaySound 1351
Offset: 1942 FacePlayer
Offset: 1944 Cry 619 0
Offset: 1950 Message2 0 4 17 0 0 = ' Yeeeep. ♪ '
Offset: 1960 WaitCry
Offset: 1962 WaitButton
Offset: 1964 CloseMessageKeyPress
Offset: 1966 Jump Function 28 (2224 )

=== Function23===

Offset: 1972 StoreFlag 2768
Offset: 1976 CompareTo 1
Offset: 1980 Condition EQUAL
Offset: 1984 StoreFlag 2783
Offset: 1988 CompareTo 0
Offset: 1992 Condition EQUAL
Offset: 1996 Condition UNK
Offset: 2000 If TRUEUP Function 30 (2041 )
Offset: 2007 PlaySound 1351
Offset: 2011 FacePlayer
Offset: 2013 Cry 619 0
Offset: 2019 Message2 0 4 16 0 0 = ' Yeep! '
Offset: 2029 WaitCry
Offset: 2031 WaitButton
Offset: 2033 CloseMessageKeyPress
Offset: 2035 Jump Function 28 (2224 )

=== Function24===

Offset: 2041 PlaySound 1351
Offset: 2045 FacePlayer
Offset: 2047 Logic06 0x400E
Offset: 2051 SetVarHero 0
Offset: 2054 2BA
Offset: 2056 400E
Offset: 2058 Cry 619 0
Offset: 2064 StoreVar 0x400E
Offset: 2068 CompareTo 99
Offset: 2072 Condition LOWER/EQUAL
Offset: 2076 If TRUEUP Function 31 (2101 )
Offset: 2083 EventGreyMessage 22 2 = ' The steps of the Mienfoo walking\nwith [VAR NAME: 1 0] are somewhat clumsy. '
Offset: 2089 WaitCry
Offset: 2091 WaitButton
Offset: 2093 CloseMessageKeyPress2
Offset: 2095 Jump Function 28 (2224 )

=== Function25===

Offset: 2101 StoreVar 0x400E
Offset: 2105 CompareTo 199
Offset: 2109 Condition LOWER/EQUAL
Offset: 2113 If TRUEUP Function 32 (2138 )
Offset: 2120 EventGreyMessage 21 2 = ' The steps of the Mienfoo walking\nwith [VAR NAME: 1 0] are still clumsy. '
Offset: 2126 WaitCry
Offset: 2128 WaitButton
Offset: 2130 CloseMessageKeyPress2
Offset: 2132 Jump Function 28 (2224 )

=== Function26===

Offset: 2138 StoreVar 0x400E
Offset: 2142 CompareTo 299
Offset: 2146 Condition LOWER/EQUAL
Offset: 2150 If TRUEUP Function 33 (2175 )
Offset: 2157 EventGreyMessage 20 2 = ' The steps of the Mienfoo walking\nwith [VAR NAME: 1 0] are getting smooth. '
Offset: 2163 WaitCry
Offset: 2165 WaitButton
Offset: 2167 CloseMessageKeyPress2
Offset: 2169 Jump Function 28 (2224 )

=== Function27===

Offset: 2175 StoreVar 0x400E
Offset: 2179 CompareTo 364
Offset: 2183 Condition LOWER/EQUAL
Offset: 2187 If TRUEUP Function 34 (2212 )
Offset: 2194 EventGreyMessage 19 2 = ' The steps of the Mienfoo walking\nwith [VAR NAME: 1 0] are light! '
Offset: 2200 WaitCry
Offset: 2202 WaitButton
Offset: 2204 CloseMessageKeyPress2
Offset: 2206 Jump Function 28 (2224 )

=== Function28===

Offset: 2212 EventGreyMessage 18 2 = ' The steps of the Mienfoo walking\nwith [VAR NAME: 1 0] are very light!\r\nMienfoo seems to be\nsatisfied with the walk! '
Offset: 2218 WaitCry
Offset: 2220 WaitButton
Offset: 2222 CloseMessageKeyPress2
Offset: 2224 WaitMoment
Offset: 2226 UnlockAll
Offset: 2228 End

=== Script 2 ===

Offset: 2230 LockAll
Offset: 2232 PlaySound 1351
Offset: 2236 StoreFlag 15
Offset: 2240 CompareTo 0
Offset: 2244 Condition EQUAL
Offset: 2248 If TRUEUP Function 35 (2271 )
Offset: 2255 EventGreyMessage 23 2 = ' Is this a home video?\nMienfoo is in it! '
Offset: 2261 WaitButton
Offset: 2263 CloseMessageKeyPress2
Offset: 2265 Jump Function 36 (2330 )

=== Function29===

Offset: 2271 ApplyMovement 1 Movement 15 (2616 )
Offset: 2279 WaitMovement
Offset: 2281 PlaySound 1835
Offset: 2285 AngryMessage 11 2 168 = ' Hey, you! '
Offset: 2292 CloseAngryMessage
Offset: 2294 CloseBubbleMessage
Offset: 2296 ApplyMovement 255 Movement 1 (2656 )
Offset: 2304 WaitMovement
Offset: 2306 Message 0 4 14 1 0 0 = ' What are you doing?\r\nIn front of my very eyes,\nyou disrupt Mienfoo's walk...\r\nOn top of that, you got engrossed\nin watching TV.\c\nWhat nerve!\r\nStop taking a break, and walk\nmy Mienfoo!\r '
Offset: 2318 CloseMessageKeyPress2
Offset: 2320 ApplyMovement 1 Movement 1 (2656 )
Offset: 2328 WaitMovement
Offset: 2330 WaitMoment
Offset: 2332 UnlockAll
Offset: 2334 End

=== Script 3 ===

Offset: 2336 LockAll
Offset: 2338 PlaySound 1351
Offset: 2342 StoreFlag 15
Offset: 2346 CompareTo 0
Offset: 2350 Condition EQUAL
Offset: 2354 If TRUEUP Function 37 (2377 )
Offset: 2361 EventGreyMessage 24 2 = ' A somewhat expensive-looking...\nbut ordinary trash can. '
Offset: 2367 WaitButton
Offset: 2369 CloseMessageKeyPress2
Offset: 2371 Jump Function 38 (2466 )

=== Function30===

Offset: 2377 ApplyMovement 1 Movement 16 (2640 )
Offset: 2385 WaitMovement
Offset: 2387 PlaySound 1835
Offset: 2391 AngryMessage 11 2 168 = ' Hey, you! '
Offset: 2398 CloseAngryMessage
Offset: 2400 CloseBubbleMessage
Offset: 2402 24F 1 7
Offset: 2408 EndFunction
Offset 2410 :1
Offset 2411 :0
Offset 2412 :4
Offset 2413 :0
Offset 2414 :1
Offset 2415 :0
Offset 2416 :100
Offset 2417 :0
Offset 2418 :255
Offset 2419 :0
Offset 2420 :240
Offset 2421 :0
Offset 2422 :0
Offset 2423 :0
Offset 2424 :101
Offset 2425 :0
Offset 2426 :60
Offset 2427 :0
Offset 2428 :0
Offset 2429 :4
Offset 2430 :13
Offset 2431 :0
Offset 2432 :1
Offset 2433 :0
Offset 2434 :0
Offset 2435 :0
Offset 2436 :0
Offset 2437 :0
Offset 2438 :63
Offset 2439 :0
Offset 2440 :79
Offset 2441 :2
Offset 2442 :1
Offset 2443 :0
Offset 2444 :6
Offset 2445 :0
Offset 2446 :3
Offset 2447 :0
Offset 2448 :1
Offset 2449 :0
Offset 2450 :8
Offset 2451 :0
Offset 2452 :0
Offset 2453 :0
Offset 2454 :101
Offset 2455 :0
Offset 2456 :100
Offset 2457 :0
Offset 2458 :1
Offset 2459 :0
Offset 2460 :192
Offset 2461 :0
Offset 2462 :0
Offset 2463 :0
Offset 2464 :101
Offset 2465 :0

=== Function31===

Offset: 2466 WaitMoment
Offset: 2468 UnlockAll
Offset: 2470 End

=== Script 4 ===

Offset: 2472 LockAll
Offset: 2474 PlaySound 1835
Offset: 2478 ApplyMovement 1 Movement 17 (2624 )
Offset: 2486 WaitMovement
Offset: 2488 AngryMessage 11 2 168 = ' Hey, you! '
Offset: 2495 CloseAngryMessage
Offset: 2497 CloseBubbleMessage
Offset: 2499 24F 1 5
Offset: 2505 Logic06 1
Offset: 2509 CallRoutine 1
Offset: 2513 ApplyMovement 255 Movement 18 (2648 )
Offset: 2521 WaitMovement
Offset: 2523 Message 0 4 12 1 0 0 = ' What are you doing?\r\nI can understand very well\nthat my Mienfoo is so cute\c\nthat you want to take it out,\c\nbut you can't do that!\r\nIt's dangerous outside!\r\nWill you take responsibility\nif my Mienfoo gets hurt?\r\nPlease walk INSIDE the room!\r '
Offset: 2535 CloseMessageKeyPress2
Offset: 2537 253 0x4F01 258
Offset: 2543 600
Offset: 2545 300
Offset: 2547 100
Offset: 2549 800
Offset: 2551 0
Offset: 2553 6400
Offset: 2555 FF00
Offset: 2557 1E00
Offset: 2559 0
Offset: 2561 6500
Offset: 2563 6400
Offset: 2565 100
Offset: 2567 5400
Offset: 2569 0
Offset: 2571 6500
Offset: 2573 5300
Offset: 2575 End
Offset: 2577 WaitMoment
Offset: 2579 UnlockAll
Offset: 2581 End
Offset: 2583 D00
Offset: 2585 100
Offset: 2587 FE00
Offset: 2589 0
Offset: 2591 C00
Offset: 2593 100
Offset: 2595 FE00
Offset: 2597 0
Offset: 2599 F00
Offset: 2601 100
Offset: 2603 FE00
Offset: 2605 0
Offset: 2607 E00
Offset: 2609 100
Offset: 2611 FE00
Offset: 2613 0
Offset: 2615 0
Offset: 2617 100
Offset: 2619 FE00
Offset: 2621 0
Offset: 2623 100
Offset: 2625 100
Offset: 2627 FE00
Offset: 2629 0
Offset: 2631 200 256
Offset: 2635 FE00
Offset: 2637 0
Offset: 2639 300
Offset: 2641 100
Offset: 2643 FE00
Offset: 2645 0
Offset: 2647 2000
Offset: 2649 100
Offset: 2651 FE00
Offset: 2653 0
Offset: 2655 2100
Offset: 2657 100
Offset: 2659 FE00
Offset: 2661 0
Offset: 2663 2200
Offset: 2665 100
Offset: 2667 FE00
Offset: 2669 0
Offset: 2671 2300
Offset: 2673 100
Offset: 2675 FE00
Offset: 2677 0
Offset: 2679 4B00
Offset: 2681 100
Offset: 2683 FE00
Offset: 2685 0

Deokishisu
December 21st, 2012, 04:48 PM
Looking to the 4th and 5th generation for the solution is silly. Everything is handled differently when watered down to the level this has to be done at for the 3rd generation.

An inelegant solution for the warping problem is to hide a sprite somewhere on every map and move it after the warp is complete to serve as the follower, and then continue as normal, but how cumbersome that would be!

Is the follower coded as a legit people event with a people number and everything? If so, then you shouldn't have to worry about making them work in people's scripts where the player is moved. Just make sure everyone has the people number of the follower and have them define its movements separately, if they desync it its their problem. If not, pretend I didn't say anything.

Qualle50
January 3rd, 2013, 09:08 AM
Is it possible to make a second hero Pikachu) who does the same moves as the first hero but one time later?

U.Flame
February 25th, 2013, 09:09 PM
I hate posting in old threads, but this one is still fresh-ish and I'm hoping this project doesn't die. I'm curious though, if walking works and warps don't, how do connected maps behave? Are there any videos of progress?

Shiny Hilbert
February 28th, 2013, 07:51 PM
Plss dont let this project die!

AimayBee
March 1st, 2013, 04:07 AM
Plss dont let this project die!

Dude, this thing died back when someone figured it out and refused to share that information with us. That was years ago. It died out.

U.Flame
March 1st, 2013, 05:40 AM
So how much of it was completed? What was accomplished and what wasn't?
And why isn't the information shared?

Jambo51
March 1st, 2013, 10:16 AM
Dude, this thing died back when someone figured it out and refused to share that information with us. That was years ago. It died out.

It's not dead, more on hold.

So how much of it was completed? What was accomplished and what wasn't?
And why isn't the information shared?

I can't speak for why others didn't share their code, but I can explain why I didn't share mine.
It's very simple, I didn't share it because it was overcomplicated and I honestly believed there is a better way to do it. As of yet, I haven't reworked the code, so I haven't released anything.

AimayBee
March 1st, 2013, 10:23 AM
It's not dead, more on hold.

I can't speak for why others didn't share their code, but I can explain why I didn't share mine.
It's very simple, I didn't share it because it was overcomplicated and I honestly believed there is a better way to do it. As of yet, I haven't reworked the code, so I haven't released anything.

But if you did release it we could take a look at it and make it simpler some way. Two heads are better than one.

U.Flame
March 2nd, 2013, 09:28 AM
I'm happy to hear it's on hold rather than dead. I can understand holding it until it's properly improved.

Teh Blazer
March 2nd, 2013, 10:42 AM
I may be late to the party here, but it seems like the following sprite always is one step behind you. Once you take a new step, the follower takes the step you just took. Is it too much trouble to find out wherever the game registers the steps and create a branching routine or something mimicking it to attach onto another sprite so it'll take the last step you did?

Clearly I have no skill in this as I have no idea about what I'm talking about... is this even feasible?

pepepepote
March 4th, 2013, 07:07 PM
The only problem is that when you push against the OW `+1

Kaphotics
March 9th, 2013, 12:56 AM
Figured out how to do it in B2W2; no shenanigans like adding the overworld to every map.

5VAs68XQKUg

karatekid552
March 9th, 2013, 07:01 AM
About two months ago (before I even knew what "push {r1}" ment, lol) I read almost this entire thread to see what was going on here. At one point, Jambo mentioned looking into the unuesed createsprite command. For those of you who don't know, this command create an ow on screen that can only move in place. You can walk through it, but that is about it. This gave me an idea:

What if we modified the routine of the command to create a sprite that would just do your last movement, such as walking and running, in the exact same spot of the person you want to follow you. Then, hide the sprite of the that person, so now only the virtual sprite is on screen.

Now, warps: we could have the routine set a flag for being on, then a var for which Ow number is following, then make a small branch in the loading routine of the player after being warped that checks if the flag set by the create sprite command is active, then loads the correct ow from the var. This sprite would then appear after taking your first step and the modified createsprite command would take over, causeing them to follow you.

I don't know if this is possible, but it sure beats setting an OW on everymap.... Though, that is how GameFreak did secret bases....:p Let's be smarter than them, haha.

Rustdude
July 5th, 2013, 07:15 AM
I am VERY new to making Pokemon edits... But I'd love for there to be a script that let's pokemon follow you in the overworld.

karatekid552
July 5th, 2013, 08:51 AM
I am VERY new to making Pokemon edits... But I'd love for there to be a script that let's pokemon follow you in the overworld.

To do this with just scripting is impossible/it will look terrible. I'm currently researching a way to allow warps to work with this, but it will be some time before it is finished.

Rustdude
July 5th, 2013, 12:33 PM
To do this with just scripting is impossible/it will look terrible. I'm currently researching a way to allow warps to work with this, but it will be some time before it is finished.


I hope this can be figured out though in the near future... When I was younger I didn't know you could make hacks of the GBA games (mostly because that was back in 2005) but I made stories and my own region. But I made maps on paint. But with Advanced Map I'm starting to make them and right a story with it. I was hoping it will be done by the time I'm ready to release a beta.


Can't wait. Keep working hard on it and if you need any help I may be of some assistance having some experience in the scripting world.

Adura
July 6th, 2013, 02:35 PM
There's some impressive Follow Me scripts here O_o. It's too bad that the codes for some of them are bein' kept secret ; ;.

I tried making one myself about a year ago, and got it to kinda-sorta work.

You can watch a clip of it at youtube, but I can't link >.< Too few posts. Here is the end-trail of stuff for youtube: GHFzznDSjVE (youtube.com/watch?v=GHFzznDSjVE)

Unfortunately, it doesn't account for ledges, bikes or map changing =/. I was able to make up for the map changing by re-spawning and moving the sprite, but this would need to be done for each map >.<. This is why I don't use it much, since that is a huge pain D:.

If you want the scripts for this, I'll post what i have. Unfortunately, I don't remember exactly how I set it up before >.<. Also, I had trouble getting it to work for anything other then the hacked firered engine.

- new user: Adura~

Awkward.
July 6th, 2013, 04:41 PM
Okay, so this is a shot in the dark, but there's probably a way to fix the surfing/bike issue. My idea is just to hide the follower's sprite, but keep it moving right behind the player. Person events can still move even if they are hidden, so whenever the player uses Surf or the bike, just hide the sprite but keep it moving at the same speed right behind them. Then, when they get off, have the sprite reappear behind them (this could screw up with Surfing because the Pokemon would appear over the water, so maybe have it reappear on the same spot as the player). This would be pretty hard since the scripts for those two things are not regular scripts so it'd probably be tricky to edit the hidesprite thing, as well as having the sprite automatically move to wherever the player is on every map). But that's my take on it.

Rustdude
July 7th, 2013, 08:47 AM
That sounds like it could work. If you do a force the sprite to your tile it could work.

Soldier Randy
September 12th, 2013, 12:16 PM
I don't know if this will be useful since I know nothing about hacking or any of these stuff... But there is a game called Mother 3 (kick ass game btw).

In this game the whole party walks behind your main character, following each one of his moves.

Maybe somebody could look a bit into the game programing stuff and use it on Pokémon games for a follow me script. There's a team who made an english translation of the game (since it wasn't available outside of Japan), the game turn out with no problems, so maybe those guys can give some sort of help. One of them goes by the nickname Tomato...

Hope this helps...

Shiny Quagsire
September 12th, 2013, 02:20 PM
I don't know if this will be useful since I know nothing about hacking or any of these stuff... But there is a game called Mother 3 (kick ass game btw).

In this game the whole party walks behind your main character, following each one of his moves.

Maybe somebody could look a bit into the game programing stuff and use it on Pokémon games for a follow me script. There's a team who made an english translation of the game (since it wasn't available outside of Japan), the game turn out with no problems, so maybe those guys can give some sort of help. One of them goes by the nickname Tomato...

Hope this helps...

If you knew anything about GBA programming you would know that just "looking" at the "code" (which all has to be researched first) doesn't work. Heck, we hardly know half of what the Fire Red code does, so picking up a completely unresearched game is pretty much pointless considering it's taken us years to figure out how the FR engine works (to an extent).

TLDR; No. Just no.

karatekid552
September 12th, 2013, 03:57 PM
If you knew anything about GBA programming you would know that just "looking" at the "code" (which all has to be researched first) doesn't work. Heck, we hardly know half of what the Fire Red code does, so picking up a completely unresearched game is pretty much pointless considering it's taken us years to figure out how the FR engine works (to an extent).

TLDR; No. Just no.

Jambo51 was the closest to getting this working. But now he is done with hacking, so I wonder if he will let me work on it.... Shinyqaugsire, the only issue was warping. Any ideas? Mine was to hack the almost useless createsprite command, which does have OAM data and work with that.

0m3GA ARS3NAL
September 12th, 2013, 04:01 PM
I'm glad this is still looked after, after all these years. Also, JPAN ended up reworking a huge portion of the game engine in a huge patch he made a while back... if only he'd do it... lol.

Sliter
September 25th, 2013, 04:13 AM
I'm not sure how do it work, on BW was kinda funny xD
I know DPP have a "demo"for it on that park but just with a few pokemon, we can't do something like using the HgSs script and maybe the pokemon sprites to work a like?
(Also I'm thinking about like taking the maps from Pl, for example and putting everything on HgSs or BW engine XD but it's subject for another thread XD)

karatekid552
September 25th, 2013, 05:05 PM
I'm not sure how do it work, on BW was kinda funny xD
I know DPP have a "demo"for it on that park but just with a few pokemon, we can't do something like using the HgSs script and maybe the pokemon sprites to work a like?
(Also I'm thinking about like taking the maps from Pl, for example and putting everything on HgSs or BW engine XD but it's subject for another thread XD)

This is GBA, which had absolutely nothing to do with NDS. The coding is completely different. Mind you, it is hard coded into all of the games that have it, not a stand-alone script.

Sliter
September 25th, 2013, 08:05 PM
oh I see. but the idea is to make only one "thing" follow you, like on the BW example or make it work like in hg/ss?

karatekid552
September 26th, 2013, 04:31 AM
oh I see. but the idea is to make only one "thing" follow you, like on the BW example or make it work like in hg/ss?

If you read this thread, or looked on Jambo51's youtube, you would see that he has already accomplished this. The only issue is we can't find a way to load the sprite on warp. Soon I will begin working on this.

Jambo51
September 26th, 2013, 11:18 AM
Mind you, it is hard coded into all of the games that have it, not a stand-alone script.

That's because it HAS to be hardcoded, by definition. The GBA does nothing without code, and having a sprite "follow" you is among the more difficult things to achieve in ASM.

However, writing a new engine from scratch actually makes it relatively simple to achieve.

Anyway, technically, everything is hardcoded into the GBA games. Scripts are just combinations of pre-set pieces of code, after all.

karatekid552
September 26th, 2013, 02:10 PM
That's because it HAS to be hardcoded, by definition. The GBA does nothing without code, and having a sprite "follow" you is among the more difficult things to achieve in ASM.

However, writing a new engine from scratch actually makes it relatively simple to achieve.

Anyway, technically, everything is hardcoded into the GBA games. Scripts are just combinations of pre-set pieces of code, after all.

I tend to think of scripting as a higher level language, per se. I know how it all interlocks, but it just helps when thinking about how things work. What I was trying to say is that there is no way to do it with scripting alone and have it actually look good. ASM needs to be used.

Sending a pm to you, one sec...

Shiny Hilbert
October 12th, 2013, 06:55 PM
Any news or progress on this?

karatekid552
October 12th, 2013, 08:33 PM
Any news or progress on this?

I talked to Jambo, and he wants us to do a complete reboot of the project. His method, even though it worked, was very "clunky", and he is convinced there is a better way to do things. So, when I find some time, I'll be looking into it.

Jambo51
October 13th, 2013, 12:55 AM
I talked to Jambo, and he wants us to do a complete reboot of the project. His method, even though it worked, was very "clunky", and he is convinced there is a better way to do things. So, when I find some time, I'll be looking into it.

As a further to this, if you don't manage to find a better way, I'll release my code to you guys. Seem fair?

karatekid552
October 13th, 2013, 09:40 AM
As a further to this, if you don't manage to find a better way, I'll release my code to you guys. Seem fair?

Definitely fair. Since you have already done this, do you have any good ideas on alternate approaches? Your way involved writing directly to the OAMT states and manipulating the other sprite each frame. I have had thoughts of hacking the createsprite command so that it creates and then maintains a sprite one tile behind the player. On a warp, since there is no last tile, it wouldn't be loaded until the player steps off. And, if the player doubles back, then just swap their positions.

Shiny Quagsire
October 14th, 2013, 04:39 PM
Definitely fair. Since you have already done this, do you have any good ideas on alternate approaches? Your way involved writing directly to the OAMT states and manipulating the other sprite each frame. I have had thoughts of hacking the createsprite command so that it creates and then maintains a sprite one tile behind the player. On a warp, since there is no last tile, it wouldn't be loaded until the player steps off. And, if the player doubles back, then just swap their positions.

What I was thinking is to just store the player's previous map coordinates every time they are changed and create/modify an overworld sprite accordingly. Because that's all the follow-me system really does is move where your player last was before.

sab
October 23rd, 2013, 06:32 PM
What I was thinking is to just store the player's previous map coordinates every time they are changed and create/modify an overworld sprite accordingly. Because that's all the follow-me system really does is move where your player last was before.
That's what I was thinking, hence my extremely basic script posted a back on page five, but it has some problems. You'd also have to store when different types of motion were used, e.g. ledge jump, surf, etc. You'd also have to worry about things like warping. The coordinates would be located in the wrong place right after a warp unless you hid the sprite directly after a teleport. It seems to me like you'd also have to store all of the previous comparisons that were used for the player, then use them again, or just recalculate it entirely.

FBI agent
October 23rd, 2013, 06:47 PM
That's what I was thinking, hence my extremely basic script posted a back on page five, but it has some problems. You'd also have to store when different types of motion were used, e.g. ledge jump, surf, etc. You'd also have to worry about things like warping. The coordinates would be located in the wrong place right after a warp unless you hid the sprite directly after a teleport. It seems to me like you'd also have to store all of the previous comparisons that were used for the player, then use them again, or just recalculate it entirely.

I would just omit surfing and warping for now. Once the more basic things are done, a warp can be solved by just calling the original code again with a new set of parameters. As for surfing...**** surfing.

EDIT:
My bad algorithm (I didn't bother to check if someone came up with this already, sorry):
Have 4 variables change every time the player takes a step depending on the direction of the step. Darthatron and I had something that ran everystep and changed a variable, so this is easily possible. Something like:
Player up: var1 is 0x1
Player down: var2 is 0x1
Player left: var3 is 0x1
Player right: var4 is 0x1
Note var 1,2,3,4 are set to 0x0 after the following sprite is moved.
Now the sprite following the player is always behind the player, so set it to be Player (coord X-var3 + var 4) (coord Y-var2 + var1)

This way we do 4 variable writes and 4 variable reads per step (not much right?). We can also figure out which walk animation to apply to the sprite too depending on which var is 0x1. Also if the player is just turning around, this doesn't move the sprite following him.

karatekid552
October 24th, 2013, 02:43 AM
I would just omit surfing and warping for now. Once the more basic things are done, a warp can be solved by just calling the original code again with a new set of parameters. As for surfing...**** surfing.

EDIT:
My bad algorithm (I didn't bother to check if someone came up with this already, sorry):
Have 4 variables change every time the player takes a step depending on the direction of the step. Darthatron and I had something that ran everystep and changed a variable, so this is easily possible. Something like:
Player up: var1 is 0x1
Player down: var2 is 0x1
Player left: var3 is 0x1
Player right: var4 is 0x1
Note var 1,2,3,4 are set to 0x0 after the following sprite is moved.
Now the sprite following the player is always behind the player, so set it to be Player (coord X-var3 + var 4) (coord Y-var2 + var1)

This way we do 4 variable writes and 4 variable reads per step (not much right?). We can also figure out which walk animation to apply to the sprite too depending on which var is 0x1. Also if the player is just turning around, this doesn't move the sprite following him.

I actually really like this, however 8 calls to the var decrypter every frame may be a lot. Idk. In which case, we could just use one var, and set bits, not bytes, or simply use a byte of RAM (which will be super fast to read and write to.)

FBI agent
October 24th, 2013, 04:15 AM
I actually really like this, however 8 calls to the var decrypter every frame may be a lot. Idk. In which case, we could just use one var, and set bits, not bytes, or simply use a byte of RAM (which will be super fast to read and write to.)

You're right, the bits would be easier. Though I should mention it's every step, not frame :)

karatekid552
October 24th, 2013, 05:06 AM
You're right, the bits would be easier. Though I should mention it's every step, not frame :)

Right, that is true. Now we need to find the routine that moves the player. Then we can branch it and use it to move other NPC's also.

FBI agent
October 24th, 2013, 09:21 AM
Right, that is true. Now we need to find the routine that moves the player. Then we can branch it and use it to move other NPC's also.

I think you're thinking too deeply into it. We don't need to branch from any player movement routine. We can simply branch from the routine that runs every step. If we branch from there, and know X,Y that the sprite needs to be at as well as the animation the sprite needs to do, then the problem is solved. It's been a while since I've done any ASM work, but the algorithm steps would be something like:


--Stuff--
--Start of routine per step--
-- Branch @code --
--Rest of routine per step -- (note this is stuff used by the game)
-- Stuff --


-- @code --
step 1: assign variables in accordance to algorithm
step 2: calculate x and y of sprite (note we don't need current sprite x and y, just player's x and y which is stored and easily locatable)
step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh.
step 4: reset vars to 0
step 5: return safetly

EDIT: 06D5E8 was where the routine that activates every step was at. Well, I think it was there atleast :P

karatekid552
October 24th, 2013, 05:18 PM
I think you're thinking too deeply into it. We don't need to branch from any player movement routine. We can simply branch from the routine that runs every step. If we branch from there, and know X,Y that the sprite needs to be at as well as the animation the sprite needs to do, then the problem is solved. It's been a while since I've done any ASM work, but the algorithm steps would be something like:


--Stuff--
--Start of routine per step--
-- Branch @code --
--Rest of routine per step -- (note this is stuff used by the game)
-- Stuff --


-- @code --
step 1: assign variables in accordance to algorithm
step 2: calculate x and y of sprite (note we don't need current sprite x and y, just player's x and y which is stored and easily locatable)
step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh.
step 4: reset vars to 0
step 5: return safetly

EDIT: 06D5E8 was where the routine that activates every step was at. Well, I think it was there atleast :P

No. This won't work easily. You see, sprites are drawn by pixel, not the X/Y blocks. The reason I want to use the original move player routine is because it will do all of those calculations for us. Converting pixels to blocks will be a pain in the butt. Trust me, I have seen the way Jambo did it, and that involved directly moving the sprites in the OAM registers, which are done by pixels. While this does work, it is what we want to avoid.

"step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh."

Why write our own? The game already has one. Let's use it.

FBI agent
October 24th, 2013, 05:33 PM
No. This won't work easily. You see, sprites are drawn by pixel, not the X/Y blocks. The reason I want to use the original move player routine is because it will do all of those calculations for us. Converting pixels to blocks will be a pain in the butt. Trust me, I have seen the way Jambo did it, and that involved directly moving the sprites in the OAM registers, which are done by pixels. While this does work, it is what we want to avoid.

"step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh."

Why write our own? The game already has one. Let's use it.

Nonono, not make our own "move sprite" subroutine. I mean make our own subroutine that determines which "move sprite" to use (I.e which animation/direction). Catch my drift?

Edit:

"step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh."
I say we just run a script here that contains a single applymovement command on the following overworld.
So the routine determines which applymovement script to run (possible? I think it is).

EDIT2: Also if we were just using the original Player move routine then you'd still have to do calculations since the sprite is always BEHIND the player.

karatekid552
October 24th, 2013, 06:20 PM
Nonono, not make our own "move sprite" subroutine. I mean make our own subroutine that determines which "move sprite" to use (I.e which animation/direction). Catch my drift?

Edit:

"step 3: move sprite to x/y and do animation <-- hard part? I think you should make a subroutine for this tbh."
I say we just run a script here that contains a single applymovement command on the following overworld.
So the routine determines which applymovement script to run (possible? I think it is).

EDIT2: Also if we were just using the original Player move routine then you'd still have to do calculations since the sprite is always BEHIND the player.

First, I want to see how the game moves the player. Maybe it is just an applymovement. In which case, we can simply write a routine which stores the past two movements of the player, and we read from the second one to determine the next movement of the follower.

Here, set a break on the applymovement routine. See if it runs when you walk. It probably doesn't, but it is worth a shot.

FBI agent
October 24th, 2013, 06:41 PM
First, I want to see how the game moves the player. Maybe it is just an applymovement. In which case, we can simply write a routine which stores the past two movements of the player, and we read from the second one to determine the next movement of the follower.

Here, set a break on the applymovement routine. See if it runs when you walk. It probably doesn't, but it is worth a shot.

That actually sounds like a nice way to do it. Actually even if there is a small delay between the little sprite following, that'd still be a good first step. Wanna try it?

karatekid552
October 25th, 2013, 04:17 AM
That actually sounds like a nice way to do it. Actually even if there is a small delay between the little sprite following, that'd still be a good first step. Wanna try it?

Sure. In fact, a small delay would be cool, since it will look more realistic.

FBI agent
October 25th, 2013, 07:19 AM
Sure. In fact, a small delay would be cool, since it will look more realistic.

Yeah, a delay is nice, but I want it to be smooth in the end. Where if I hold down the up button the hero continuously moves up rather than move up once, wait for sprite to catch up, move up again...sorta thing. Basically we don't want a lagging feeling.

I'm a little cramped this Friday with academic activities, so lets try to get working early Saturday morning.

daniilS
October 25th, 2013, 08:30 AM
I have had an idea about how to do this. First, we have to assign a high, unused number to the following sprite. Then we have to create a branch to a subroutine directly after the hero proceeds to move. This is what it will look like, in this specific order:

Following disabled check
A check is run based on predefined things (like a certain minor tileset) whether following is disabled or not. If yes, set the disable byte to 01. If no, set it to 00. This byte will also be used when disabling following altogether through an option and/or level scripts.
Surfing/biking check
If the player is going to surf or cycle, or is doing it now, the surf/bike byte is set to 01. If not, it's set to 00.
Ledge jump check
Tricky one. If the player wants to jump, set the jump byte to 03. If it's on 02, set it to 01 and jump baced on the sprite facing. If it's on 01, set it to 00.
Skip following and hidesprite check
This checks the first two bytes described above. If any of them has a value of 01, the following sprite will be hidden and the subroutine will end.
Skip following check
This checks the third byte described above. If it has a value of 02, the following sprite WILL NOT be hidden, but the subroutine will end.
Applymovement
The moving part. It checks the sprite facing and does a step in that direction (applymovement).
Sprite existance check
If the sprite doesn't exist, then use the method described by FBI Agent to make it appear.


Another subroutine gets called AFTER the hero sprite has been moved. The only thing it does is making the following sprite face the player.



I haven't tested it out myself, because I lack the ASM skills to do this. I may also have made some very stupid mistakes in this. However, I hope this helps towards creating a fully-working follow me script.(Or should I say routine?)

karatekid552
October 25th, 2013, 12:50 PM
I have had an idea about how to do this. First, we have to assign a high, unused number to the following sprite. Then we have to create a branch to a subroutine directly after the hero proceeds to move. This is what it will look like, in this specific order:

Following disabled check
A check is run based on predefined things (like a certain minor tileset) whether following is disabled or not. If yes, set the disable byte to 01. If no, set it to 00. This byte will also be used when disabling following altogether through an option and/or level scripts.
Surfing/biking check
If the player is going to surf or cycle, or is doing it now, the surf/bike byte is set to 01. If not, it's set to 00.
Ledge jump check
Tricky one. If the player wants to jump, set the jump byte to 03. If it's on 02, set it to 01 and jump baced on the sprite facing. If it's on 01, set it to 00.
Skip following and hidesprite check
This checks the first two bytes described above. If any of them has a value of 01, the following sprite will be hidden and the subroutine will end.
Skip following check
This checks the third byte described above. If it has a value of 02, the following sprite WILL NOT be hidden, but the subroutine will end.
Applymovement
The moving part. It checks the sprite facing and does a step in that direction (applymovement).
Sprite existance check
If the sprite doesn't exist, then use the method described by FBI Agent to make it appear.


Another subroutine gets called AFTER the hero sprite has been moved. The only thing it does is making the following sprite face the player.



I haven't tested it out myself, because I lack the ASM skills to do this. I may also have made some very stupid mistakes in this. However, I hope this helps towards creating a fully-working follow me script.(Or should I say routine?)

Your ideas sound good, but I think you are over complicating it. If the player move like I think it moves, then we just need to log movements, and apply them to a sprite following him. At that point, only a var is needed as to log the event number of the sprite to move and a boolean to say if it is active. This would eliminate the need for ledge, hidesprite, and existence checks. Until we know how the player moves, we can't move forward on this.

ep!c
October 25th, 2013, 01:05 PM
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.

karatekid552
October 25th, 2013, 06:36 PM
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.

My goal is to do something of this sort, but first we need to know how to player moves. Then I can move the other character based upon the player's movements. I don't want to only use scripting commands because that can get clunky.

ep!c
October 26th, 2013, 01:43 AM
Not only.. I meant just a few that doesnt move sprites or generates them.

BugMania
October 26th, 2013, 03:44 AM
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
October 26th, 2013, 10:10 AM
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.

Hound of Justice
November 14th, 2013, 05:21 AM
Lol i want to see a hack with a hg ss type follow me some day

jsierra008
November 22nd, 2013, 08:45 PM
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
November 22nd, 2013, 09:16 PM
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

http://i.imgur.com/9P30KCd.png

Adura
November 26th, 2013, 11:08 PM
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:
GHFzznDSjVE

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.

Loading the Follower Script Information:

'---------------
#dynamic 0x00900220
#org 0x00900220
loadpointer 0x0 0x00900000
special 0x81
setvar 0x5000 0x1
checkflag 0x1005
if 0x1 call @end
getplayerpos 0x5018 0x5019
getplayerpos 0x5020 0x5021
movesprite 0xFE 0x5018 0x5019
getplayerpos 0x5014 0x5015
getplayerpos 0x5016 0x5017
release
end

#org @end
release
end

The follow script itself:


'---------
' Strings
'---------
#dynamic 0x00900000
#org 0x900000
release
checkflag 0x1005
if 0x1 call @end
copyvar 0x5010 0x5018
copyvar 0x5011 0x5019
copyvar 0x5012 0x5020
copyvar 0x5013 0x5021
copyvar 0x5006 0x5014
copyvar 0x5007 0x5015
copyvar 0x5008 0x5016
copyvar 0x5009 0x5017
subvar 0x5011 0x5007
compare 0x5011 0x1
if 0x1 call @MoveDown
subvar 0x5009 0x5013
compare 0x5009 0x1
if 0x1 call @MoveUp
subvar 0x5010 0x5006
compare 0x5010 0x1
if 0x1 call @MoveRight
subvar 0x5008 0x5012
compare 0x5008 0x1
if 0x1 call @MoveLeft
copyvar 0x5014 0x5018
copyvar 0x5015 0x5019
copyvar 0x5016 0x5020
copyvar 0x5017 0x5021
getplayerpos 0x5018 0x5019
getplayerpos 0x5020 0x5021
call 0x00905000

Special 0x8f /*the trainer position special*/
Special2 0x800d 0x7f /*returns 1 if ground battles, 2 if water battles*/
Compare 0x800d 0x1
If 0x1 call @grass
Compare 0x800d 0x2
If 0x1 call @water
return



#org @WentDown
applymovement 0xFE @Move1
return

#org @WentUp
applymovement 0xFE @Move2
return

#org @WentLeft
applymovement 0xFE @Move3
return

#org @WentRight
applymovement 0xFE @Move4
return

#org @WentDownRun
applymovement 0xFE @Move5
return

#org @WentUpRun
applymovement 0xFE @Move6
return

#org @WentLeftRun
applymovement 0xFE @Move7
return

#org @WentRightRun
applymovement 0xFE @Move8
return

#org @grass
Special 0x97 /*generates a random grass battle*/
return

#org @water
Special 0x98 /*generates a random water battle*/
return

'-----------
' Movements
'-----------
#org @Move1
#raw 0x10 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move2
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move3
#raw 0x12 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move4
#raw 0x13 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move5
#raw 0x1D 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move6
#raw 0x1E 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move7
#raw 0x1F 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move8
#raw 0x20 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @MoveDown
checkflag 0x82F
if 0x0 call @WentDown
if 0x1 call @CheckRunDown
return

#org @CheckRunDown
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentDownRun
compare 0x8006 0x2
if 0x1 call @WentDownRun
if 0x0 call @WentDown
return

#org @MoveUp
checkflag 0x82F
if 0x0 call @WentUp
if 0x1 call @CheckRunUp
return

#org @CheckRunUp
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentUpRun
compare 0x8006 0x2
if 0x1 call @WentUpRun
if 0x0 call @WentUp
return

#org @MoveLeft
checkflag 0x82F
if 0x0 call @WentLeft
if 0x1 call @CheckRunLeft
return

#org @CheckRunLeft
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentLeftRun
compare 0x8006 0x2
if 0x1 call @WentLeftRun
if 0x0 call @WentLeft
return

#org @MoveRight
checkflag 0x82F
if 0x0 call @WentRight
if 0x1 call @CheckRunRight
return

#org @CheckRunRight
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentRightRun
compare 0x8006 0x2
if 0x1 call @WentRightRun
if 0x0 call @WentRight
return


#org @end
call 0x00905000
Special 0x8f /*the trainer position special*/
Special2 0x800d 0x7f /*returns 1 if ground battles, 2 if water battles*/
Compare 0x800d 0x1
If 0x1 call @grass
Compare 0x800d 0x2
If 0x1 call @water
end

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

luke9631
December 27th, 2013, 01:35 AM
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
December 27th, 2013, 02:35 AM
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:
GHFzznDSjVE

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.

Loading the Follower Script Information:

'---------------
#dynamic 0x00900220
#org 0x00900220
loadpointer 0x0 0x00900000
special 0x81
setvar 0x5000 0x1
checkflag 0x1005
if 0x1 call @end
getplayerpos 0x5018 0x5019
getplayerpos 0x5020 0x5021
movesprite 0xFE 0x5018 0x5019
getplayerpos 0x5014 0x5015
getplayerpos 0x5016 0x5017
release
end

#org @end
release
end

The follow script itself:


'---------
' Strings
'---------
#dynamic 0x00900000
#org 0x900000
release
checkflag 0x1005
if 0x1 call @end
copyvar 0x5010 0x5018
copyvar 0x5011 0x5019
copyvar 0x5012 0x5020
copyvar 0x5013 0x5021
copyvar 0x5006 0x5014
copyvar 0x5007 0x5015
copyvar 0x5008 0x5016
copyvar 0x5009 0x5017
subvar 0x5011 0x5007
compare 0x5011 0x1
if 0x1 call @MoveDown
subvar 0x5009 0x5013
compare 0x5009 0x1
if 0x1 call @MoveUp
subvar 0x5010 0x5006
compare 0x5010 0x1
if 0x1 call @MoveRight
subvar 0x5008 0x5012
compare 0x5008 0x1
if 0x1 call @MoveLeft
copyvar 0x5014 0x5018
copyvar 0x5015 0x5019
copyvar 0x5016 0x5020
copyvar 0x5017 0x5021
getplayerpos 0x5018 0x5019
getplayerpos 0x5020 0x5021
call 0x00905000

Special 0x8f /*the trainer position special*/
Special2 0x800d 0x7f /*returns 1 if ground battles, 2 if water battles*/
Compare 0x800d 0x1
If 0x1 call @grass
Compare 0x800d 0x2
If 0x1 call @water
return



#org @WentDown
applymovement 0xFE @Move1
return

#org @WentUp
applymovement 0xFE @Move2
return

#org @WentLeft
applymovement 0xFE @Move3
return

#org @WentRight
applymovement 0xFE @Move4
return

#org @WentDownRun
applymovement 0xFE @Move5
return

#org @WentUpRun
applymovement 0xFE @Move6
return

#org @WentLeftRun
applymovement 0xFE @Move7
return

#org @WentRightRun
applymovement 0xFE @Move8
return

#org @grass
Special 0x97 /*generates a random grass battle*/
return

#org @water
Special 0x98 /*generates a random water battle*/
return

'-----------
' Movements
'-----------
#org @Move1
#raw 0x10 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move2
#raw 0x11 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move3
#raw 0x12 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move4
#raw 0x13 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move5
#raw 0x1D 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move6
#raw 0x1E 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move7
#raw 0x1F 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @Move8
#raw 0x20 'Step Up (Normal)
#raw 0xFE 'End of Movements

#org @MoveDown
checkflag 0x82F
if 0x0 call @WentDown
if 0x1 call @CheckRunDown
return

#org @CheckRunDown
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentDownRun
compare 0x8006 0x2
if 0x1 call @WentDownRun
if 0x0 call @WentDown
return

#org @MoveUp
checkflag 0x82F
if 0x0 call @WentUp
if 0x1 call @CheckRunUp
return

#org @CheckRunUp
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentUpRun
compare 0x8006 0x2
if 0x1 call @WentUpRun
if 0x0 call @WentUp
return

#org @MoveLeft
checkflag 0x82F
if 0x0 call @WentLeft
if 0x1 call @CheckRunLeft
return

#org @CheckRunLeft
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentLeftRun
compare 0x8006 0x2
if 0x1 call @WentLeftRun
if 0x0 call @WentLeft
return

#org @MoveRight
checkflag 0x82F
if 0x0 call @WentRight
if 0x1 call @CheckRunRight
return

#org @CheckRunRight
special2 0x8006 0x2b
compare 0x8006 0x3
if 0x1 call @WentRightRun
compare 0x8006 0x2
if 0x1 call @WentRightRun
if 0x0 call @WentRight
return


#org @end
call 0x00905000
Special 0x8f /*the trainer position special*/
Special2 0x800d 0x7f /*returns 1 if ground battles, 2 if water battles*/
Compare 0x800d 0x1
If 0x1 call @grass
Compare 0x800d 0x2
If 0x1 call @water
end

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.

~Pokedude~
January 2nd, 2014, 12:37 AM
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.

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
January 2nd, 2014, 08:39 AM
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
January 2nd, 2014, 08:43 PM
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.

Cheve_X
January 3rd, 2014, 05:31 PM
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
January 4th, 2014, 01:50 AM
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
January 4th, 2014, 07:18 AM
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
January 22nd, 2014, 12:49 PM
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.;)

Smeargle
January 22nd, 2014, 03:03 PM
make sure to share your findings as your look into this :)!

Shadows
February 5th, 2014, 06:52 PM
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
April 10th, 2014, 01:54 PM
Um... is this still being worked on or is it dead in the water.

karatekid552
April 10th, 2014, 05:51 PM
Um... is this still being worked on or is it dead in the water.

It is gently paused because neither of us have a ton of free time right now. Don't worry, it will happen.

Mr.Mako
April 11th, 2014, 02:42 AM
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
May 1st, 2014, 01:42 AM
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
May 1st, 2014, 11:33 AM
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
May 1st, 2014, 01:44 PM
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:
t2SCUSSJDSk
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 Hilbert
May 9th, 2014, 04:09 PM
So there is a posibility that we can see this fully implemented and working before the end of 2014?

Shiny Quagsire
May 9th, 2014, 05:10 PM
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.

HidoranBlaze
May 9th, 2014, 06:01 PM
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
May 22nd, 2014, 12:18 PM
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