• 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] Changing Rival's Name In-Game

247
Posts
6
Years
    • Seen May 2, 2024
    I was wondering if it would be possible to create a script that can be used to change the rival's name in game, similar to FireRed. I know something similar has been done for the player's name. I know you can change the rival's name by changing it in the files, but I was hoping there was some way to let the player name the rival in the game.
     
    137
    Posts
    10
    Years
    • Age 35
    • Seen May 1, 2024
    Emerald doesn't have a changeable rival name. The naming screen setup which in FireRed lets you rename the rival was repurposed for Walda. You'd need to add the rival name to one of the save blocks (FireRed uses save block 1) and extend the naming screen code.
     
    247
    Posts
    6
    Years
    • Seen May 2, 2024
    Well, now there is a custom rival name process! For anyone else who wants to have a custom rival name, here's the code you'll need:

    In src/naming_screen.c:
    Spoiler:
    This code allows you to create a naming screen to give a name to your rival. Right now, even though I've given text to be displayed on the naming screen (like "YOUR NAME?", which is used in the player naming screen), no text appears at all. That's just an aesthetic issue, since the rival's name is assigned just fine.

    In data/specials.inc:
    Spoiler:
    This just allows you to access the RivalNameChange function from naming_screen.c in a script.

    In src/strings.c:
    Spoiler:

    This is the text that SHOULD be appearing when the naming screen appears, but doesn't.

    In include/global.h:
    Spoiler:
    The only thing that's changed here is that I added
    Code:
    u8 rivalName[PLAYER_NAME_LENGTH + 1];
    in there. This is the variable that's used to hold the rival's name.

    In src/main_menu.c:
    Spoiler:
    I tweaked this bit of code so that it makes sure that the rival has a name even if the player never gives them one. If the rival is female, the rival's name will be "MAY". If they're male, their name will be "BRENDAN", just like in the vanilla game.

    In src/battle_message.c:
    Spoiler:
    The only change here is in the final brackets. When the game looks at the trainer's name to print in battle, if it sees "MAY" or "BRENDAN", it will instead print the custom rival name.

    In gflib/string_util.c:
    Spoiler:
    This makes every instance of {RIVAL} in every piece of text (except in battles) prints the custom rival name.


    The rest of the changes are just making sure all of the dialogue doesn't use the original rival's name, and instead uses the custom one.

    In data/maps/EverGrandeCity_ChampionsRoom/scripts.inc,
    data/maps/LavaridgeTown/scripts.inc,
    data/maps/LilycoveCity/scripts.inc,
    data/maps/LittlerootTown_MaysHouse_1F/scripts.inc,
    data/maps/LittlerootTown_MaysHouse_2F/scripts.inc,
    data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc,
    data/maps/OldaleTown/scripts.inc,
    data/maps/Route103/scripts.inc,
    data/maps/Route104/scripts.inc,
    data/maps/Route110/scripts.inc,
    data/maps/Route119/scripts.inc,
    data/maps/RustboroCity/scripts.inc,
    data/text/match_call.inc, just replace every instance of MAY and BRENDAN in the text sections with {RIVAL}. If you're using Notepad++, (which I highly recommend), you can just search and replace every instance of MAY and BRENDAN with {RIVAL} in each file. Just make sure to make the search case-sensitive. Otherwise, you're going to ruin a ton of scripts in each file.

    To actually use this code, within any script of your choice, just type
    Code:
    special RivalNameChange
    At that point in the game, a naming screen will pop up, and you can name your rival whatever you want.
    And with that, unless I missed some other change I made that I forgot, you should have a fully functioning custom rival name!
     
    Last edited:
    119
    Posts
    14
    Years
  • Well, now there is a custom rival name process! For anyone else who wants to have a custom rival name, here's the code you'll need:

    Spoiler:

    Excellent, this worked very well! Thanks a lot, it was exactly what I needed. :-)
     
    Back
    Top