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