• 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

5,256
Posts
16
Years
  • I don't know where it is either. Perhaps you can ask daniilS via VM or something.




    1) For forced evolution, I don't know what you're really talking about. You mean just make a Pokemon evolve without giving the player time to hit the "b" button? I'll look into Pokemon evolution sure.

    2) I haven't seen it so VMing me it would be nice. Anyways this is rather easy, I've done it before. I'll post the results at the bottom of this post.

    3) Skipping the introduction was already done by Knizz. There's a post in the research and development section's quick research thread.


    Preventing TMs from being consumed on use


    Quick research:
    TMs are deleted in two places. The first place is in their own function. When called from the bag, after use the TM has it's own deletion mechanism. The second way is from the bag, after you use a TM the bag attempts to delete it as well. Well, the solution is quite simple. There's two ways to do this, either go to 0809A1D8 call your own function there which checks if the item is a TM, and if it is, just jump to the end. Or much more simply you just remove the parts from the bag and tm function that deletes the TM (Which is what I did). The former way is a way you can make another item you have unconsumable.

    To insert:
    Do the byte changes below
    0x124F78: 00 00 00 00
    0x125C80: 00 00 00 00

    Make it Ungivable:
    insert that at 0x1326B8: 00 00 17 E0

    Make it consumable after animation:
    Insert: 00 00 00 00 at 0x124F78

    To remove the quantities showing up in the bag:

    Compile and insert into free space:
    Spoiler:


    Here's a compiled version:
    Code:
    00 2D 01 D1 05 4B 18 47 38 1C 08 21 22 1C 04 4E 00 F0 02 F8 01 4B 18 47 30 47 C0 46 FF 1E 13 08 B1 35 13 08

    Now navigate to 0x131EF4 and insert:
    Code:
    00 48 00 47 XX XX XX 08
    Where XX XX XX is the pointer to where you assembled the routine +1

    Now navigate to 0x131EA5 and change the byte to E0

    Unsellable:
    Basically for the TMs, you can still sell them to vendors. To change this, you need to modify each TM individually. It's unfortunate, but the game checks if an item can be sold my comparing it's market price to zero. If it's strictly greater than zero, then you can sell it to a vendor, seems to be the rule. So to make TMs unsellable you need to set their market prices individually to zero.
    I can't use my own checks to disguise the TMs as unique because the sell routine in shops are used for ALL items including potions, berries, TMs, and other items like nuggets.


    Present :3
    3nina1p.png

    To make TMs ungivable when chosen through the Pokémon -> Give menu, navigate to 0x13288D and change the byte to E0.
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • I think that's very simple. You can see a palette pointer table at 0x5C8FDC and that's the palettes for elites and champion (first 5 entries). You can modify them by using APE (all not LZ77 compressed).
    There will be boy player & girl player palette after that, but please ignore them as they're not used at all.


    /*=============================================================================================================================*/


    Things in the spoiler below are something need help and it may be better in the ASM help thread.
    Spoiler:

    I dunno why it happens, how will I show the other choices?


    this is the script that I made
    Spoiler:
     
    Last edited by a moderator:

    Trainer 781

    Guest
    0
    Posts
    Battle End Move Target Held Items (FR):-

    Loader Routine:
    Spoiler:


    Rocky Helmet:-
    Spoiler:


    Weakness Policy:-
    Spoiler:


    Knock Off Ban-list Hook:-
    Spoiler:
     
    Last edited:

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen today
    I dunno why it happens, how will I show the other choices?
    this is the script that I made
    Spoiler:
    I've seen your post, but I'm not sure about what occurred. Currently I'm very busy so I can't test it, but when I have time, I will try to redo the function. I can only suggest you to reduce the value of var_8000 to some value like 7 or 4 now, as the original game uses them.
     
    Last edited:
    5,025
    Posts
    8
    Years
  • Hey everybody , I just want to ask is there any way to restrict main player from adding a certain pokemon in PC storage system ( ROM base : Pokemon Emerald)
     
    42
    Posts
    8
    Years
    • Seen May 2, 2024
    Hi,

    I have some requests for Fire Red 1.0 (if they're possible using ASM)

    - increasing the EV limit for vitamins from 100 to 252 (since 255 is redundant)
    - changing the number of Pokémon affected by Soul Dew (in this case, to four Pokémon (the two extra Pokémon have indexes 0x20b and 0x20c))
    - changing Exp Share to give 50% Exp to the holding Pokémon regardless of how much Pokémon are holding it (I'm not sure if this has already been done or not)
     

    Lance32497

    LanceKoijer of Pokemon_Addicts
    792
    Posts
    9
    Years
  • I don't think you can do it with a script :/
    Maybe you can share how?

    there's a code in Eme that can checkthe index number of a Pokémon right, by just editng the PC script before the player presses deposit, then it will do the trick, butvif he wants a set-up where the player enters to deposit Pokemon PC and then when he puts his pokemon on a certain box, a script will pop-up saying "it cannot be placed here" or something, then it really needs an asm routine XD
     
    5,025
    Posts
    8
    Years
  • there's a code in Eme that can checkthe index number of a Pokémon right, by just editng the PC script before the player presses deposit, then it will do the trick, butvif he wants a set-up where the player enters to deposit Pokemon PC and then when he puts his pokemon on a certain box, a script will pop-up saying "it cannot be placed here" or something, then it really needs an asm routine XD

    No I don't want " it cannot be placed here" like something I just want to restrict him from adding a pokemon like first u say with a certain code, can you elaborate it to me how to do . I just started hacking emerald recently .

    (P.S: plz sorry for my late reply and thanks for helping me out)
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Battle End Move Target Held Items (FR):-

    Loader Routine:
    Spoiler:


    Rocky Helmet:-
    Spoiler:


    Weakness Policy:-
    Spoiler:


    Knock Off Ban-list Hook:-
    Spoiler:

    Awesome !

    I have a question though, are you sure that hook would be enough for Arceus plates and the mega stones ? Because I saw three more check for sticky hold for the moves like thief, trick and I don't remember the last.
     

    Trainer 781

    Guest
    0
    Posts
    Awesome !

    I have a question though, are you sure that hook would be enough for Arceus plates and the mega stones ? Because I saw three more check for sticky hold for the moves like thief, trick and I don't remember the last.

    Yes, this will be not sufficient. There are total of 3 checks IIRC: knock off, thief and trick.
    A good trick would be to create a custom bl to determine removability of an item then refer
    the bl from these three locations + knock off multiplier in the damagecalc function.
     
    417
    Posts
    9
    Years
    • Seen Nov 20, 2016
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    
    
    main:
        push {r0-r4, lr}
        ldr r1, =(0x20370C0) @var 0x8004
        ldrb r1, [r1]
        mov r2, #0x64
        mul r1, r1, r2
        ldr r0, =(0x2024284)
        add r0, r0, r1 @slot
        mov r4, r0 @save slot
        mov r1, #0x2E
        ldr r3, =(0x803FBE8 +1)
        bl linker
        cmp r0, #0x1
        beq setZero
        mov r0, #0x1
        b setNew
    
    setZero:
        mov r0, #0x0
        
    setNew:
        lsl r0, r0, #0x18
        lsr r0, r0, #0x18
        ldr r2, =(0x20370D0) @set inverse
        strb r0, [r2]
        mov r0, r4
        mov r1, #0x2E
        ldr r3, =(0x804037C +1)
        bl linker
        pop {r0-r4, pc}
    
    linker:
        bx r3
    
    .align 2
    This should prevent the ability be changed, if the Pokémon doesnt have a secound one, but sadly it gets swapped too ("--------- Pokémon has no ability.")
    Anyone have a idea how to fix this?
    After the conditional branch to set the ability bit to zero, instead of automatically setting to one, use getattr again to check for species with r1 set to 0xB. Then check to make sure a (non-zero) ability exists in the second slot of the species. Alternatively, you could literally change the second ability of every mon with only one ability to match the first slot. But that won't directly produce an "error" return which would probably be useful for an ability capsule or something similar.
     

    Trainer 781

    Guest
    0
    Posts
    First Side Routine Rewrite
    A rewrite of the pokemon turn order comparison routine during battles. It does not add any new features but decomposes the routine into a routine with 3 sub-modules which makes it easier to add new speed altering abilities and items (hooking in the original one required to make dual checks).

    The rewrite also avoids redundant calculations. For example, if move priorities do not match then no need to calculate and compare effective speeds of the banked mons.
    One of the sub-module returns the effective speed of the banked mon so it can readily used for accurate base power calculation of Gyro Ball and Electro Ball.


    Spoiler:
     
    Last edited:

    MrDollSteak

    Formerly known as 11bayerf1
    858
    Posts
    15
    Years
  • First Side Routine Rewrite
    A rewrite of the pokemon turn order comparison routine during battles. It does not add any new features but decomposes the routine into a routine with 3 sub-modules which makes it easier to add new speed altering abilities and items (hooking in the original one required to make dual checks).

    The rewrite also avoids redundant calculations. For example, if move priorities do not match then no need to calculate and compare effective speeds of the banked mons.
    One of the sub-module returns the effective speed of the banked mon so it can readily used for accurate base power calculation of Gyro Ball and Electro Ball.

    That's really awesome KDS! I had done something similar, but had already added all the new abilities and moves that may come into play. I like how you kept this as an option for Vanilla! Plus yours is far more well explained.
     
    Last edited:
    457
    Posts
    10
    Years
    • Seen Apr 9, 2024
    Callasm and Setword Commands, and Battle String Loader Hack for Emerald

    First, you need to expand the Battle Script Commands table that is found on 0x0831BD10. There are 0xF8 (248) commands used and the table is 0x3E4 bytes long. However, every command is only one byte, so there can only be maximum of 256 commands and there will be available of 7 more commands (8 for FireRed because the addition of 0xF8 command in Emerald is used). Here's how you should expand the table:

    Spoiler:

    In case you care about existing custom commands in the forums, here is the list (I will dig some other custom commands from Resources Threads):


    Callasm:
    Spoiler:


    Setword:
    Spoiler:
     
    Last edited:
    7
    Posts
    10
    Years
  • Hi guys, first of all, sorry for my bad English, I don't speak that language. After that...

    I come to ask for help with a ASM Routine.

    I need load a image in-game, of 16 colors or 256, I don't care. I need load an imagen in a script. Can anybody help me?
     
    218
    Posts
    10
    Years
    • Seen Nov 12, 2021
    Yes, this will be not sufficient. There are total of 3 checks IIRC: knock off, thief and trick.
    A good trick would be to create a custom bl to determine removability of an item then refer
    the bl from these three locations + knock off multiplier in the damagecalc function.

    Knock off multiplier should definetly be handled by ASM rather than BS yeah

    For the bl, I updated my multitype routines, though it's for emerald. I didn't tested it but it should be ok
     

    pokefreak890

    The One that will make everything great
    853
    Posts
    9
    Years
    • Seen May 18, 2023
    How exactly do u expand the battle script command table? It doesn't exactly say so I was wondering
     
    Back
    Top