• 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.

Code: ASM Resource Thread

Danny0317

Fluorite's back, brah
1,067
Posts
10
Years
    • Age 24
    • Seen Nov 19, 2023
    Little suggestion here, even though I don't hack FR, but I think it'd be hella dank cool asf 420

    How about perhaps possibly maybe new weather effects? As in, in the OW and in battle?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Assuming you want to just use the Oak intro, but want to skip the naming of the player and the rival, which bytes would you change, and which ones would stay??

    I have no clue how Touched did any of that. You'd be best off asking him :D

    setvar 0x8002 0x1 //aka bulbasaur setvar 0x8003 0x1 // aka pound....... callasm 0xsomething...this would check the whole party for a bulbasaur with pound. -_- i am not talking about checkattack.

    You will have to use partyChecker to fetch the slot of bulbasaur. Then a modified version of party check. For the modified version, you just remove the loop and set r5 = return from the first PartyChecker. Simple stuffs :x

    Little suggestion here, even though I don't hack FR, but I think it'd be hella dank cool asf 420

    How about perhaps possibly maybe new weather effects? As in, in the OW and in battle?

    Not only would that require graphical hacking to modify the overworld weather/in battle weather. But for making it actually do anything in battle you'd need to use battle scripts. That being said, you can use battle by turn to make doing this a little easier. I'm not going to do it, but out of curiosity, what weather pattern did you have in mind?




    Some research on setting Trainer OT, Gender, Trainer ID for pokemon captured

    First of all, getting the data. If you're battling a trainer, the trainer name doesn't actually sit in RAM. So you need to derive it from the ROM. The way the game gets it (which is the way you should do it), is that it takes the current trainer flag (Trainer ID in A-trainer), and uses that to search the base trainer table for the trainer's name. I've written some code with accomplishes that. (See end of post). This trainer data structure appears to be 40 bytes long, and to reach a specific index, you do table pointer + ((ID -1) * 40).

    The second piece of data, is obviously Gender. This actually doesn't seem to be used at all? I'm not 100% sure. Anyways, the gender byte is attached to the intro music as well. The gender in the table is determined by the most highest bit in the byte and the rest seems to be just the music. So if the byte is "0x86" then the trainer is female (0x80 = 10000000 in binary) and the entry music is 6. (I've written code to retrieve this, see end of post..again :P)

    Finally Trainer ID. I have no clue how or where this is being derived in battle. I can probably find out, but that would require a little more research on what is appearing to be a dead end. I'm calling it a dead end because trainer ID seems to turn your Pokemon into a bad egg immediately if you change it. Unlike OT gender and OT name, PID and TID seem to have a close knit relationship in the checksum. Not only can you not change this in battle, but surprisingly you can't change it in overworld using the encrypter.

    So where does this put us in terms of capturing other trainer's Pokemon? Well, in short it's looking bleak. The OT name, and gender cannot be changed in capture or the Pokemon will result in a bad egg. However, you can use the encrypter function to change these later after capture (once you reach the overworld). The other small stroke of luck, is that the trainer flag isn't wiped after the battle, or after a wild battle. So as long as you don't battle another trainer you can derive the name of the last trainer you fought.

    I made a routine which retrieves the name and gender of the trainer you just faced, and assigns their name/gender as the original name/gender for a Pokemon in your party. I tried to use a modified version of this routine during the battle, but it just bad egg'd my Pokemon, which was kinda frustrating X_X

    So this is the routine I used at the Pokemon capture sequence to set the values
    Spoiler:

    That one has no use, except maybe making every trainer Pokemon you capture a bad egg :(



    Here's the same routine modified for use in the overworld:
    Spoiler:


    Compile and insert anywhere in free space. Set in variable 0x8000 the slot number of the Pokemon whose name you want to change, and set in 0x8001 which trainer ID (same as ID # from A-trainer) to derive the name and gender from. I hope this is good enough for the original requester. I believe she wanted me to make a routine to allow her to steal trainer's Pokemon outside of battle, well, you can't steal a trainer's Pokemon if you have six. So you can use this in your steeling script (obviously the slot number would be equal to party size).


    Anyways, this was rather disappointing. I hoped to have been able to get this done properly, but it didn't seem to work. A failed project. I hope just the research and trainer name\gender fetching routines alone will be helpful for some people. I don't think I'll be updating the first post with this though :x
     

    jAvAcOlA

    Banned
    152
    Posts
    15
    Years
    • Seen Feb 22, 2015
    If anyone could help me out implementing Ditto's Imposter ability into Firered, that would be outstanding.
     
    1
    Posts
    9
    Years
    • Seen Dec 16, 2014
    Do you think there would be a way to make a pokemon's offensive and defensive typing different? Like perhaps making a pidgey act like a flying type when dealing damage but act like a psychic type when taking damage. My thought would be to tie defensive typing to personality value so individual pokemon would feel "strong" and "weak" to different things.
     

    Turtl3Skulll

    Blue Turtl3
    76
    Posts
    10
    Years
  • Pokemon Storage Addon: Full Party Swap


    So last time I did just a quick swap one Pokemon at a time. Here I made some code basically "mass-swap" the storage and the current Player's party all at the same time.

    How to insert:

    Compile and insert into free space the following routine:
    Spoiler:


    Here is a compiled version:
    Code:
    3F B5 00 23 06 2B 0F D0 20 48 50 21 59 43 40 18 20 4A 64 21 59 43 89 18 50 22 08 B4 1E 4C 00 F0 34 F8 08 BC 01 33 ED E7 00 23 06 2B 18 D0 19 48 64 21 59 43 40 18 16 4A 50 21 59 43 89 18 50 22 08 B4 15 4C 00 F0 21 F8 08 BC 12 48 64 21 59 43 40 18 08 B4 11 4C 00 F0 18 F8 08 BC 01 33 E4 E7 0B 48 0A 49 F0 22 52 00 0B 4C 00 F0 0E F8 08 48 01 38 00 78 0A 49 08 70 0A 48 00 78 04 4A 01 3A 10 70 08 48 09 78 01 70 3F BD 20 47 2C 40 02 02 01 C0 03 02 84 42 02 02 09 0B 04 08 7D E4 03 08 B8 70 03 02 29 40 02 02

    Usage:
    Just callasm to the routine +1. Be careful though, always check that the storage isn't empy. You can swap out your entire party for no Pokemon and create a nice little bugged questionmark when you open the Pokemon menu (the one in my avatar :3).

    This time instead of a script I present to you a video :D

    Link in case embedded fails: https://www.youtube.com/watch?v=haPE6iohJMY

    I've read through these a couple of times, and have one question is there a way to pre-store pokemon into the PSS to transfer out??; store 2 pokemon which will be traded with current party during an event
     
    Last edited:

    BLAx501!

    Pokemon Flux
    80
    Posts
    10
    Years
  • I've came up with two new suggestions, both of them about Marts, to allow a better customization of them.

    1.- Set different prices for the items regardless the original prices you put on an Item Editor.

    2.- Make some items unavailable to purchase after having purchased one, like the TM on latest games.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • FBI agent;8510724 [h1 said:
    Party Item Checker:[/h1]

    How it works:
    So I use the variables 0x8000 and 0x8001 again.
    0x8000 Should be set to Pokemon species (2 bytes)
    0x8001 Needs to be set to Item ID (1 byte...can be changes to 2 if you inserted more than 255 items)

    case 1:
    If a Pokemon in your party has the item specified by 0x8001 and the species matches 0x8000, return that Pokemon's slot

    case 2:
    If 0x8000 is set to 0x0 (no species), the routine will search your whole party and return the slot of the Pokemon holding the item specified in 0x8001

    case 3:
    If no Pokemon in the party are holding the item, returns 0x6.

    The result will be stored in variable 0x8000. The result will, obviously, be 0x0-0x5 (slot) for item found and 0x6 for not found.


    How to insert:

    Compile and insert into free space the following routine:
    Spoiler:


    Here's a compiled version:
    Code:
    7F B5 18 4E 36 78 00 25 AE 42 22 D0 64 20 68 43 01 1C 15 48 40 18 0C 21 14 4A 00 F0 1E F8 0F 4B 1B 78 98 42 01 D0 01 35 EE E7 0D 4C 24 88 00 2C 0C D0 0E 4A 64 20 68 43 01 1C 0B 48 40 18 0B 21 00 F0 0B F8 06 4C 24 88 A0 42 EC D1 04 4A 15 70 7F BD 03 48 06 21 01 70 7F BD 10 47 BA 70 03 02 B8 70 03 02 29 40 02 02 84 42 02 02 E9 FB 03 08

    Usage:
    In a script,
    setvar 0x8000 0xspecies
    setvar 0x8001 0xItemID
    callasm 0x[Where you inserted the above routine +1]

    That's it!
    Will this works?
    ...
    callasm 0x800001
    comparevar 0x8000 0x85[eevee]
    if 0x85 goto @have
    ...
    #org @have
    callasm 0x800001
    comparevar 0x8000 0x1[master ball]
    if 0x1 goto @have2
    ...
    #org @have2
    msgbox @1 0x6
    ...

    Because, I want in my script, if I have Eevee holding Masterball then it jumps in an offset and if it has no eevee holding masterball then it jumops in other offset
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • If anyone could help me out implementing Ditto's Imposter ability into Firered, that would be outstanding.

    *FBI doesn't do battle scripts, but hopes that someone who does will pick this up for you*

    Do you think there would be a way to make a pokemon's offensive and defensive typing different? Like perhaps making a pidgey act like a flying type when dealing damage but act like a psychic type when taking damage. My thought would be to tie defensive typing to personality value so individual pokemon would feel "strong" and "weak" to different things.

    *FBI doesn't do battle scripts, but hopes that someone who does will pick this up for you*

    I've read through these a couple of times, and have one question is there a way to pre-store pokemon into the PSS to transfer out??; store 2 pokemon which will be traded with current party during an event

    Yeah, you call the same routine twice giving a different slot number each time.

    Would it be possible to make routines for the forme mons?

    Specifically Arceus, Giratina, and Shaymin.

    You already have a silent evolution routine working. This handles Deoxys already. The coding to change Rotom's attacks isn't difficult (I was able to do it on my other computer, but it was sloppy.)

    You have new hold items made, party item checker, and silent evolution routines that work. If you could mix the 3 then that would probably do the trick (taking into account changing Arceus move type for Judgement. Not difficult though). This would handle Arceus and Giratina.

    Shaymin is the most difficult imo. It requires the silent evolution with a time check. That's not too bad in a script. The problems arise when calling the script to change forme at night and in-battle change when it is frozen.

    Public routines for formes would be a massive contribution to the entire community. At least, that's how I feel.

    Hi, I agree that would be awesome. However, daniilS has already started on this and I don't want to ninja him. You can cheer him on\ask him how it's going by VMing him maybe :3

    I've came up with two new suggestions, both of them about Marts, to allow a better customization of them.

    1.- Set different prices for the items regardless the original prices you put on an Item Editor.

    2.- Make some items unavailable to purchase after having purchased one, like the TM on latest games.

    I don't understand the point in number one. Why would you make a hack with different prices when you can fix the prices in the item editor? It just doesn't make sense to me :/

    For 2, you can do this in a script I believe. Set a flag when the item is purchased and make it impossible to purchase more if that flag is set.

    Will this works?


    Because, I want in my script, if I have Eevee holding Masterball then it jumps in an offset and if it has no eevee holding masterball then it jumops in other offset

    No that won't work. In the usage section of the post you've quoted it says:
    setvar 0x8000 0xspecies
    setvar 0x8001 0xItemID
    callasm 0x[Where you inserted the above routine +1]

    So if you wanted to see if there was an Eevee with a masterball, you'd do:
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x[offset +1]
     
    199
    Posts
    12
    Years
    • Seen Jul 18, 2016
    I don't understand the point in number one. Why would you make a hack with different prices when you can fix the prices in the item editor? It just doesn't make sense to me :/

    In the games, "sales" for the big shopping stores can happen randomly. Guessing he may be trying to have some control over it.

    I don't think this needs any routines though. You could always create an NPC that sells you an item for a set price. Unless you make your own multichoicebox, it will only be able to sell one item type at a time. :s
     
    Last edited:

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • In the games, "sales" for the big shopping stores can happen randomly. Guessing he may be trying to have some control over it.

    It could also be used to sell an item to the player that the player cannot sell back. I think it would be cool\handy\awesome. So I to request this.:P
     

    Turtl3Skulll

    Blue Turtl3
    76
    Posts
    10
    Years
  • Yeah, you call the same routine twice giving a different slot number each time.

    I know that part, but I meant can pokemon be stored there which the player does not have, or has not store in them??
    Such that when the game starts you can have a whole party stored in PSS & trade it for your starter pokemon at the beginning of the game?? or does it require you to have to manually store the pokemon in the PSS as a trainer??

    I don't understand the point in number one. Why would you make a hack with different prices when you can fix the prices in the item editor? It just doesn't make sense to me :/

    That's actually a pretty cool idea, it can make it so there's an economy-like atmosphere that in certain events, it crashes & the price of all items skyrockets or black markets being implemented as well.
     

    Zehn

    [color=red][font=Foto Serif]Sacred[/font][/color][
    988
    Posts
    9
    Years
  • Ok FBI agent, I have some challenges you will enjoy

    1: the bike having 2 gears like in DPP

    2: a way to stop the player using running shoes in certain areas
     

    Smeargle

    Illusory
    160
    Posts
    11
    Years
  • I've got a suggestion.
    It would be interesting to lower the players speed in half, both while walking and running, while walking on specific tiles.
    Or better yet being able to control the speed, say speed in lowered slightly when walking in mud, puddles, or tall grass.
    Pokemon ORAS has a similar feature when you step in sand.

    This may go hand in hand with research done on the dual geared bikes if you choose to work on it.
     

    Vivacity

    still learning
    6
    Posts
    9
    Years
    • Seen Jul 15, 2017
    Oh, wow, thank you so much for taking a shot at my stupidly complicated request! I'll definitely be using the routines you posted, which should be more than good enough for what I'm wanting to do :) so thanks again!

    I think with a bit of ingenuity and resourceful use of the PSS, I can get over the final hurdle, too – which is enabling steal events even when the player has a full party of six. (I just don't want to force people to be constantly heading back to the PC to dump their new Pokémon so that they don't miss out on an event. It always annoyed me when I had to do that in the official games, haha.) So, yeah, here's my idea…

    For a Snag Ball battle, I'd use countpokemon before starting the battle. Then, if the result is <5, I can just use your lovely routine as provided. :) If it's 0x6, though, I could activate the PSS intercept system to push any snagged Pokémon into the PSS.

    That done, I could take advantage of the fact that OTs can be modified in the overworld, and do that inside the PSS. Then (hopefully) I could push the Pokémon out of the PSS and into storage.

    This would circumvent the problem I currently have, which is that Pokémon snagged by a Snag Ball go straight into the PC without the correct OT attached (if the player has a party of six). It'd also work for givepokemon events, which I'd be using as 'steals' – I'd countpokemon first, then activate the intercept and do much the same thing as for the snagged monsters.

    So I just have a couple of questions, really:

    1) Does the PSS intercept routine work on the givepokemon command as well as with captures? (Also, how safe is the nicknaming bit of the intercept routine? I saw it was commented out...)
    2) Is there a way to push Pokémon from the PSS into PC storage space?

    Oh, and I'm assuming that renaming the OT of a Pokémon in the PSS would be as simple as using your existing overworld routine, but replacing this line:
    Code:
                    ldr r0, =(0x2024284)
    with this:
    Code:
                    ldr r0, =(0x203C001)
    My ASM knowledge is pretty much based on staring at your code in wonder and bemusement and painstakingly trying to figure out how the magic happens, though, so please feel free to correct me if I'm being stupid :P
     
    416
    Posts
    11
    Years
    • Seen Feb 10, 2024
    2: a way to stop the player using running shoes in certain areas

    The map header will allow or prevent the player from being able to run (there are several threads on this topic)
    if you search the forums you should be able to do this.

    of course if you are looking for a way to do this within a map(some parts of a map you can run, others you cannot), idk.

    a script for this would be cool, so we could put green S tiles and as the player ran over them they would stop running and walk, (or visa versa)
     

    jAvAcOlA

    Banned
    152
    Posts
    15
    Years
    • Seen Feb 22, 2015
    Updated light ball to raise Pikachu's attack:

    Spoiler:

    You may want to do more testing on this. I inserted it into my game and it's crashing every time I get into a battle.
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    The map header will allow or prevent the player from being able to run (there are several threads on this topic)
    if you search the forums you should be able to do this.

    of course if you are looking for a way to do this within a map(some parts of a map you can run, others you cannot), idk.

    a script for this would be cool, so we could put green S tiles and as the player ran over them they would stop running and walk, (or visa versa)

    Can't you just remove the running shoes temporarily?
     
    252
    Posts
    11
    Years
    • Seen Jul 6, 2019
    Oh, and I'm assuming that renaming the OT of a Pokémon in the PSS would be as simple as using your existing overworld routine, but replacing this line:
    Code:
                    ldr r0, =(0x2024284)
    with this:
    Code:
                    ldr r0, =(0x203C001)

    Please don't do that. Pokemon data is stored in 100 bytes for the party, but the Pokemon stored in the PC is a different matter. It only records 80 bytes of the structure. And if my 10 second glance at FBI's PSS routine didn't deceive me, FBI stored 80 bytes for each Pokemon, which means that if you just change that line, you are going to screw yourself over.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • FBI how about
    ...
    setvar 0x8000 0x85
    setvar 0x8001 0x1
    callasm 0x800001
    compare LASTRESULT 0x1
    if = goto @1
    ...

    what I want is the NPC will check if the player has eevee holding masterball, if it has it will jump to #org @1 and if it doesnt have it will jump to #org @2.. I dont understand how the game will check if I have eevee with well in fact it just set a var but nothing to compare with, like in flag, checkflag will check if the desired flag has been set.
     

    BLAx501!

    Pokemon Flux
    80
    Posts
    10
    Years
  • I don't understand the point in number one. Why would you make a hack with different prices when you can fix the prices in the item editor? It just doesn't make sense to me :/

    For 2, you can do this in a script I believe. Set a flag when the item is purchased and make it impossible to purchase more if that flag is set.

    For number one I mean to be able to have like a discount store, where items cost half their original price.

    The second one, I think I know to solve it ;)
     
    Back
    Top