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

[Other] Battle_box force slide

13
Posts
3
Years
    • Seen yesterday
    Good morning everyone! I will try to explain as best as I can what I want to do. Let's get started.

    By default, in emerald, in a battle against a trainer, the opposing pokemon's battle_box slides to appear on the screen when the trainer brings out the pokemon in question. Well, there are two types of sliding that follow one another:

    - Type 1: When the rival trainer takes you out to his FIRST pokémon. The opponent's battle_box appears sliding across the screen right at the moment the pokeball animation just played.

    - Type 2: When the rival trainer takes out his SECOND pokémon (and its successors). The opponent's battle_box appears sliding across the screen just at the moment the pokemon's cry happens and the movement animation of the 2 frames of its sprite ends.

    Basically what I want to achieve is to force that when the opponent takes out his FIRST pokemon, the slide of the battle_box of the previous type 2 happens, making everything work in the same way.


    I've been messing around a lot and I think the function that controls this is in: battle_controller_opponent.c > Intro_TryShinyAnimShowHealthbox

    I have been trying several things, especially with the "ballAnimActive", "healthboxSlideInStarted" and "waitForCry" functions, although I have not been able to find the key.

    Any kind of help or indication is appreciated, especially from those people who know about decomp. Greetings!
     

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen today
    Basically what I want to achieve is to force that when the opponent takes out his FIRST pokemon, the slide of the battle_box of the previous type 2 happens, making everything work in the same way.
    All in all, it's just a simple trick of the changing in the process task, and there is no need to change the function itself. Since it is the original routine itself had been provided by the source code.
    Honestly speaking, the two types of the healthbox sliding mentioned in your thread are actually two different animation routines provided by two different functions.
    For the opponent trainers having more than one pokemon, When their first pokemon being defeated & becoming fainted, those trainers WILL NOT use that original routine of "Send-out" animation anymore, which had been used in their sending out first pokemon. Instead, they would just use the "Switch-in" alternative process, in which contains the delays needed by yourself.
    And just as the one consisting that original "Send-out" animation, the whole routine of the "Switch-in" animation itself including the part of displaying the shiny star, the pop-up of the healthbox, and more, the delay frames that you want.
    So the only thing you need to do is to open the file "battle_controller_opponent.c" again, go into the processing task named "Task_StartSendOutAnim", and then changing the line ""gBattleControllerFuncs[gActiveBattler] = = Intro_TryShinyAnimShowHealBox;" to one if & else branch provided here:
    Code:
        if (IsDoubleBattle() || gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS || gBattleTypeFlags & BATTLE_TYPE_MULTI)
            gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox;
        else   
            gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim;
    and then build your ROM. You would probably get what you want.
    And here is also one picture about that effect:
    Battle_box force slide
     
    Last edited:
    13
    Posts
    3
    Years
    • Seen yesterday
    All in all, it's just a simple trick of the changing in the process task, and there is no need to change the function itself. Since it is the original routine itself had been provided by the source code.
    Honestly speaking, the two types of the healthbox sliding mentioned in your thread are actually two different animation routines provided by two different functions.
    For the opponent trainers having more than one pokemon, When their first pokemon being defeated & becoming fainted, those trainers WILL NOT use that original routine of "Send-out" animation anymore, which had been used in their sending out first pokemon. Instead, they would just use the "Switch-in" alternative process, in which contains the delays needed by yourself.
    And just as the one consisting that original "Send-out" animation, the whole routine of the "Switch-in" animation itself including the part of displaying the shiny star, the pop-up of the healthbox, and more, the delay frames that you want.
    So the only thing you need to do is to open the file "battle_controller_opponent.c" again, go into the processing task named "Task_StartSendOutAnim", and then changing the line ""gBattleControllerFuncs[gActiveBattler] = = Intro_TryShinyAnimShowHealBox;" to one if & else branch provided here:
    Code:
        if (!IsDoubleBattle() || (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS))
            gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim;
        else   
            gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox;
    and then build your ROM. You would probably get what you want.
    And here is also one picture about that effect:
    Battle_box force slide

    Wow! The truth is that this was a very simple edition but at the same time quite effective. I do it and ran various in-game checks to see if I found any issues, and unfortunately I found one. It works well for:

    - Individual battles against 1 trainer.
    - Double battles against 2 trainers.

    A small problem arises with the battle_box of the second pokemon for:

    - DOUBLE BATTLES AGAINST 1 TRAINER. For some reason, the opponent's second pokemon has a bug where the battle_box doesn't start up. Attached image in the post. Then when the pokemon in question is attacked, its battle_box reappears.

    Still, the truth is that this was basically what I was looking for. Even with some glitches, this is actually a very significant advance and I really appreciate your help. In addition to the fact that you took the trouble to explain things, upload the .gif and so on. Thank you!

    When I have a little more time I would like to try things to see if I can solve that part. If you realize that it could be causing something like this, help will be welcome :)
     

    Attachments

    • Battle_box force slide
      bug battle_box.png
      35 KB · Views: 4

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen today
    A small problem arises with the battle_box of the second pokemon for:

    - DOUBLE BATTLES AGAINST 1 TRAINER. For some reason, the opponent's second pokemon has a bug where the battle_box doesn't start up. Attached image in the post. Then when the pokemon in question is attacked, its battle_box reappears.
    Sorry my ignorance for the previous error.
    The reason why this error occurred is that I had not taken the double battle in account. And thanks to your pointing out, I also noticed that there's also an error for the condiction in my previous code.
    I had updated the code in my previous respond, and fixed the error in the contain specifically for the double battle. What's more, I had tested the codes for myself in several conditions for double battle. Luckily there isn't any bug having appeared yet.
    If you still have time for this, you can simply delete the previous code strings from your files and then copy these new lines to it. Although I'm not sure whether there is any other bug existing or not, one thing is clear that the previous issue of double battle had been solved.

    Edit: I noticed there isn't any reply in time later, afraid that maybe my expression in English is not clear leading to some misunderstanding? Therefore, I decided to repost all the modified codes here again for your convenience, Although it had been modified in my previous respond yesterday. You could either copy it from here or from the previous respond.
    Code:
       if (IsDoubleBattle() || gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS || gBattleTypeFlags & BATTLE_TYPE_MULTI)
            gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox;
        else   
            gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim;
    Moreover, also with several screenshots & images that was recorded during my test of these new codes.

    For Single Battle:
    Battle_box force slide

    For Double Battle:
    Battle_box force slide

    For Two Opponents:
    Battle_box force slide
     
    Last edited:
    13
    Posts
    3
    Years
    • Seen yesterday
    Hi there! Yes, I had reviewed your answer on mobile, but I hadn't had a chance to be home to test the new code addition, as well as in-game tests and stuff. In any case, what I see (and have tested) with your last answer is that the behavior for double battles (both 1 trainer and 2 trainers) becomes exactly the same as it would be in the "vanilla" game. That is, they do not suffer the behavior we were looking for. In individual battles, on the other hand, both the "cry" of the pokemon and the animation of 2 frames are finished so that the battle_box begins to slide. All this is also seen in the 3 gifs that you have uploaded (thanks again).

    With only the change of "gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox" for "gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim", even if the bug happened with double battles (1 trainer), they continued to work with the behavior that we were looking for in both individual battles like double battles (2 trainers).
     
    Last edited:

    セケツ

    ポケハック初心者
    61
    Posts
    7
    Years
    • Seen today
    Hi there! In any case, what I see (and have tested) with your last answer is that the behavior for double battles (both 1 trainer and 2 trainers) becomes exactly the same as it would be in the "vanilla" game. That is, they do not suffer the behavior we were looking for. In individual battles, on the other hand, both the "cry" of the pokemon and the animation of 2 frames are finished so that the battle_box begins to slide. All this is also seen in the 3 gifs that you have uploaded.
    With only the change of "gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox" for "gBattlerControllerFuncs[gActiveBattler] = SwitchIn_TryShinyAnim", even if the bug happened with double battles (1 trainer), they continued to work with the behavior that we were looking for in both individual battles like double battles (2 trainers).
    Sorry for my late reply.
    I have noticed all the problems you newly asked, and spent little time in comparing the differences between those two functions I mentioned above, and finally succeeded in making some easy & simple modifications of the original "Intro_TryShinyAnimShowHealthbox" function.
    I am afraid it still not the thing that you need indeed. Therefore, here are some test images at first, you could take a quick look of it before you finally decided whether implement my codes or not.
    Spoiler:

    Also, there is no need for any previous "if & else" modification provided above, just delete & remove all of it from the source codes, and then change the function named "Intro_TryShinyAnimShowHealthbox" to all the codes that I provided below.
    Codes:
    Spoiler:
    I wish it would be the thing that you really want. And if it still isn't unluckily, I hope all of above I provided would at least be helpful for you.
    Sorry for my frequent & disturbing respond again.
     
    Last edited:
    13
    Posts
    3
    Years
    • Seen yesterday
    Sorry for my late reply.
    I have noticed all the problems you newly asked, and spent little time in comparing the differences between those two functions I mentioned above, and finally succeeded in making some easy & simple modifications of the original "Intro_TryShinyAnimShowHealthbox" function.
    I am afraid it still not the thing that you need indeed. Therefore, here are some test images at first, you could take a quick look of it before you finally decided whether implement my codes or not.
    Spoiler:

    Also, there is no need for any previous "if & else" modification provided above, just delete & remove all of it from the source codes, and then change the function named "Intro_TryShinyAnimShowHealthbox" to all the codes that I provided below.
    Codes:
    Spoiler:
    I wish it would be the thing that you really want. And if it still isn't unluckily, I hope all of above I provided would at least be helpful for you.
    Sorry for my frequent & disturbing respond again.

    Hello again!

    This is exactly what I was looking for! With this now the battles have the behavior that I wanted at the beginning of the battle. Thank you very much really!

    As a note to say that I had to change a small part in the code that you modified. I put back "0xFFFF" instead of "TRACKS_ALL", because otherwise it gave me an error when compiling. This doesn't seem to have changed anything in-game actions.

    And by God, you don't have to apologize for thinking that you have been late in responding, since apart from bothering to review and modify the code several times, the responses have been early. I really appreciate the effort you've put into finding this solution, for which I only have words of thanks. You help me very much. Thank you very much!
     
    Back
    Top