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

[Script] [EM] Adding a msg to a battle script

20
Posts
8
Years
    • Seen Nov 9, 2022
    Hello All!

    I am trying my hand at scripting using pokeemerald. I have a small base of knowledge regarding c++, but this is a totally different beast. I am having a hard time understanding how the battle_message(.c)s are actually sent to a msgbox. I have tried to trace the text from src\battle_message.c but I cannot find how it is added to a msgbox, then triggered. There was a comment in the exp gained function of battle_scripts_commands.c, but if didn't make any sense

    Is anyone able to explain it to me or point me in the right direction?

    I found Avara's tutorial , but I didn't know how to make it dynamic or even add it into the battlescript...
     
    451
    Posts
    6
    Years
    • Seen today
    Avara's tutorial is for event scripting, which is completely different from battle scripting.
    Battle scripts are written with the commands in battle_scripts_commands.c, while event scripts use the commands in scrcmd.c.

    I don't really know anything about battle scripts, but it looks like the function BufferStringBattle is used to load most of the messages in battle_message.c.
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • I will look into that
    For whatever it's worth, I have a working example of printing text strings in battle script functions via PrepareStringBattle, in case you want to take a look at it.
    https://github.com/LOuroboros/pokee...c153dcde88ca149916d70f4e67aa92ea37ceb320bc459

    The only problem or inconvenience is that I don't know how to set up a delay after it is printed.
    EDIT: While I still haven't found a way to add a delay after the text string is printed, there's an alternative, which is to end the text string with \p.
    By doing so, the Player is forced to press either the A or the B button in order to jump to the next dialogue which is better than nothing.
     
    Last edited:
    Back
    Top