diff options
author | ghoulslash <41651341+ghoulslash@users.noreply.github.com> | 2020-06-30 13:24:39 -0600 |
---|---|---|
committer | ghoulslash <41651341+ghoulslash@users.noreply.github.com> | 2020-06-30 13:24:39 -0600 |
commit | 625c678f8858106c9ce3162ee5aecd4e69fb30e3 (patch) | |
tree | 588429ad9cac70dcc6393651d547989bbd88bc69 | |
parent | 8a9755187cb2f9860cdd0b8477519884eacb08d0 (diff) |
Created Toggle-Trainer-Sight (markdown)
-rw-r--r-- | Toggle-Trainer-Sight.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Toggle-Trainer-Sight.md b/Toggle-Trainer-Sight.md new file mode 100644 index 0000000..52ae4d2 --- /dev/null +++ b/Toggle-Trainer-Sight.md @@ -0,0 +1,31 @@ +## Toggling Trainers "Seeing" You + +Credit to ghoulslash + +Likely more useful for a debug menu feature, this may have utility for game events. **Note** that this only prevents them from noticing you. Talking directly to the trainer will still initiate the battle. + +### Create a flag to toggle trainer sight +Open [include/constants/flags.h](../blob/master/include/constants/flags.h). Replace an unused flag with `FLAG_SYS_TOGGLE_TRAINER_BATTLES`. For example: +```c +#define FLAG_UNUSED_0x881 (SYSTEM_FLAGS + 0x21) // Unused Flag +``` +becomes +```c +#define FLAG_SYS_TOGGLE_TRAINER_BATTLES (SYSTEM_FLAGS + 0x21) +``` + +### Prevent the trainers from seeing you +Open [src/trainer_see.c](../blob/master/src/trainer_see.c). Find `CheckForTrainersWantingBattle` And replace with the following: +```c +bool8 CheckForTrainersWantingBattle(void) +{ + u8 i; + + if (FlagGet(FLAG_TOGGLE_TRAINER_BATTLES)) + return FALSE; + + gNoOfApproachingTrainers = 0; + //etc... +``` + +### Finally, set your flag via a script or function, and watch the magic (not) happen! |