• 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] Setflag doesn't take effect until I reload the zone

3
Posts
9
Years
    • Seen Feb 20, 2024
    I have a script that starts a fight, fades the screen and sets a flag. I have the flag set within the sprites person id within advance map.

    The problem is the person even will disappear after the fight from the hidesprite function, but reappears whenever you take a step. HOWEVER, if you leave the zone and then re-enter, the person event does not show (as you would expect).

    Why does this happen? How do I keep the person even from reshowing after the fight (and before you leave the zone).

    The script in question:

    Code:
    #org @startfight
    cry 0xFB 0x2
    setwildbattle 0xFB 0x5 0x5D
    special 0x138
    playsong 0x156 0x0
    fadescreen 0x1
    fadescreen 0x0
    hidesprite 0x800F
    setflag 0x200
    release
    end
     
    7
    Posts
    5
    Years
    • Seen Mar 27, 2019
    I had the same problem with the sprites of the rocks when using rock smash. It helped for me when I changed the 0x800F to the exact sprite number.
     
    760
    Posts
    15
    Years
    • Seen yesterday
    When an overworld is already loaded in your savefile, the corresponding flag is loaded along with the overworld sprite. Try re-entering the map and run the script from there, that might work.
     
    3
    Posts
    9
    Years
    • Seen Feb 20, 2024
    When an overworld is already loaded in your savefile, the corresponding flag is loaded along with the overworld sprite. Try re-entering the map and run the script from there, that might work.

    For anyone who might be looking for this in the future, this was the issue I had. Simply leaving and re-entering the zone made it work as expected. Wish I figured that out sooner!

    Thank you for the help, and for dropping that rather interesting fact. I'm still trying to learn a lot about gen 3 rom hacking.
     
    Back
    Top