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

[ASM & Hex] Change the location of a sethealingplace variable

Scarlet D.

The Eternal
66
Posts
8
Years
  • ROM: Fire red

    Hello guys. So here is the concept

    The hero is trapped in a dungeon with trainers and he is unable to escape.

    Problem is: When the player loses i want him to spawn in a certain place (which is not a pokemon center).
    All i could do is sethealingplace at TWO ISLAND (which is an area not used in my game), but when I lose, I get teleported to the TWO ISLAND pokemon center instead of where i want.

    So, does anybody knows how can i change the map and header of sethealingplace 0xF in order for the player to spawn exactly where i want?
     

    Skeli

    Lord of the Rings
    300
    Posts
    10
    Years
  • If you want to do that properly, you'll need to use a part of JPAN's hacked engine.

    First, you'll need to paste this code at at 0xbfd54:
    Code:
    0B 48 AE F7 07 FC 01 06 00 0A 09 0E 21 70 60 70 FF 20 A0 70 07 48 AE F7 FD FB 00 04 00 0C A0 80 05 48 AE F7 F7 FB 00 04 00 0C E0 80 38 E0 00 00 5A 40 00 00 5B 40 00 00 5C 40 00 00

    Next you'll need to fix all of the Pokemon Center's healing places. From now on, all of the previous sethealingplaces will no longer work, and the sethealingplace table is essentially useless (unless you care about teleport). The sethealingplace command now works as follows:
    sethealingplace 0x1: Calls the mother heal script
    sethealingplace 0x2: Calls the Pokemon Center heal script
    Any sethealingplace past 0x2 also just calls the Pokemon Center's script.
    But this isn't all. You need to set the map script of the Pokemon Centers to the following now:
    Spoiler:

    The same principle applies to the mom script.

    Now what you want to do requires a little modification to the white out script. What I did in my game, was modify the mom script so that it checks whether you are at the position right under the mom, and if you're not, it just heals you and lets you continue. So pretty much this will not work if you want to have your player respawn at the same x and y coordiantes as you would be when you heal in your house. But this is very easy to avoid; just be careful where you make the spawn point.

    Write the new mom white out script as follows:
    Spoiler:

    Where:
    aaaa is the var you want to store the x coordinate of the player at
    bbbb is the var you want to store the y coordinate of the player at
    xx is the x coordinate where the player respawns when healing by the mother
    yy is the y coordinate where the player respawns when healing by the mother

    Now set the pointer at 0x7F5EC to whatever @start is.

    And that should work!
     
    64
    Posts
    5
    Years
  • I know this is like 3 years old, but thank you so much, this is incredible. I was having so many issues with this until I followed your guide. I can't believe this doesn't have more comments/upvotes. Bless you xxxx
     
    1
    Posts
    3
    Years
    • Seen Sep 17, 2021
    Hello! I'm really going out on a limb here hoping someone will reply, seeing as this post is years old, but I've recently gotten into ROM hacking myself and I attempted this, however it has broken my game now. The mom script worked like a charm, but now when I apply the pokecenter scripts when whiting out the screen just goes black and nothing happens. I followed this word for word, am I supposed to be using different variables for each pokemon center or should they all be the same?
     
    Back
    Top