The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Quick Research & Development Thread (https://www.pokecommunity.com/showthread.php?t=205158)

Shufflejoy June 26th, 2014 9:46 PM

Quote:

Originally Posted by jirachiwishmaker (Post 8319526)
I was facing the same problem a few days ago. Repoint the battle script at 0x2DBD84 is not means to replace the original one with the new one directly in the address.

Firstly, you can place all the machine code in 0xECC060 like this:
http://www.pokecommunity.com/attachment.php?attachmentid=72469&stc=1&d=1403844557

Then replace the two pointers here from 84 BD 2D 08 to 60 C0 EC 08:
http://www.pokecommunity.com/attachment.php?attachmentid=72470&stc=1&d=1403844557

http://www.pokecommunity.com/attachment.php?attachmentid=72471&stc=1&d=1403844557

Finally, replace the bytes at 0x3DE7C with B5 DE 03 08. It may working properly now.

Ahh, I understand what I'd done wrong now. I was trying to replace the original battle script, instead of finding the pointers to it and changing those. Thanks a lot!

xGal July 7th, 2014 1:53 PM

Well, I have been researching this: http://www.pokecommunity.com/showthread.php?t=212540.

In the thread, the threadstarter gave an offset for the table of the pictures when you enter a map (like viridian forest's trees, cave enterance in Mt. Moon etc.), the offset is: 0x8043E9E8.
It is possible to repoint the table, however there is a limiter, and Shiny Quagsire told me that the limiter is in 0x80F8104 :).

Tlachtli July 15th, 2014 8:57 PM

Does anyone know the byte(s) to change in Emerald to increase the number of usable sound channels? I've been looking everywhere, but can't seem to find the post it was in.

mamamama July 15th, 2014 10:52 PM

Quote:

Originally Posted by Tlachtli (Post 8352245)
Does anyone know the byte(s) to change in Emerald to increase the number of usable sound channels? I've been looking everywhere, but can't seem to find the post it was in.

Put B0 B5 00 03 10 at 0x86B49C4 to increase the playable tracks from 10 to 16

Put CC at 0x82E0105 increase the 5 DirectSound limit.

kearnseyboy6 July 17th, 2014 5:23 PM

In case anyone had not of thought of this, replicating the repeating trainer battles on warp in BW2 is as easy as setting their trainer flag, or clearing flag 0x5XX

Tlachtli July 22nd, 2014 6:57 AM

Quote:

Originally Posted by Chaos Rush (Post 8309821)
http://i.imgur.com/hgIR3F3.pnghttp://i.imgur.com/SGbwSqm.png

XY added a feature that gives experience points when you catch pokemon. To duplicate this in Emerald, do the following:

Repoint the battle script at x2dbd84 to point to this:

2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

where XX XX XX XX is a pointer to:

2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08

To let the player's mons evolve from this experience, replace the bytes at x3DE7C with B5 DE 03 08.

credit obviously goes to DoesntKnowHowToPlay for doing this first on FireRed lol

I believe I've found an interesting bug with this. Under normal circumstances it works fine: you battle, catch, gain xp, display Pokedex entry:
http://i.imgur.com/RSflXni.png

However if you level up from that xp, it causes the Pokedex to go wonky:
http://i.imgur.com/IAJLx8z.png http://i.imgur.com/YkvbOFB.png

EDIT: Found another small graphical bug, too. Learning a move on level-up after successfully catching a Pokemon will cause the wild Poke's sprite to re-appear after exiting the move learning screen. Unimportant in the long run, as the battle ends right after.

Alisa180 July 22nd, 2014 3:56 PM

I recently started ASM hacking. My first goal is to expand on Jambo51's pre-battle Mugshot routine hack and allow actual mugshots (rather then just sized-up sprites).

After lots of reading, research, and digging through ASM and hex data, I felt confident enough to try something. And jackpot!

If Jambo51's mugshot routine is installed, at location 0808386E, the data at r4 corresponds to the opponent Trainer sprite loaded into the mugshot. In this case, my byte was 6D corresponding to the Rocket sprite. If you change the byte here to a byte corresponding to a different Trainer sprite (In my case, I changed it to 6B, corresponding to the Scientist sprite), then the game will load the new sprite into the mugshot WITHOUT changing the opponent Trainer sprite!

I'd post screenshots, but I'm not allowed to post links yet.

This can be used as a starting point for a routine that can call opponent mugshots like in later generations. One can insert a routine at this point to call an image to replace the pre-battle mugshot. I'm still figuring out what part of the code actually resizes the sprite, but once I do, the potential routine can be written to skip over that part of the code.

Now to learn more ASM so I can actually try writing said routine.

Shiny Quagsire July 23rd, 2014 7:32 AM

Quote:

Originally Posted by Tlachtli (Post 8363021)
I believe I've found an interesting bug with this. Under normal circumstances it works fine: you battle, catch, gain xp, display Pokedex entry:
http://i.imgur.com/RSflXni.png

However if you level up from that xp, it causes the Pokedex to go wonky:
http://i.imgur.com/IAJLx8z.png http://i.imgur.com/YkvbOFB.png

It looks to me like BG0 is just a bit offset. I bet there's a battle script command to fix that, but I can't be certain.

Alisa180 July 25th, 2014 11:29 PM

After several days of digging through and fiddling with the mugshot routine, I managed to produce THIS:

http://s26.postimg.org/btv5yjwzt/Mugshot_4.png

I got this by replacing 0F 48 at offset 080838B2 with 00 00. This confirms for me that the routine cuts the sprites in half before re-sizing them. The sprites are tilted oddly enough, but I can work with it if I have to.

Danny0317 July 27th, 2014 8:04 PM

Hate to be "that guy," but does anyone know the offset for the wailmer (I think it is) in Emerald that the player surfs on? I tried looking around in NSE, around the OW area, and couldn't find it. However in VBA in the OAM viewer it was there. Sorry if this is the wrong place.

Windsong July 28th, 2014 1:45 AM

Quote:

Originally Posted by Dark Sneasel (Post 8372597)
Hate to be "that guy," but does anyone know the offset for the wailmer (I think it is) in Emerald that the player surfs on? I tried looking around in NSE, around the OW area, and couldn't find it. However in VBA in the OAM viewer it was there. Sorry if this is the wrong place.

This one? You can find it at 004F5498~

http://puu.sh/aulcG/b2a0c26cc1.png

daniilS July 29th, 2014 11:06 AM

Applymovement 0x9F in FireRed makes the character look left and right. I haven't seen this before, so maybe it's interesting to know.

Danny0317 July 29th, 2014 11:32 AM

Trying out some movements in Emerald because I have nothing better to do

0x4F - Player runs in place, facing down doesn't seem to stop, even with 0xFE after.
0x50 -0x53 - nothing.
0x5A and 0x5B -player faces up, 0xFE doesn't cancel the effects
0x5e - After it finishes when you walk right, it uses the walk left sprite.
0x68 - same as 0x4F
0x69 - same, but runs facing up instead
0x6A - same, but runs facing left instead
0x6B - same, but runs facing right instead
0x6C - seems to be walking in place, facing down
0x6D - seems to be walking in place, facing up
0x6E - seems to be walking in place, facing left
0x6F - seems to be walking in place, facing right
0x9B - player starts flying and does something cool http://imgur.com/qhLqOel

EDIT: I forgot to add another applymovement, my bad. 0x5F cancels the effect of 0x5E.

daniilS July 31st, 2014 2:47 AM

Here's a preview of the stuff in my upcoming Movement Documentation:
A piece of asm that makes you run-jump off ledges if B is pressed and you are not on a bike. It just annoyed me that when you were running you would still walk-jump off them, so I came up with a fix.

Code:

.text
.align 2
.thumb
.thumb_func
.global jump_2_with_sound_new

main:
        push {r4, lr}
        mov r4, r0
        mov r0, #0xA
        bl +0x16090
        mov r0, r4
        bl +0x7ED4
        ldr r1, buttonz
        ldrb r1, [r1]
        mov r4, #0x2
        and r1, r4
        beq next
        ldr r1, walkrun
        ldrb r1, [r1]
        cmp r1, #0x2
        beq next
        add r0, #0x70
next:
        mov r1, #0x8
        bl -0x218
        pop {r4, pc}

.align 2
buttonz:        .word 0x0300311C
walkrun:        .word 0x02037078

/*insert at 0805C23C*/


EDIT: fixed a typo.

Danny0317 August 1st, 2014 7:05 PM

Not sure if this could be of use to anyone, but I found this in emerald. sadly, it has no checkflag, I was trying to find a way to make you be able to use surf without the badge, but then again, maybe this could be useful to someone?

'---------------
#org 0x271EA0
checkattack 0x39
compare LASTRESULT 0x6
if 0x1 goto 0x8271ED6
bufferpartypokemon 0x0 LASTRESULT
setanimation 0x0 LASTRESULT
lockall
msgbox 0x8272FD6 MSG_YESNO '"The water is dyed a deep blue[.]\n..."
compare LASTRESULT 0x0
if 0x1 goto 0x8271ED5
msgbox 0x827300D MSG_KEEPOPEN '"[buffer1] used SURF!"
doanimation 0x9
releaseall
end

'---------------
#org 0x271ED6
end

'---------------
#org 0x271ED5
releaseall
end


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

#org 0x27300D
= [buffer1] used SURF!

DJTiki August 3rd, 2014 2:06 PM

So I want to implement a feature, which has a ZERO requirement for HM's. Of course, I wanted the things like Surf, Cut, etc. to still be available, at least in the overworld. I do believe that Pokémon, uses a something of a "check move" command, to initate the HM Overworld Exploring process. But since, we are removing HM's, what about a TM/HM Compatibility Check, to see if it could learn the moves, rather than if it haves the HM. It makes more sense that Pokémon can use HM's without their moves. All Water Pokémon can use Surf and Waterfall, not even having to use the HM's given.

The dynamic offsets for the TMHM Compatibilty Table follows as so:
BPRE(Fire Red)- 43C68
AXVE(Ruby)- 403B0
BPEE(Emerald)- 6E048

I'm pretty sure that is absolutely useless, but wanted to post something other than my ideas. I may start looking over Move Tutors, since they need to look into TMHM Compatibilty to teach moves. I'll edit this post with future findings.

Deokishisu August 3rd, 2014 2:25 PM

Quote:

Originally Posted by DJTiKi (Post 8383856)
So I want to implement a feature, which has a ZERO requirement for HM's. Of course, I wanted the things like Surf, Cut, etc. to still be available, at least in the overworld. I do believe that Pokémon, uses a something of a "check move" command, to initate the HM Overworld Exploring process. But since, we are removing HM's, what about a TM/HM Compatibility Check, to see if it could learn the moves, rather than if it haves the HM. It makes more sense that Pokémon can use HM's without their moves. All Water Pokémon can use Surf and Waterfall, not even having to use the HM's given.

The dynamic offsets for the TMHM Compatibilty Table follows as so:
BPRE(Fire Red)- 43C68
AXVE(Ruby)- 403B0
BPEE(Emerald)- 6E048

I'm pretty sure that is absolutely useless, but wanted to post something other than my ideas. I may start looking over Move Tutors, since they need to look into TMHM Compatibilty to teach moves. I'll edit this post with future findings.

I've had something exactly like this implemented in my hack for quite some time, where if a Pokemon is capable of learning a HM, it can use it in the field. I just did it the lazy way and scripted cut trees/rock smash rocks/surf script/etc. to check your party for a list of pokemon compatible with the moves. It will prefer Pokemon that know the move before choosing one that doesn't but can learn. It's inelegant, and lazy, but it works and is indistinguishable graphically from using HM moves in the field normally. I haven't come up with a solution for Fly, and since I'm on the fence about including it as a field move, I've not really tried. Ideally, the option for Fly in the party menu would appear after obtaining the badge and its HM, as that would be conceivably the earliest the player would be able to use it if they're not trading. But, that begs the question, do teleport and dig get the same treatment? Would having them available at no cost with a Pokemon that can learn it in your party make the game too easy?

EDIT: I suppose if you were really lazy, you could have the person that gives you Fly give you a Flight Map key item, or something, that checks the party for a Pokemon capable of using Fly before callasm-ing the flight map and letting you select a location.

DJTiki August 3rd, 2014 2:42 PM

Quote:

Originally Posted by Deokishisu (Post 8383878)
I've had something exactly like this implemented in my hack for quite some time, where if a Pokemon is capable of learning a HM, it can use it in the field. I just did it the lazy way and scripted cut trees/rock smash rocks/surf script/etc. to check your party for a list of pokemon compatible with the moves. It will prefer Pokemon that know the move before choosing one that doesn't but can learn. It's inelegant, and lazy, but it works and is indistinguishable graphically from using HM moves in the field normally. I haven't come up with a solution for Fly, and since I'm on the fence about including it as a field move, I've not really tried. Ideally, the option for Fly in the party menu would appear after obtaining the badge and its HM, as that would be conceivably the earliest the player would be able to use it if they're not trading. But, that begs the question, do teleport and dig get the same treatment? Would having them available at no cost with a Pokemon that can learn it in your party make the game too easy?

The usage of Fly, would be a tough one. The main problem with this is the limitations, bound by Badges. I belive there is ASM, for turning the HM's to TM's, so I'd use that. So maybe, if we remove the option for badge orientated limitations, then this could be looked around. Funny you say that, about the scripts, because I thought of the same thing. xD

In terms of making the game easier. In my game, having the access to Dig and Teleport, wouldn't make much of a deference. But if we are talking hacks as a whole, it would make it easier. But that means, the player can focus more on the design aspects of the region, without worrying about placing many barriers. Also another issue, may be that you can go anywhere. Being how, most progression barriers, are HM overworld limits. So this is more of an implematation, more focused to an open setting, than a linear one. So yes, it would definetly make an 8 badge journey hacks, more easier. But it's also a convience to hackers, making more open-orientated game, like me :), who would love a feature like this, as both a player and hacker,

daniilS August 3rd, 2014 11:15 PM

I'd rather go with a type check. So you'd need a grass or bug type for cut, a fighting type for rock smash, a flying type for fly, and so on.

Le pug August 4th, 2014 3:22 AM

Alright so me and DarkSneasel were trying to find a way to checkpokemon in your party for events in Emerald...

so I looked at all the different in-game trading scripts and I figured out this script:

Spoiler:
#org @event
lock
setvar 0x8008 0x1
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFF
copyvar 0x8009 LASTRESULT
special 0xA2
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto @noaa
copyvar 0x8005 0x800A
special2 LASTRESULT 0x102
copyvar 0x800B LASTRESULT
comparevars LASTRESULT 0x8009
if 0x1 goto @noaa
msgbox @talk 0x6
release
end

#org @noaa
msgbox @talk3 0x6
release
end

#org @talk3
= YOU HAVE THE VOLBEAT

#org @talk
= You have nothing!


This script won't go through with the script unless you select from your party a volbeat. Here is a video rep of it:
https://www.dropbox.com/s/lb4kj8h1quelcz7/here.AVI

So I noticed that what actually should change it is the 0x8008 var. There are 4 different in-game trading scripts. Check out the difference between three of them:

For volbeat:
Spoiler:
setvar 0x8008 0x0
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFF
copyvar 0x8009 LASTRESULT
msgbox 0x82159E8 MSG_YESNO '"Huh? My POKéMON is cute?\nSure, I ..."
compare LASTRESULT 0x0
if 0x1 goto 0x82159BD
special 0xA2
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto 0x82159BD
copyvar 0x8005 0x800A
special2 LASTRESULT 0x102
copyvar 0x800B LASTRESULT
comparevars LASTRESULT 0x8009
if 0x5 goto 0x82159C7
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0x100
special 0x101
waitstate
msgbox 0x8215A77 MSG_KEEPOPEN '"Eheheh[.]\nPlease be good to my PO..."
setflag 0x99
release
end


For Ralts:
Spoiler:
setvar 0x8008 0x1
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFF
copyvar 0x8009 LASTRESULT
msgbox 0x821637B MSG_YESNO '"Wrooooaaar! I need it!\nI have to ..."
compare LASTRESULT 0x0
if 0x1 goto 0x821633D
special 0xA2
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto 0x821633D
copyvar 0x8005 0x800A
special2 LASTRESULT 0x102
copyvar 0x800B LASTRESULT
comparevars LASTRESULT 0x8009
if 0x5 goto 0x8216347
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0x100
special 0x101
waitstate
bufferpokemon 0x0 0x8009
msgbox 0x8216440 MSG_KEEPOPEN '"Oh, yeah, right on!\p[buffer1], we..."
setflag 0x9B
release
end


For Skitty:
Spoiler:
setvar 0x8008 0x3
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFF
copyvar 0x8009 LASTRESULT
msgbox 0x826508D MSG_YESNO '"My POKéMON is a [buffer2].\nDo you..."
compare LASTRESULT 0x0
if 0x1 goto 0x826506B
special 0xA2
waitstate
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if 0x1 goto 0x826506B
copyvar 0x8005 0x800A
special2 LASTRESULT 0x102
copyvar 0x800B LASTRESULT
comparevars LASTRESULT 0x8009
if 0x5 goto 0x8265075
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0x100
special 0x101
waitstate
msgbox 0x8265128 MSG_KEEPOPEN '"Oh, it's adorable!\nThank you!\lI ..."
setflag 0x9C
release
end


So we're trying to figure out how to make this fully functional so the hacker can change what pokemon it's looking for. I'm pretty sure it's in 0x8008 var. So if anyone has any more clues, it'd be awesome to help out!

DoesntKnowHowToPlay August 4th, 2014 5:31 AM

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 August 4th, 2014 9:11 AM

Quote:

Originally Posted by DoesntKnowHowToPlay (Post 8384713)
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:
setvar 0x8008 0x(your number from Trader Advance minus one)
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFF
copyvar 0x8009 LASTRESULT
special 0xA2
waitstate
copyvar 0x8005 0x8004
special2 LASTRESULT 0x102
copyvar 0x800B LASTRESULT
comparevars LASTRESULT 0x8009
if 0x1 goto @continuewithscript


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

Danny0317 August 5th, 2014 1:31 PM

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

esperance August 6th, 2014 12:02 PM

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]!



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. ^_^

Danny0317 August 7th, 2014 9:55 PM

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 =)


All times are GMT -8. The time now is 8:53 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.