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

Help with adding TMs 50-100 to Item Expansion

paccy

Pokeholic
42
Posts
14
Years
  • The problem is probably the tmhm_learnsets.h file as without modification it can't handle any TM/HM thats higher than TM63 I think it was.

    I have managed to get 100TMs implemented, it is far from a nice looking solution, but I can go through it if you want. :)
     
    21
    Posts
    6
    Years
    • Seen Nov 3, 2021
    I'd be glad if I could get this working yeah ^^'

    I don't know...since I added the Item Expansion I get errors when I do stuff like adding maps too... (and I do it the same way I used to)
    I think I'll roll back to a version without it for now.
     
    Last edited:

    paccy

    Pokeholic
    42
    Posts
    14
    Years
  • Hmm, not sure what could be going on with the maps without seeing the error. But anyways here's how I got the learnsets for 100 TMs working.

    Here is my tmhm_learnset file if you want to have a look.
    The main change that has to be made is gTMHMLearnsets[][2] to gTMHMLearnsets[][4] so that there is enough room for the extra TMs.
    This will cause problems with the defines at the top as integers greater than 64 bits will be created so I created an awful workaround. I created a script that converts the learnsets to integers in the correct array position.
    As you can see it makes learnsets completely unreadable so I don't actually recommend this at all, it's just how I managed to get it working...

    A better way would be to do do something like an extra define at the top
    Code:
     #define TMHM2(tmhm) ((u64)1 << (ITEM_##tmhm - ITEM_64))
    and then creating learnsets like this
    Spoiler:
    Where TMs 64 and above would need to be in the second TMHM_LEARNSET and use TMHM2.
    Though I haven't actually tried doing it this so as it is it probably won't work haha.

    Either way you'll need to change how the game checks if a TM is teachable in src/pokemon.c
    Spoiler:
    And as simple(?) as that you have 100 working TMs.
     
    21
    Posts
    6
    Years
    • Seen Nov 3, 2021
    Thx so much for sharing!
    I don't know if I'm gonna get to trying this out soon, for now I'm working on other stuff than TMs (and left the Item-Expansion out). I gotta admit I was getting a bit frustrated...

    But...after all I'd still love to add this in my rom so...I'll post my progress when I get around to it again!
    It's so nice to see that it's actually possible x)
     
    8
    Posts
    3
    Years
    • Seen May 12, 2024
    Thanks for this, I got my 100TMs working with this. This also works if you want to expand Move Tutors as well.
     
    56
    Posts
    8
    Years
  • Thanks to your previous posts I've managed to get it working without having to convert the learnsets into integers, which was a bit chaotic to be honest xD.What I've done is the following:

    1. Changes in src\data\pokemon\tmhm_learnsets.h
    Spoiler:


    2. Changes in src\pokemon.c
    Spoiler:

    And that would be. I've tested all TM's and HM's on a few pokemon ingame and the learnsets are working as intended. The only thing i'm missing is expanding the TM's and HM's pocket, because that way only 64 tm's are able to fit on that pocket and if you put more items it obviously crashes. That's another topic though and has nothing to do with this problem.
     

    Jessler

    PidgeyFox
    33
    Posts
    6
    Years
  • Hey, I tried doing things this way and it didn't work. All I got was a gigantic repeating error. I'm still fairly new to this stuff, so this doesn't really mean much to me. Any ideas?
     

    Attachments

    • output.txt
      730.3 KB · Views: 12
    56
    Posts
    8
    Years
  • Hey, I tried doing things this way and it didn't work. All I got was a gigantic repeating error. I'm still fairly new to this stuff, so this doesn't really mean much to me. Any ideas?

    What do you have in line 21676? I see the previous lines didn't have an error, so maybe you can search for some differences there. Maybe you've got a TM that doesn't belong to the correct group or something. You can also check my repository, you can see in this commit all the changes I made, and it works great for me. Note that the tmhm_learnsets file is too big so you'll have to check the raw version

    https://github.com/kevinmc37/pokemon-slumber/commit/0ef243b4ff7c1d0103a5e4b26bfa227020032251
     

    Jessler

    PidgeyFox
    33
    Posts
    6
    Years
  • I hate myself sometimes, haha! The Pokemon on that line still had TMHM(HM01_CUT). Thanks for pointing that out!
     
    180
    Posts
    6
    Years
    • Seen Apr 15, 2024
    Thanks to your previous posts I've managed to get it working without having to convert the learnsets into integers, which was a bit chaotic to be honest xD.What I've done is the following:

    hi i've tried using this but it keeps telling me that the left shift count is negative, and idk what im doing wrong, do you have any idea of what i could do?

    i understand this post is really old but there doesn't seem to be any important changes in the tmhm learnsets in the last versions of item_expansion
    EDIT: NEVERMIND i also forgot to delete a TMHM(HM01_CUT) it works now
     
    Last edited:
    Back
    Top