• 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: [EM] Items, TMs, Tutor Moves Expansion

51
Posts
9
Years
    • Seen Dec 20, 2022
    This script expands items by creating new slots and adding them at the end of the table. It means that the items themselves have to be added by the user in an item editor. TMs are different, because they require changes to the game code, particularly bag.
    I'm also not sure what you mean by 'expanding all the other item types'. Things like Berries or new poke balls would take some work, because they're not ordinary items. But all other items is just a matter of putting values in an item editor.
     
    Last edited:
    21
    Posts
    7
    Years
    • Seen Mar 19, 2024
    Hi DizzyEgg, some time ago I inserted the Battle engine+Pokemon exp.+Item exp. correctly. Now I'm trying to perform the process again, increasing the number of pokemon this time. The pokemon expansion works fine but the item expansion is giving me problems. I think it's because I don't remember how to calculate the EXPANDED_BAG_OFFSET. If my pokedex has 992 entries, I do the following:

    address pokemon exp + X, where X is the:
    (DexPokes / 8)(rounded up) + (DexPokes / 8)(rounded up)
    (992 / 8)(rounded up) + (992 / 8)(rounded up) -> (992 / 8)+(992 / 8) = 124 + 124 = 248 [F8 in hex]
    EXPANDED_BAG_OFFSET = 0203CF64 + F8 = 0x0203D05C

    Is this correct?
     
    794
    Posts
    10
    Years
  • Hi DizzyEgg, some time ago I inserted the Battle engine+Pokemon exp.+Item exp. correctly. Now I'm trying to perform the process again, increasing the number of pokemon this time. The pokemon expansion works fine but the item expansion is giving me problems. I think it's because I don't remember how to calculate the EXPANDED_BAG_OFFSET. If my pokedex has 992 entries, I do the following:

    address pokemon exp + X, where X is the:
    (DexPokes / 8)(rounded up) + (DexPokes / 8)(rounded up)
    (992 / 8)(rounded up) + (992 / 8)(rounded up) -> (992 / 8)+(992 / 8) = 124 + 124 = 248 [F8 in hex]
    EXPANDED_BAG_OFFSET = 0203CF64 + F8 = 0x0203D05C

    Is this correct?

    Yeah, it is correct.
     

    Skystrike

    [i]As old as time itself.[/i]
    1,641
    Posts
    15
    Years
  • With 100 TMs and 8 HMs (for a total of 108 TMs + HMs), what should I change the line in PGE's ini
    Code:
    TMHMLenPerPoke=8
    to?

    It seems like changing it to 16 works, but...
     
    21
    Posts
    7
    Years
    • Seen Mar 19, 2024
    I have a little problem with the item expansion. I installed it with battle engine and pokemon expansion. In the game all works fine, as far I test it. But in PGE TM compatibility and MoveTutor compatibility don't show correctly. For example Torchic, I test it in game and he doesn't learn the moves that show in this image:

    imagedata.php

    imagedata.php


    Torchic learns his natural TM moves like sunny day, flamethrower... In PGE Torchic doesn't "learn" these moves.

    I think that TM_compatibility_table and MoveTutor_compatibility_table offsets are wrong. But I put in the PGE the offsets that show in item expansion:

    thump_968399902.png


    Any idea how can I localizate the offsets?
     
    Last edited:
    794
    Posts
    10
    Years
  • I have a little problem with the item expansion. I installed it with battle engine and pokemon expansion. In the game all works fine, as far I test it. But in PGE TM compatibility and MoveTutor compatibility don't show correctly. For example Torchic, I test it in game and he doesn't learn the moves that show in this image:

    Torchic learn his natural TM moves line sunny day, flamethrower... In PGE Torchic doesn't "learn" these moves.

    I think that TM_compatibility_table and MoveTutor_compatibility_table offsets are wrong. But I put in the PGE the offsets that show in item expansion:


    Any idea how can I localizate the offsets?

    If Torchic can learn the TMs it previously could in the game, but PGE doesn't show that, it's PGE's fault. And I think that's the issue there. Could you show me your PGE's ini?
     
    21
    Posts
    7
    Years
    • Seen Mar 19, 2024
    If Torchic can learn the TMs it previously could in the game, but PGE doesn't show that, it's PGE's fault. And I think that's the issue there. Could you show me your PGE's ini?

    Sure, this is the ini that I'm using:

    Spoiler:
     

    Gamer2020

    Accept no Imitations!
    1,062
    Posts
    15
    Years
  • Sure, this is the ini that I'm using:

    Spoiler:
    Put the ini and the PGEinicreator.exe in the folder and run PGEiniCreator after you apply the expansion.

    https://github.com/Gamer2020/PGEiniCreator/tree/master/PGEiniCreator/bin/Debug
     
    21
    Posts
    7
    Years
    • Seen Mar 19, 2024
    If Torchic can learn the TMs it previously could in the game, but PGE doesn't show that, it's PGE's fault. And I think that's the issue there. Could you show me your PGE's ini?

    Yes, after I try the Gamer2020 solution, I think you are right, the problem is the ini or PGE. Thank you.

    Put the ini and the PGEinicreator.exe in the folder and run PGEiniCreator after you apply the expansion.

    https://github.com/Gamer2020/PGEiniCreator/tree/master/PGEiniCreator/bin/Debug

    Thank you, I tried it and the TMHMCompatibility and MoveTutorCompatibility offsets are correct, the problem was TMHMLenPerPoke, in the ini I put 8 instead of 16. Now the TMs compatibility shows correctly in the PGE, however the move tutor compatibility still shows wrong:

    imagedata.php


    I think ini is correct, any way to fix the problem?
     

    Gamer2020

    Accept no Imitations!
    1,062
    Posts
    15
    Years
  • Yes, after I try the Gamer2020 solution, I think you are right, the problem is the ini or PGE. Thank you.



    Thank you, I tried it and the TMHMCompatibility and MoveTutorCompatibility offsets are correct, the problem was TMHMLenPerPoke, in the ini I put 8 instead of 16. Now the TMs compatibility shows correctly in the PGE, however the move tutor compatibility still shows wrong:

    imagedata.php


    I think ini is correct, any way to fix the problem?
    It should be the NumberOfMoveTutorAttacks but I will have to look at it. Since the issue is with PGE please post on the Github. I will be more than happy to assist you from there. I do not wish to clutter this thread and I do not check this site often.
     

    LCCoolJ95

    Limited Capacity
    638
    Posts
    14
    Years
  • Hey, I'm not trying to get in trouble, but this is a legitimate question. I love this hack, it makes item expansion easier. But what about item pocket expansion. Not just for TMs or the Main Item Pocket, but Poké Balls and Berries. I'm looking at this part of the items.py file:
    Spoiler:

    What if I changed it to this:
    Spoiler:


    Would it be OK to do this?
     
    794
    Posts
    10
    Years
  • Hey, I'm not trying to get in trouble, but this is a legitimate question. I love this hack, it makes item expansion easier. But what about item pocket expansion. Not just for TMs or the Main Item Pocket, but Poké Balls and Berries. I'm looking at this part of the items.py file:
    Spoiler:

    What if I changed it to this:
    Spoiler:


    Would it be OK to do this?

    I mean, why do you think I added those lines, to confuse people or to decorate my script? XD Obviously you can change it, that's what those lines are for.
     

    LCCoolJ95

    Limited Capacity
    638
    Posts
    14
    Years
  • I mean, why do you think I added those lines, to confuse people or to decorate my script? XD Obviously you can change it, that's what those lines are for.
    Okay, that's really cool to know, what with more berries and more Poké Balls (I think, right? ;) ). But there is a limit correct, of, I think, 255?
     
    794
    Posts
    10
    Years
  • Okay, that's really cool to know, what with more berries and more Poké Balls (I think, right? ;) ). But there is a limit correct, of, I think, 255?

    The limit is your saveblock space. You can check it for yourself by having say 800 items in your pockets, saving the game, restarting and continuing the game. Some of them should disappear. Also the malloc function may not return available space for strings for some large numbers.
    But no, it's not 255, the number of items per pocket is stored as a halfword, so the 'technical' limit is 65535.
     

    LCCoolJ95

    Limited Capacity
    638
    Posts
    14
    Years
  • The limit is your saveblock space. You can check it for yourself by having say 800 items in your pockets, saving the game, restarting and continuing the game. Some of them should disappear. Also the malloc function may not return available space for strings for some large numbers.
    But no, it's not 255, the number of items per pocket is stored as a halfword, so the 'technical' limit is 65535.
    Really? I didn't know that! When I was first working on it, I thought it was 255 because it was a limit of 0-FF. But screw it, that's pretty boss lol!
     
    132
    Posts
    9
    Years
    • Age 23
    • Seen Apr 21, 2024
    quick issue to report- when expanding the TM slots, the TMs are moved to new bag slots. however, this causes any items that are placed into the old TM slots to have a "--" after their pickup message ("player found one [item]--!"). likewise, although i have yet to test this, i assume this means that TMs found in the overworld would not provide the message of what move they contain.
     
    794
    Posts
    10
    Years
  • quick issue to report- when expanding the TM slots, the TMs are moved to new bag slots. however, this causes any items that are placed into the old TM slots to have a "--" after their pickup message ("player found one [item]--!"). likewise, although i have yet to test this, i assume this means that TMs found in the overworld would not provide the message of what move they contain.

    TMs found in the overworld should display the message fine. As for the pickup, you're right, the items aren't changed, similarly as all the previous instances of old TMs' indexes. :P
     
    132
    Posts
    9
    Years
    • Age 23
    • Seen Apr 21, 2024
    fair enough. is there a way to fix the issue so that that message doesn't appear/point the message away from the items in the TM's old slots?

    also, is there a way to stop TMs from being able to be held as items? this would likely be tied into the infinite-reuse TM routine, as in every generation where TMs are reusable they also cannot be held. this is fairly important because it can cause players to lose TMs forever (by giving it to a pokemon to hold and then releasing that pokemon, for example).
     

    Wesley FG

    Pokémon Kalos Advance !! Gba Hack
    338
    Posts
    15
    Years
  • How many bytes in RAM new TMs and new item size in pocket take ?

    for i calcule new safe ram for use in other routines
     
    Back
    Top