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 Safe Flags (https://www.pokecommunity.com/showthread.php?t=359589)

EViLGRiN December 9th, 2015 4:47 PM

Safe Flags
 
So I've heard mention time and time again that the flags that are safe to use are: 200-2FF

However, I recently found out that Bill the Pokemaniac uses 233 and 234 and the Captain on the S.S. Anne uses 237.

Am I missing something here? Obviously I can't use those right? Why are they considered safe?

PokemonValor December 9th, 2015 5:06 PM

"Safe flags" mean they won't mess with the actual ROM. They might overwrite something that's in the original game, but it's kind of assumed that you'll be changing the story in your hack.

Deokishisu December 9th, 2015 5:10 PM

They're considered safe because they're not overwritten or temporary, so they're stable. They also don't correspond to trainer flags (500-700), aren't actually variables (900+), aren't directly manipulated by the engine (many lower flags), and aren't reserved for other, non-script things already (badge setting/Pokedex setting on start menu/running shoes/cut tree flags/etc.)

There are many flags that are in the 200-2FF range that are used by the game's story already. Those already used flags are considered safe because, well, they are. The game clearly uses them with no negative consequences. There are also flags in that range that aren't safe, such as 0x266, which is set by the game engine when the Daycare has an Egg ready for pickup. You'll have to find unused flags in that range if you're preserving vanilla game events and need flags for your custom ones. Fortunately, if you're savvy, many of the flags used by the game are redundant and can be repurposed with little trouble. Here's an example, taken from a post from DavidJCobb:

Quote:

The game does not use checkitem to see if you have an item; instead, Game Freak scripts will always check for flags that were set as part of the event sequence that gave you the item (or it may even check for the OW-visibility flags if it was a pickup). E.x. the game uses "checkflag 0x271" after manually setting it, not "checkitem ITEM_BICYCLE 0x1".

A similar thing is done with badges. The "champ-in-making" guy that always chills next to a Gym statue doesn't check badge flags directly; there are eight flags (4B0-4B7) that are set along with those flags, which he checks. Redundant...
So, if you were to change the Gym guy's script in every Gym to check for the actual badge flags, you'll have freed up eight redundant flags for use (You may also want to check the badge checkers on the way up to the Pokemon League as well, though. They may use the redundant flags in their scripts too). You can use checkitem to check for Key Items as well and free up their event flags. So, you have those redundant flags alongside any unused flags in the 200-2FF range, if you put in a little elbow grease to free them up, of course.

There's also information about expanding the amount of safe flags by freeing up RAM and redirecting the flags to the newly alllocated space, but you'd have to do some searching to find that research, as I don't have it on hand.

Good luck!

EViLGRiN December 9th, 2015 5:22 PM

Thanks for the info! I will work on freeing some up.

But I don't know if I would call these "safe", just saying ;)

PokemonValor December 9th, 2015 5:37 PM

They're safe. But not necessarily "unused". If you want to keep a lot of the original flags/story you could just try looking through some threads that list out all the known, safe flags that are used, then just work around those


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.