Advertiser Content

Research PokéRide in Gen 3

Started by Petuuuhhh January 29th, 2019 11:59 AM
  • 658 views
  • 4 replies

Petuuuhhh

Age 25
Male
Georgia
Seen 1 Week Ago
Posted 2 Weeks Ago
619 posts
2.2 Years
Hi, I'm working on a PokéRide implementation in Gen 3, specifically FireRed. However, I want this thread to be focused on any iteration of Gen 3, be it binary or decomp. I have gotten a fully functional Lapras Paddle item working using JPAN's Hacked Engine in FireRed that I want to share.

Lapras Paddle Item(FR)
Spoiler:
#dynamic 0x720000

'---------------
#org @start
special 0x8F // Returns the player map position, the X to 0x8004 and the y to 0x8005. Coordinates are the same as the ones for the map in AdvanceMap. (From JPAN's study on specials)
Loads coordinates into 0x8004/ 0x8005 (From Dr. Fuji)
special2 0x8000 0x11F // special 0x11F returns to a variable the facing you had when activating the event (From JPAN's study on specials)
Places the direction the player is facing into 0x8000. I this far more reliable than other methods of checking facing (From Dr. Fuji)
compare 0x8000 0x1
if 0x1 call @snippet1
compare 0x8000 0x2
if 0x1 call @snippet2
compare 0x8000 0x3
if 0x1 call @snippet3
compare 0x8000 0x4
if 0x1 call @snippet4 // Checks which way the player is facing and branches/returns depending on the answer (From Dr. Fuji)
special 0x7F // Gets Tile Attributes. 0x8004 is the X position on the map. 0x8005 is the Y position on the map (From JPAN's Hacked Instruction Manual)
Places the tile's behaviour bytes into 0x8004/ 0x8005 (From Dr. Fuji)
compare 0x8005 0x410
if 0x1 goto @snippet5
compare 0x8005 0x411
if 0x1 goto @snippet5
compare 0x8005 0x15
if 0x1 goto @snippet5
compare 0x8005 0x415
if 0x1 goto @snippet5 // These 4 compares check for Surfable tile behavior bytes (From Dr. Fuji)
In Advance Map, you'll notice that Surfable tiles have behavior bytes 10 04, 11 04, 15 00, and most commonly, 15 04. When checking for behavior bytes, you'll need to give the first byte second and the second byte first because that's how little endian works. (From hjk321) Note that some water tiles have the behavior bytes 00 00 in Advance Map. To allow them to be checked and have the normal Surfable behavior, change them to 15 04
goto @snippet6

'---------------
#org @snippet1
addvar 0x8005 0x1
return

'---------------
#org @snippet2
subvar 0x8005 0x1
return

'---------------
#org @snippet3
subvar 0x8004 0x1
return

'---------------
#org @snippet4
addvar 0x8004 0x1
return // These are returning the X and Y coordinates of the player. They are for adding/subtracting to the coordinates based on the direction the player is facing, so that we may check if the tile in front of the player is water (From hjk321)

'---------------
#org @snippet5
special 0x8F // special 0x8F puts the player's position in 0x8004 and 0x8005 which so happens to be the direct imput for special 0x7F (hjk321)
special 0x7F
compare 0x8005 0x410
if 0x1 goto @snippet6
compare 0x8005 0x411
if 0x1 goto @snippet6
compare 0x8005 0x15
if 0x1 goto @snippet6
compare 0x8005 0x415
if 0x1 goto @snippet6
goto @snippet7

'---------------
#org @snippet6
msgbox @string1 MSG_FACE '"Oak's words echoed... There's a\nt..."
end

'---------------
#org @snippet7
msgbox @string2 MSG_YESNO '"The water is dyed a deep blue[.]\n..."
compare LASTRESULT 0x0
if 0x1 goto @snippet8
special 0x27 // Updates a copy of your party at address stored at 03005008 +0x38. the number of pokemon in that party copy is stored 4 bytes before the start (From JPAN's study on specials)
setvar 0x8004 0xF // setvar 0x8004 is the party pokémon slot to delete, while 0xF deletes entire party. (From JPAN's Hacked Instruction Manual)
special 0x62 // Executes the deletion (From JPAN's Hacked Instruction Manual)
givepokemon 0x83 0x0 0x0 0x0 0x0 0x0 // Gives the player a Lapras at level 0 in slot 1
bufferfirstpokemon 0x0 // Buffers the Lapras
setanimation 0x0 0x0 // Sets the Surf animation to Lapras
msgbox @string3 MSG_KEEPOPEN '"[buffer1] used SURF!"
doanimation 0x9 // Does the Surf animation with Lapras
checkanimation 0x9 // Keeps the game from replacing your party too early, causing the first Pokémon in your party to use Surf instead of Lapras
special 0x28 // Replaces your party with the one stored with the code above. If you never used special 0x27, the party is that of the last time you loaded the game (From JPAN's study on specials)
releaseall
end

'---------------
#org @snippet8
releaseall
end


'---------
' Strings
'---------
#org @string1
= Oak's words echoed... There's a\ntime and place for everything,\lbut not now.

#org @string2
= The water is dyed a deep blue[.]\nWould you like to SURF?

#org @string3
= [buffer1] used SURF!
You will need to refer "Run a script from an items "Use" command or from registering it from select..." from this post to be able to have a Lapras Paddle item: https://www.pokecommunity.com/showpost.php?p=7202888&postcount=1

Additionally, if you want to be able to click on the Surfable water to be able to use the item, hjk321 created a script for that.

Lapras Paddle Surfable Behavior Byte Change(FR)
Spoiler:
#dynamic 0x800000

'---------------
#org @start
checkitem 0xXX 0x1 // Checks for item 0xXX (Hex code of your item you want to act as a Lapras Paddle item)
compare LASTRESULT 0x1
if 0x1 goto @snippet1
end

'---------------
#org @snippet1
special 0x8F
special 0x7F
compare 0x8005 0x410
if 0x1 goto @snippet2
compare 0x8005 0x411
if 0x1 goto @snippet2
compare 0x8005 0x15
if 0x1 goto @snippet2
compare 0x8005 0x415
if 0x1 goto @snippet2
goto @snippet3

'---------------
#org @snippet2
end

'---------------
#org @snippet3
msgbox @string1 MSG_YESNO '"The water is dyed a deep blue[.]\n..."
compare LASTRESULT 0x0
if 0x1 goto @snippet4
special 0x27
setvar 0x8004 0xF
special 0x62
givepokemon 0x83 0x0 0x0 0x0 0x0 0x0
bufferfirstpokemon 0x0
setanimation 0x0 0x0
msgbox @string2 MSG_KEEPOPEN '"[buffer1] used SURF!"
doanimation 0x9
checkanimation 0x9
special 0x28
releaseall
end

'---------------
#org @snippet4
releaseall
end


'---------
' Strings
'---------
#org @string1
= The water is dyed a deep blue[.]\nWould you like to SURF?

#org @string2
= [buffer1] used SURF!
You will need to edit JPAN's "256 pointer table that allows assigning a script to any byte, regardless of what they had in the past" (From JPAN's Hacked Instruction Manual)

Go to 0x1A3054 and put your reverse pointer to the Lapras Paddle Surfable Behavior Byte Change script.

Last, there's a pointer to the Surf script at 0x6D5A0 (From FBI). Change that to your reverse pointer to the Lapras Paddle Surfable Behavior Byte Change script.

Now you can either use the item or just click on the water and have it check for the item!

Video of the item and the behavior byte change: https://streamable.com/8u23z

Update: Machamp Shove and PokeRide code implementation: https://streamable.com/m9jit

So, now, if you have any implementations of your own that you want to share, I'd like to see it! It'll be good for the community.

Credits:
JPAN
Darthatron
Dr. Fuji
hjk321
FBI
PokemonAce123 for helping me out with making it compatible with a full party

FBI

Free supporter

Male
Unknown Island
Seen 15 Hours Ago
Posted March 30th, 2019
1,906 posts
6.4 Years
FBI, I've updated the OP with a video (https://streamable.com/8u23z).
I like it. That's a creative way to combine all of those hacks together. Something you should consider is making the Pokemon appear in the overworld and do something. I've seen fan game creators experiment with this, but it would a pretty impressive feature to have in your implementation. It becomes feasible since Pokeride is only limited to a certain number of Pokemon.

Wish you luck, and good work so far.
...

Petuuuhhh

Age 25
Male
Georgia
Seen 1 Week Ago
Posted 2 Weeks Ago
619 posts
2.2 Years
Machamp Shove Overworld Script (Gen 3)
Spoiler:
#dynamic 0x720000

'---------------
#org @start
lockall
checkflag 0x805
if 0x1 goto @snippet1
checkitem 0x34 0x1
compare LASTRESULT 0x1
if 0x1 goto @snippet2
goto @snippet3

'---------------
#org @snippet1
msgbox @string1 MSG_SIGN '"STRENGTH made it possible to move\..."
end

'---------------
#org @snippet2
special 0x27
setvar 0x8004 0xF
special 0x62
givepokemon 0x44 0x0 0x0 0x0 0x0 0x0
bufferfirstpokemon 0x0
setanimation 0x0 0x0
msgbox @string2 MSG_YESNO '"It's a big boulder, but a POKéMON\..."
compare LASTRESULT 0x0
if 0x1 goto @snippet4
closeonkeypress
doanimation 0x28
checkanimation 0x28
goto @snippet5

'---------------
#org @snippet3
msgbox @string3 MSG_SIGN '"It's a big boulder, but a POKéMON\..."
end

'---------------
#org @snippet4
releaseall
end

'---------------
#org @snippet5
setflag 0x805
msgbox @string4 MSG_SIGN '"[buffer1] used STRENGTH!\p[buffer1..."
special 0x28
end


'---------
' Strings
'---------
#org @string1
= STRENGTH made it possible to move\nboulders around.

#org @string2
= It's a big boulder, but a POKéMON\nmay be able to push it aside.\pWould you like to use STRENGTH?

#org @string3
= It's a big boulder, but a POKéMON\nmay be able to push it aside.

#org @string4
= [buffer1] used STRENGTH!\p[buffer1]'s STRENGTH made it\npossible to move boulders around!
PokeRide Item (Gen 3)
Spoiler:
#dynamic 0x720000

'---------------
#org @start
multichoice 0x0 0x0 0x20 0x0
copyvar 0x8000 LASTRESULT
compare 0x8000 0x0
if 0x1 goto @snippet1
compare 0x8000 0x1
if 0x1 goto @snippet2
compare 0x8000 0x7F
if 0x1 goto @snippet3
'---------------
#org @snippet1
showpokepic 0x83 0xA 0x3
cry 0x83 0x0
msgbox @string1 MSG_YESNO '"Would you like to use Lapras\nPadd..."
copyvar 0x8000 LASTRESULT
compare 0x8000 0x1
if 0x1 goto @snippet4
closeonkeypress
hidepokepic
end

'---------------
#org @snippet2
showpokepic 0x44 0xA 0x3
cry 0x44 0x0
msgbox @string2 MSG_YESNO '"Would you like to use Machamp\nSho..."
copyvar 0x8000 LASTRESULT
compare 0x8000 0x1
if 0x1 goto @snippet5
closeonkeypress
hidepokepic
end

'---------------
#org @snippet3
end

'---------------
#org @snippet4
hidepokepic
call @snippet6
end

'---------------
#org @snippet5
hidepokepic
call @snippet7
end

'---------------
#org @snippet6
special 0x8F
special2 0x8000 0x11F
compare 0x8000 0x1
if 0x1 call @snippet8
compare 0x8000 0x2
if 0x1 call @snippet9
compare 0x8000 0x3
if 0x1 call @snippet10
compare 0x8000 0x4
if 0x1 call @snippet11
special 0x7F
compare 0x8005 0x410
if 0x1 goto @snippet12
compare 0x8005 0x411
if 0x1 goto @snippet12
compare 0x8005 0x15
if 0x1 goto @snippet12
compare 0x8005 0x415
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet7
lockall
checkflag 0x805
if 0x1 goto @snippet14
goto @snippet15

'---------------
#org @snippet8
addvar 0x8005 0x1
return

'---------------
#org @snippet9
subvar 0x8005 0x1
return

'---------------
#org @snippet10
subvar 0x8004 0x1
return

'---------------
#org @snippet11
addvar 0x8004 0x1
return

'---------------
#org @snippet12
special 0x8F
special 0x7F
compare 0x8005 0x410
if 0x1 goto @snippet13
compare 0x8005 0x411
if 0x1 goto @snippet13
compare 0x8005 0x15
if 0x1 goto @snippet13
compare 0x8005 0x415
if 0x1 goto @snippet13
goto @snippet16

'---------------
#org @snippet13
msgbox @string3 MSG_FACE '"Oak's words echoed... There's a\nt..."
end

'---------------
#org @snippet14
msgbox @string4 MSG_SIGN '"STRENGTH made it possible to move\..."
end

'---------------
#org @snippet15
special 0x27
setvar 0x8004 0xF
special 0x62
givepokemon 0x44 0x0 0x0 0x0 0x0 0x0
bufferfirstpokemon 0x0
setanimation 0x0 0x0
closeonkeypress
doanimation 0x28
checkanimation 0x28
goto @snippet17

'---------------
#org @snippet16
msgbox @string5 MSG_YESNO '"The water is dyed a deep blue[.]\n..."
compare LASTRESULT 0x0
if 0x1 goto @snippet18
special 0x27
setvar 0x8004 0xF
special 0x62
givepokemon 0x83 0x0 0x0 0x0 0x0 0x0
bufferfirstpokemon 0x0
setanimation 0x0 0x0
msgbox @string6 MSG_KEEPOPEN '"[buffer1] used SURF!"
doanimation 0x9
checkanimation 0x9
special 0x28
releaseall
end

'---------------
#org @snippet17
setflag 0x805
msgbox @string7 MSG_SIGN '"[buffer1] used STRENGTH!\p[buffer1..."
special 0x28
end

'---------------
#org @snippet18
releaseall
end


'---------
' Strings
'---------
#org @string1
= Would you like to use Lapras\nPaddle?

#org @string2
= Would you like to use Machamp\nShove?

#org @string3
= Oak's words echoed... There's a\ntime and place for everything,\lbut not now.

#org @string4
= STRENGTH made it possible to move\nboulders around.

#org @string5
= The water is dyed a deep blue[.]\nWould you like to SURF?

#org @string6
= [buffer1] used SURF!

#org @string7
= [buffer1] used STRENGTH!\p[buffer1]'s STRENGTH made it\npossible to move boulders around!
Advertiser Content