• 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!
  • Cyndy, May, Hero (Conquest), or Wes - 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] Hidesprite won't work, reappears after walking

I'm trying to have a stationary legendary battle, I can initiate it just fine, but when I try to get the sprite that initiates the battle, it will just reappear after walking a step, am I doing something wrong?

Here's the uncompiled script I am using to initiate a battle with Entei:
Spoiler:
 
Assign the OW a safe flag in AdvanceMap (or whatever map editor you're using)

After the battle, use the fadescreen command to turn the screen to black.

Before turning the screen to normal, use the hidesprite 0x(person event number) command followed by setflag (OW flag you assigned)

Here's a super basic script I wrote to give you an idea:

Spoiler:

So for example in AdvanceMap I'd change the Person ID field of my Zigzagoon to 0400 and then use setflag 0x400 in my script upon fading the screen.

If you use the wrong flag, the NPC will return after 1 step.

Hope this helps.
 
Last edited:
Assign the OW a safe flag in AdvanceMap (or whatever map editor you're using)

After the battle, use the fadescreen command to turn the screen to black.

Before turning the screen to normal, use the hidesprite 0x(person event number) command followed by setflag (OW flag you assigned)

Here's a super basic script I wrote to give you an idea:

Spoiler:

So for example in AdvanceMap I'd change the Person ID field of my Zigzagoon to 0400 and then use setflag 0x400 in my script upon fading the screen.

If you use the wrong flag, the NPC will return after 1 step.

Hope this helps.

So, I have tried that, used flag 0x23 (going off of a list of unused flags) and not seeming to work, its person event 2 so I have it set to hidesprite 0x2 and its person ID to 0023 but it doesn't want to hide the sprite still
 
So, I have tried that, used flag 0x23 (going off of a list of unused flags) and not seeming to work, its person event 2 so I have it set to hidesprite 0x2 and its person ID to 0023 but it doesn't want to hide the sprite still

It's been a while since I've done anything with Emerald, but IIRC you also need what A-map calls a "map script" to hide the sprite after the battle. You don't need to write or compile this script yourself, just point to a copy of the script for one of the existing legendary encounters (they all use the same code copied to different addresses for some reason, so you can just reuse one of the existing map scripts for all of your static encounters).

So as an example, I have a compiled Articuno encounter script which looks like this :
Spoiler:

Which works after adding a map script which looks like this:

Spoiler:

The map script is added under the headers tab. Just make a new one with the script type set to "05 On entering map/on menu close" and paste $238E3A into its script offset box , and it should work.
 
It's been a while since I've done anything with Emerald, but IIRC you also need what A-map calls a "map script" to hide the sprite after the battle. You don't need to write or compile this script yourself, just point to a copy of the script for one of the existing legendary encounters (they all use the same code copied to different addresses for some reason, so you can just reuse one of the existing map scripts for all of your static encounters).

So as an example, I have a compiled Articuno encounter script which looks like this :
Spoiler:

Which works after adding a map script which looks like this:

Spoiler:

The map script is added under the headers tab. Just make a new one with the script type set to "05 On entering map/on menu close" and paste $238E3A into its script offset box , and it should work.

I'll try this when I get home!
 
Back
Top