From 567d4a5b75ca7ebbf01f98371f04f4ded028ad3a Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Sat, 27 Jul 2024 23:47:43 -0400 Subject: [PATCH] skip past sections where the joypad is ignored --- config.yaml | 2 +- pokemonred_puffer/environment.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 32a93b8..f6092a9 100644 --- a/config.yaml +++ b/config.yaml @@ -11,7 +11,7 @@ debug: max_steps: 16 log_frequency: 1 disable_wild_encounters: True - disable_ai_actions: False + disable_ai_actions: True use_global_map: False reduce_res: False animate_scripts: True diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index a9d22a4..1a7d508 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -686,6 +686,8 @@ def run_action_on_emulator(self, action): count += 1 else: self.pyboy.tick(self.action_freq, render=True) + while self.read_m("wJoyIgnore"): + self.pyboy.tick(1, render=False) if self.events.get_event("EVENT_GOT_HM01"): if self.auto_teach_cut and not self.check_if_party_has_hm(0x0F):