The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other OW Sprite Disappearing (https://www.pokecommunity.com/showthread.php?t=359370)

EViLGRiN December 4th, 2015 6:21 PM

OW Sprite Disappearing
 
Hi! I'm having an issue with an OW sprite disappearing when I leave the map and then re-enter. I actually have 2 OW sprites, I set the flag for one of them at the beginning of the game, so they're hidden. After some dialogue, I have this:

hidesprite 0x1
setflag 0x202 'flag is assigned to sprite 0x1
clearflag 0x203 'flag is assigned to sprite 0x2
showsprite 0x2

Which works great, my new sprite is there, old sprite is gone. When I leave the map however and then re-enter, both sprites are gone. I assumed once the flag was cleared it would be fine. Any ideas? What am I missing here?

Avara December 4th, 2015 7:17 PM

Try using two showsprites - that's what I do, just to be safe, and it always shows the sprite correctly =)

so;

hidesprite 0x1
setflag 0x202
showsprite 0x2
clearflag 0x203
showsprite 0x2

Try that! =)

EViLGRiN December 4th, 2015 9:01 PM

Quote:

Originally Posted by avaramoon (Post 9022043)
Try using two showsprites - that's what I do, just to be safe, and it always shows the sprite correctly =)

so;

hidesprite 0x1
setflag 0x202
showsprite 0x2
clearflag 0x203
showsprite 0x2

Try that! =)

Thanks for the suggestion, but unfortunately that didn't do the trick...

Spherical Ice December 4th, 2015 11:16 PM

Are you sure the map doesn't have a level script to hide person 0x2?

Shogun December 5th, 2015 1:09 AM

hidesprite 0x1
setflag 0x202
showsprite 0x3
clearflag 0x203
showsprite 0x3

Maybe you are using event n° and not people n° so the 0x2 will be 0x3. But normally your original script is good.

EViLGRiN December 5th, 2015 7:18 AM

Thanks everyone. I figured it out. I probably should have mentioned that I was using a variable to set the flag, which apparently doesn't work. Although I'm not sure why it wouldn't... Doesn't this make sense?

setvar 0x40F6 0x200
setvar 0x40F7 0x201

hidesprite 0x1
setflag 0x40F7
showsprite 0x3
clearflag 0x40F6
showsprite 0x3

Spherical Ice December 5th, 2015 7:36 AM

Quote:

Originally Posted by EViLGRiN (Post 9022612)
Thanks everyone. I figured it out. I probably should have mentioned that I was using a variable to set the flag, which apparently doesn't work. Although I'm not sure why it wouldn't... Doesn't this make sense?

setvar 0x40F6 0x200
setvar 0x40F7 0x201

hidesprite 0x1
setflag 0x40F7
showsprite 0x3
clearflag 0x40F6
showsprite 0x3

Variables and flags aren't synonymous, and can't always be used interchangeably. You can only use flags to control visibility. The first snippet of code you've posted there will change the values of the variables 0x40F6 and 0x40F7, but the second snippet of code is setting flags 0x40F7 and 0x40F6, but the two are not synonymous. It's also worth noting that flags that high are unsafe anyway; in general the boundary is 0x200 - 0x2FF.

To control visibility, you need to assign the Person event's Person ID in Advance Map to be the flag that, when set, will hide them. For example, to hide this Person event:

http://i.imgur.com/2T1X0Xe.png

You would need to put the following in a script:

hidesprite 0x1
setflag 0x2A1

And, to show it, you'd do:

clearflag 0x2A1
showsprite 0x1

Also I'm not sure why it's been suggested to use the showsprite command twice; you only need to use it once, after the flag has been cleared.

I hope that helps. I'd recommend reading through this document to get a better understanding on the distinction between flags and variables and how to safely use them.


All times are GMT -8. The time now is 2:24 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.