• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Quick Research & Development Thread

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
    • Seen Feb 24, 2024
    Requested mons for trades are in the trade data. The format isn't documented anywhere that I know of, but if you search the ROM for the nicknames/OTs of the traded mons you'll find the structs which contain that, as well as what mons you recieve.

    It's almost certainly possible to repoint and expand this, too. If you can figure out what more than five or so of the parts of that table do please write it down, I'm sure a lot of people could put it to use.
     

    Le pug

    Creator of Pokémon: Discovery / Fat Kid
    870
    Posts
    10
    Years
  • Requested mons for trades are in the trade data. The format isn't documented anywhere that I know of, but if you search the ROM for the nicknames/OTs of the traded mons you'll find the structs which contain that, as well as what mons you recieve.

    It's almost certainly possible to repoint and expand this, too. If you can figure out what more than five or so of the parts of that table do please write it down, I'm sure a lot of people could put it to use.

    Well I found that DOTS the Ralts is at 338ED0 ... no repoints go to it or any of the following also:
    PLUSES the Volbeat at 338F0C and 338F84 for MEOWOW the Meowth

    Edit: still researching around ... but I found that at 338F44 is the appropriate "82 01" which is Volbeat's pokemon number. Changed it to 81 01 to see if it would now register to look for Castform and it worked!

    edit 2: so i used the program Trader Advanced ... there is an option to add more trades to the game. When I added more and tested to see if the var 8008 would allow the player to search for the pokemon in his party and it worked. So for a checkpokemoninyourparty command all you need:

    This script:
    Spoiler:


    and download Trader Advanced and add as many as you want and change what pokemon each number checks for :D

    credits go to me for the research... mr_mako helped out by suggesting the program Trader Advanced and of course the maker of T.A. ty for the program
     
    Last edited:

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    If anyone ever wants to make a tag battle script in Emerald, here's something that can help you :)

    #dynamic 0xE40000
    #org @start
    lock
    special 0x28
    fadescreen 0x1
    special 0x2A
    waitstate
    compare LASTRESULT 0x0
    if 0x5 goto @yes
    special 0x29
    goto @end

    #org @yes
    special 0xFB
    setvar 0x8004 0x2
    setvar 0x8005 0x4
    special 0xEA
    setvar 0x8004 0x8
    setvar 0x8005 0x0
    special 0xEF
    waitstate
    setvar 0x8004 0x6
    special 0xEA
    special 0x29
    copyvar 0x8000 LASTRESULT
    compare 0x8000 0x1
    if 0x1 goto @continue
    fadescreen 0x1
    special 0xCB
    waitstate
    goto @continue

    #org @end
    release
    end
     
    Last edited:
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen Feb 26, 2024

    Check/Count a Specific Pokémon Species in the Party (FR/LG/Em)

    So I'm not sure if there is a way to do this by scripting in these games, and I saw that trading-style thing post just a few above, but I wrote up a quick bit of ASM code to count the number of a specific species of Pokémon in the party, as a bit of practice for myself, and I thought I would share it.

    The reason I wrote is so that it could be mainly used as a checkpartypokemon-like command in a script.

    It works for FireRed and LeafGreen with no changes, works for Emerald by performing the changes given, and will probably work with any game as long as you find the matching offsets. ;)

    Anyway, here's the ASM for FR/LG:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global CountPartyPokemonSpecies
    
    main:
    	push {r0-r7, lr}
    	mov r5, #0x0 @ This means fail
    	ldr r6, var
    	ldr r7, party_amount
    	ldrb r4, [r7] @ Get Pokemon count from r7
    	cmp r4, #0x0
    	beq exit
    	ldrh r3, [r6] @ Get the species to check
    	cmp r3, #0x0
    	beq exit @ Don't allow Missingno. This doesn't limit the species from going up, though.
    	mov r7, #0x0
    loop:
    	ldr r0, first_pokemon @ Offset of first Pokemon
    	mov r1, #0x64 @ Length of Pokemon RAM data
    	mul r1, r1, r7 @ r7 holds current index
    	add r0, r0, r1
    	bl decrypt_poke_species @ Get this specific species.
    	mov r9, r0
    	pop {r0-r7}
    	cmp r9, r3
    	bne next
    	add r5, r5, #0x1 @ Increase the counter
    next:
    	add r7, r7, #0x1 @ Increase party index
    	cmp r7, r4 @ And compare against the number in the party
    	blo loop @ I could use a bls here?
    exit:
    	str r5, [r6, #0x10] @ Store the result (r5) in r6 (the var -- 0x800D)
    	pop {r0-r7, pc} @ Return
    
    decrypt_poke_species:
    	push {r0-r7}
    	mov r1, #0xB @ This is the index for the Pokemon species.
    	ldr r2, decrypt_poke @ Call the Pokemon decryption code
    	bx r2
    	
    .align 2
    party_amount:
    	.word 0x02024029
    first_pokemon:
    	.word 0x02024284
    var: @ Got this beauty from HackMew.
    	.word 0x020270B8 + (0x8004 * 2)
    decrypt_poke:
    	.word 0x0803FBE9

    And to work for Emerald, you need only change the end stuff:
    Code:
    .align 2
    party_amount:
    	.word 0x020244E9
    first_pokemon:
    	.word 0x020244EC
    var: @ Got this beauty from HackMew.
    	.word 0x020275D8 + (0x8004 * 2)
    decrypt_poke:
    	.word 0x0806A519
    Some of it is based off some stuff from HackMew's Pokemon take away code, so yeah.

    And of course, here's a sample script explaining how to use it:
    Code:
    #dynamic 0x800000
    
    #include stdpoke.rbh
    
    #org @start
    lock
    faceplayer
    bufferpokemon 0x0 PKMN_MAGIKARP
    setvar 0x8004 PKMN_MAGIKARP // Change this to the species you want
    callasm 0x08XXXXXX // This is the offset of the routine + 1
    compare LASTRESULT 0x1 // The count is stored in 0x800D
    if B_>= goto @some // It will be 0 if there is none, or 1-6 for the count
    msgbox @m1 MSG_KEEPOPEN // It also counts eggs, so yeah...
    release
    end
    
    #org @some
    buffernumber 0x1 LASTRESULT
    msgbox @m2 MSG_KEEPOPEN
    release
    end
    
    #org @m1
    = You don't have any [buffer1]!
    
    #org @m2
    = Wow! You have [buffer2] [buffer1]!

    3_magikarp_zps4ef36cd0.png

    I hope someone finds this useful, even if for just an example for beginners to learn from.
    Enjoy~! ^_^

    EDIT: I added Emerald, although I didn't test it. ;)
    EDIT 2: I tested the Emerald code, and it works. ^_^
     
    Last edited:

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    writebytetooffset 0x2 0x2037590 in Emerald makes you go fast (mach bike fast). Thanks kboy6 for helping me find that =).
    Anyways, when you use the bike, that's what happens. However, when I do the writebytetooffset 0x2 0x2037590 your speed changes, but not OW. I'm gonna try to figure something out to make the sprite change, once I do, I'll post that here =)
     

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    Why not build on this—could this be invoked to speed up bike-riding in FireRed, I wonder? By having this automatically execute in place of how it currently works?

    Since it works in Emerald, I imagine the same could be done (to a different offset) in Ruby/Sapphire.

    By the way, has anyone figured out exactly how HM badge limits are done?

    There is an offset for Fire Red, found by diegoisawesome, I'll get it in a bit. And about your question, are you talking about the ones like rock smash, or the ones like surf, waterfall, etc?
    In Emerald, I found the surf script, it had no checkflag 0x(badge) but rather checkattack 0x39(surf) so maybe it's in the movement permission 4?
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    Does anyone know how/why many OW's have default text-colours (red/blue) and how this could be changed?
     

    Danny0317

    Fluorite's back, brah
    1,067
    Posts
    10
    Years
    • Age 24
    • Seen Nov 19, 2023
    So I don't know if this has been done before, but in Emerald I was able to find out how to use surf while controlled by a different flag(in this case I made it the first gym flag)
    It was very simple, go to 0x9c81c and replace those two bytes with the reverse hex number.

    Here is a video as demonstration. https://www.dropbox.com/s/xmzdo1dc32cyz9c/vid.AVI

    However, as of now, it can't be used from the Pokemon menu, gonna try to fix that.

    And if anyone wants to do this for FR, I found this by first:
    Looked for the hex version of checkattack 0x39 in the rom.
    Found the script (surf script), and got the offset.
    Made it a pointer, looked for it in the rom, then I noticed that close to it, it had a flag, the fifth gym flag, so as a test I tried to change it to the first gym flag, and it worked ^__^
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    So I don't know if this has been done before, but in Emerald I was able to find out how to use surf while controlled by a different flag(in this case I made it the first gym flag)
    It was very simple, go to 0x9c81c and replace those two bytes with the reverse hex number.

    Here is a video as demonstration. https://www.dropbox.com/s/xmzdo1dc32cyz9c/vid.AVI

    However, as of now, it can't be used from the Pokemon menu, gonna try to fix that.

    And if anyone wants to do this for FR, I found this by first:
    Looked for the hex version of checkattack 0x39 in the rom.
    Found the script (surf script), and got the offset.
    Made it a pointer, looked for it in the rom, then I noticed that close to it, it had a flag, the fifth gym flag, so as a test I tried to change it to the first gym flag, and it worked ^__^

    Haven't tested this, but there is a dword at 0806D59C that is loaded by the surf routine that currently reads 24 08 00 00 (0x824 - fifth gym badge). That's a flag check right there. That might help you with the Pokemon menu issue.
     
    3,830
    Posts
    14
    Years
    • Age 27
    • OH
    • Seen Feb 26, 2024
    So I don't know if this has been done before, but in Emerald I was able to find out how to use surf while controlled by a different flag(in this case I made it the first gym flag)
    It was very simple, go to 0x9c81c and replace those two bytes with the reverse hex number.

    Here is a video as demonstration. https://www.dropbox.com/s/xmzdo1dc32cyz9c/vid.AVI

    However, as of now, it can't be used from the Pokemon menu, gonna try to fix that.

    And if anyone wants to do this for FR, I found this by first:
    Looked for the hex version of checkattack 0x39 in the rom.
    Found the script (surf script), and got the offset.
    Made it a pointer, looked for it in the rom, then I noticed that close to it, it had a flag, the fifth gym flag, so as a test I tried to change it to the first gym flag, and it worked ^__^

    I actually posted the stuff for FireRed about two years ago. ^_^
    For anyone that wants to change the badge required for surf, the offset of the flag is 0806D59C. Also, I'm pretty sure that 0806D5D0 is waterfall, but I haven't tested it. (FireRed)

    There seriously needs to be like an index for all of these posts...
     

    machomuu

    Stuck in Hot Girl Summer
    10,507
    Posts
    16
    Years
  • There seriously needs to be like an index for all of these posts...
    I was thinking the same thing. This thread is filled with unfiled information, making it useful, but at the same time, a crapshoot to look through. Generally it's a case of someone remembering a specific post and linking to it, but when someone comes into this thread looking for something specific, they could very easily miss it in these 23 pages of info (and counting).
     

    Shiny Quagsire

    I'm Still Alive, Elsewhere
    697
    Posts
    14
    Years
  • I actually posted the stuff for FireRed about two years ago. ^_^


    There seriously needs to be like an index for all of these posts...

    That is why we create fully-blown Research threads. Guess I'll span the HM discussion into one later.

    I think it wouldn't be too horrible if there was a sort of research "index" which compiled all the existing research into a nice, quickly searchable index thread. I've had mixed results with the PC search tool in the past and an index thread would be great. Especially if it covered all the mini posts covered in this thread (which is a lot).
     

    Touched

    Resident ASMAGICIAN
    625
    Posts
    9
    Years
    • Age 122
    • Seen Feb 1, 2018
    …yeeeeah don't use PC's search. </responsible admin>

    If anyone wants to compile a list of a topic of interest, we can try it and I'll slip it into the first post.

    Actually, let's create an index for the entire R&D forum, which we can categorise everything into.

    I could write a script that checks every post on this forum for code tags and strings formatted like offsets, if you want (maybe some other criteria, too). That would filter out most of the conversation and only give out the information in need of indexing. Let me know if that would be useful.
     

    knizz

    192
    Posts
    16
    Years
    • Seen Oct 28, 2020
    I could write a script that checks every post on this forum for code tags and strings formatted like offsets, if you want (maybe some other criteria, too). That would filter out most of the conversation and only give out the information in need of indexing. Let me know if that would be useful.

    IMO nothing beats a hand-written summary. This board isn't very fast anyway.
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    Rather than overcomplicating it we just need someone to go through this thread and put the posts/findings into categories, with short descriptions and links. It wouldn't take that long to comb through. I'm away for the weekend but I'm happy to make something on Monday if it'll help order this thread. Can always add other, individual threads to that list afterwards.

    Ala:


    Feel free to copy/paste this and add your own - remember to quote to get the formatting and links. If you feel I've missed anything important (I'm on to Page 5) then feel free to add it in wherever. I'm only looking quickly and people may value different pieces more than my rookie eye.

    [FONT=&quot]

    Research & Development Directory


    Graphics Research

    [FireRed] Bag-arrow animation (knizz)

    Scripting Research

    [FireRed] Decap for plural items (colcolstyles)
    [Emerald] Egg Hatching Script (diegoisawesome)
    [FireRed] HM Animations (knizz)

    Mechanics Research


    Hex Editing:
    [Ruby] Editing Battle Tower opponents. (Chaos Rush)
    [FireRed] Making HMs Deleteable (JPAN)
    [Emerald] Altering badge effects (diegoisawesome)
    [Emerald] Steven's double battle team (Wichu)
    [FireRed] Controlling other OWs in game (knizz)
    [FireRed] Run without holding B (sonic1)
    [FireRed] Player Movement info (knizz)
    [FireRed] Pokedex Classifcation (colcolstyles)
    [FireRed] Titlescreen Duration/Frames (colcolstyles)
    [D/P] Pokedex Order | Post 1 | Post 2 (Imdst&Knizz)
    ASM Required:


    Other

    [All] Save blocks locations / Using Variables safely (JPAN)


    [/font]
     
    Last edited:

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    Rather than overcomplicating it we just need someone to go through this thread and put the posts/findings into categories, with short descriptions and links. It wouldn't take that long to comb through. I'm away for the weekend but I'm happy to make something on Monday if it'll help order this thread. Can always add other, individual threads to that list afterwards.

    Ala:

    Spoiler:

    I think we should split the mechanics section into two: asm routines and simple hex edits.
     
    Last edited:
    5,256
    Posts
    16
    Years
  • Quick Research/Development Thread Directory

    Quick Research/Development Thread Directory


    Mechanics Research


    Scripting Research


    Graphics Research


    Audio Research


    Other


    Key:

    [FR] - FireRed / LeafGreen (usually just FireRed)
    [EM] - Emerald
    [RS] - Ruby / Sapphire (usually just Ruby)
    [OTHER] - Not necessarily specific to ROMs
    [PMD] - Pokémon Mystery Dungeon (not necessarily the same versions)
    [Part #] - Links to other posts that expand upon or correct the first part

    =======================

    I did change a few formatting things so that the links aren't coloured black, to maintain compatibility with PC's darker styles, and to make it more obvious that they are clickable links, and I removed the usernames as they're on the posts anyway and it may become inconsistent if and when certain users get name changes, as well as for simplicity's sake when adding to the index. I also made it so that the links don't go directly to the post but to the post's position in the thread so that any collateral information in replies / previous posts are in the user's view when going back to these posts.

    =======================

    The list is now finished and sorted by games! I also added an Audio section as I feel there is enough for it to be justified.

    Here's a raw version of the index with formatting and everything in case something happens to this post / if you want to add it to the OP / etc.

    If there are any inaccurate or vague headings you think should be renamed please do call me out.

    Note that I have stopped updating this post, please just refer to the OP now.
     
    Last edited:

    DJTiki

    top 3 most uninteresting microcelebrities
    1,257
    Posts
    10
    Years
  • Does anyone have any idea, if how you would go about skipping Oak's Speech in FRLG, and instead replace it with a script? Or if it is possible, change where the Title Screen takes you, by changing the pointer of the titlescreen to a script offset?

    EDIT: I realized I'll need to implement custom C, to do this, so disregard this.
     
    Last edited:
    Back
    Top