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

Hopefully a very very simple task someone could help me with

  • 19
    Posts
    3
    Years
    • Seen Sep 6, 2023
    I'm using decomp to add a very small addition into pokemon firered, just for fun.
    Line 2424 in pokemon.c starts a function block with a bunch of checks for giving stat bonuses in battle (if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND) attack = (150 * attack) / 100;, etc). I've written my own little check to add in there, but I was wondering how possible it would be to add some notification alongside the stat boost? It could be battle text that shows up (I don't even mind having to replace some other text like focus energy!) or a sound that plays or a small stat boosting animation. Really, any sort of notifier would be good. I don't the know the code structures for buffering text and making it appear in battle, so I'd like if someone could give me a run down on the functions to use :)
     
    I just suggest you to look over how it actually works, it will be the best practice you can follow to don't destroy the game
     
    I just suggest you to look over how it actually works, it will be the best practice you can follow to don't destroy the game

    Yeah I would love to, but where? I see a lot of step-by-step tutorials to do stuff by just copying code, but where's the actual decomp documentation? I want to learn how different functions work; there must be a better way than just looking at the source code. If you could point me to that, I could handle the rest on my own :)
     
    Yeah I would love to, but where? I see a lot of step-by-step tutorials to do stuff by just copying code, but where's the actual decomp documentation? I want to learn how different functions work; there must be a better way than just looking at the source code. If you could point me to that, I could handle the rest on my own :)

    Well, I learned reading the code changing little things, and trying to understand what does each piece of code from what I was interested on. Generally, the functions names are descriptive enough for understanding it. Anyway, you will find a lot of things which if you're not related with the GBA hardware, you won't be able to understand. For that cases I suggest you to read GBATEK, which is kind of a technic hardware doc. Here it is: https://problemkaputt.de/gbatek.htm
     
    I'm using decomp to add a very small addition into pokemon firered, just for fun.
    Line 2424 in pokemon.c starts a function block with a bunch of checks for giving stat bonuses in battle (if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND) attack = (150 * attack) / 100;, etc). I've written my own little check to add in there, but I was wondering how possible it would be to add some notification alongside the stat boost? It could be battle text that shows up (I don't even mind having to replace some other text like focus energy!) or a sound that plays or a small stat boosting animation. Really, any sort of notifier would be good. I don't the know the code structures for buffering text and making it appear in battle, so I'd like if someone could give me a run down on the functions to use :)

    would require custom battle script combined with some if statements.

    Look in the file for how it calls battle script

    usually push cursor with the battlescript name in parenthesis.



    Make a new battlescript in battle_script_1.s make a new string id, in the string_ids file, then write the message you want in the battle_messages.c don't forget to include it in the corresponding .h file.

    make an if statement in that function that will call the new battlescript.
     
    Yeah I would love to, but where? I see a lot of step-by-step tutorials to do stuff by just copying code, but where's the actual decomp documentation? I want to learn how different functions work; there must be a better way than just looking at the source code. If you could point me to that, I could handle the rest on my own :)

    also for this you can find your way around better with a program meant for working on code projects.

    for example visual studio 2019 (use community version that's the free one)
    it has a nice feature that let's you "peak" at definitions and declarations so if you see a term/field that interests you, or you don't understand, check the definition or search it, and you can find other places its used, or the function that explains its use/meaning.
     
    Back
    Top