• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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
    9
    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...
     
    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.
     
    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