From ab841804231277877f451468d77bb5b71a5f453a Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 24 Aug 2025 01:05:13 -0700 Subject: [PATCH 1/4] SV Egg autonomous: update error messages --- .../PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp | 4 ++-- .../Programs/Sandwiches/PokemonSV_SandwichRoutines.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp index 69526385f1..d22b4f8542 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp @@ -767,12 +767,12 @@ bool EggAutonomous::handle_recoverable_error( env.log("Don't reset game to protect it.", COLOR_RED); return true; } - + std::string fail_message = e.message(); consecutive_failures++; if (consecutive_failures >= 3){ OperationFailedException::fire( ErrorReport::SEND_ERROR_REPORT, - "Failed 3 times in the row.", + "Failed 3 times in the row.\n" + fail_message, env.console ); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/Sandwiches/PokemonSV_SandwichRoutines.cpp b/SerialPrograms/Source/PokemonSV/Programs/Sandwiches/PokemonSV_SandwichRoutines.cpp index 9338e0695d..ab30e2368a 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Sandwiches/PokemonSV_SandwichRoutines.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Sandwiches/PokemonSV_SandwichRoutines.cpp @@ -1105,7 +1105,8 @@ void run_sandwich_maker( stream.log("Read nothing on center plate label."); OperationFailedException::fire( ErrorReport::SEND_ERROR_REPORT, - "No ingredient found on center plate label.", + "run_sandwich_maker: No ingredient found on center plate label.\n" + "Please make sure that you have set the correct Game Language in the program settings.", stream, std::move(screen) ); From 38a0dbf22649d5c201dd98b722960cb8e5f25076 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 24 Aug 2025 01:05:43 -0700 Subject: [PATCH 2/4] SV Egg autonomous: revert path to egg basket --- .../Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp index 92b1df791c..ace82e84a4 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp @@ -351,7 +351,7 @@ void collect_eggs_after_sandwich( // Recall your ride to reduce obstacles. pbf_press_button(context, BUTTON_PLUS, 20, 105); -#if 1 +#if 0 // Move left pbf_move_left_joystick(context, 0, 128, 80ms, 480ms); pbf_press_button(context, BUTTON_L, 120ms, 120ms); From 84a417ff2ba1f409954ec486e3d86d7575ecd5cd Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 24 Aug 2025 03:17:59 -0700 Subject: [PATCH 3/4] SV Egg autonomous: update path to egg basket. change settings to turn on Camera support if fails to get to egg basket. --- .../Programs/Eggs/PokemonSV_EggAutonomous.cpp | 25 +++++++++++++++++ .../Programs/Eggs/PokemonSV_EggAutonomous.h | 2 +- .../Programs/Eggs/PokemonSV_EggRoutines.cpp | 28 ++++++++++++++++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp index d22b4f8542..f335ff5312 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.cpp @@ -29,6 +29,7 @@ #include "PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.h" #include "PokemonSV/Programs/Boxes/PokemonSV_BoxRelease.h" #include "PokemonSV/Programs/Sandwiches/PokemonSV_SandwichRoutines.h" +#include "PokemonSV/Programs/AutoStory/PokemonSV_MenuOption.h" #include "PokemonSV_EggAutonomous.h" namespace PokemonAutomation{ @@ -736,6 +737,26 @@ void EggAutonomous::save_game(SingleSwitchProgramEnvironment& env, ProController } } +void change_settings_egg_program(SingleSwitchProgramEnvironment& env, ProControllerContext& context, Language language){ + int8_t options_index = 4; + enter_menu_from_overworld(env.program_info(), env.console, context, options_index, MenuSide::RIGHT); + MenuOption session(env.console, context, language); + + std::vector>> options = { + {MenuOptionItemEnum::TEXT_SPEED, {MenuOptionToggleEnum::FAST}}, + {MenuOptionItemEnum::SKIP_MOVE_LEARNING, {MenuOptionToggleEnum::ON}}, + {MenuOptionItemEnum::GIVE_NICKNAMES, {MenuOptionToggleEnum::OFF}}, + {MenuOptionItemEnum::CAMERA_SUPPORT, {MenuOptionToggleEnum::ON}}, + {MenuOptionItemEnum::AUTOSAVE, {MenuOptionToggleEnum::OFF}}, + + }; + session.set_options(options); + + pbf_mash_button(context, BUTTON_A, 1 * TICKS_PER_SECOND); + clear_dialog(env.console, context, ClearDialogMode::STOP_TIMEOUT, 5, {CallbackEnum::PROMPT_DIALOG}); + press_Bs_to_back_to_overworld(env.program_info(), env.console, context); +} + bool EggAutonomous::handle_recoverable_error( SingleSwitchProgramEnvironment& env, ProControllerContext& context, @@ -780,6 +801,10 @@ bool EggAutonomous::handle_recoverable_error( env.log("Reset game to handle recoverable error"); reset_game(env.program_info(), env.console, context); + if (e.message().find("collect_eggs_from_basket") != std::string::npos){ + change_settings_egg_program(env, context, LANGUAGE); + } + return false; } diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.h b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.h index 69de407f5c..a8506f7f85 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.h +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggAutonomous.h @@ -126,7 +126,7 @@ class EggAutonomous : public SingleSwitchProgramInstance{ bool m_in_critical_to_save_stage = false; }; - +void change_settings_egg_program(SingleSwitchProgramEnvironment& env, ProControllerContext& context, Language language); } diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp index ace82e84a4..42f06fd8c8 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp @@ -351,6 +351,30 @@ void collect_eggs_after_sandwich( // Recall your ride to reduce obstacles. pbf_press_button(context, BUTTON_PLUS, 20, 105); +#if 1 + // this sequence will purposefully fail if Camera support is off. + // If we fail to reach the egg basket, we can then check that Camera support is on. + + // Move forward to table + pbf_move_left_joystick(context, 128, 0, 80, 40); + // Move left + pbf_move_left_joystick(context, 0, 128, 40, 40); + // Move forward to pass table + pbf_move_left_joystick(context, 128, 0, 80, 40); + // Move right + pbf_move_left_joystick(context, 255, 128, 40, 85); + // Move back/right to align to basket + pbf_move_left_joystick(context, 240, 255, 40, 40); + + // Move closer to the basket, up to the table + pbf_press_button(context, BUTTON_L, 20, 105); + pbf_move_left_joystick(context, 128, 0, 100, 40); + + // face away from the table + pbf_press_button(context, BUTTON_L, 20, 105); + pbf_move_left_joystick(context, 128, 255, 10, 40); +#endif + #if 0 // Move left pbf_move_left_joystick(context, 0, 128, 80ms, 480ms); @@ -371,7 +395,9 @@ void collect_eggs_after_sandwich( pbf_move_left_joystick(context, 255, 128, 80ms, 320ms); pbf_press_button(context, BUTTON_L, 120ms, 120ms); pbf_move_left_joystick(context, 128, 0, 160ms, 320ms); -#else +#endif + +#if 0 // Move left pbf_move_left_joystick(context, 0, 128, 40, 40); // Move forward to pass table From c791b2565efe59999c01ac48ab3a7c01cc3134ce Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 24 Aug 2025 12:55:19 -0700 Subject: [PATCH 4/4] SV egg auto: another update to path to egg basket. go back to working with both camera support off/on. --- .../Programs/Eggs/PokemonSV_EggRoutines.cpp | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp index 42f06fd8c8..9a51e01412 100644 --- a/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp +++ b/SerialPrograms/Source/PokemonSV/Programs/Eggs/PokemonSV_EggRoutines.cpp @@ -351,7 +351,7 @@ void collect_eggs_after_sandwich( // Recall your ride to reduce obstacles. pbf_press_button(context, BUTTON_PLUS, 20, 105); -#if 1 +#if 0 // this sequence will purposefully fail if Camera support is off. // If we fail to reach the egg basket, we can then check that Camera support is on. @@ -375,26 +375,38 @@ void collect_eggs_after_sandwich( pbf_move_left_joystick(context, 128, 255, 10, 40); #endif -#if 0 +#if 1 + // this sequence will work with both Camera Support being Off and On + + // Move forward to table + pbf_move_left_joystick(context, 128, 0, 320ms, 480ms); + // Move left pbf_move_left_joystick(context, 0, 128, 80ms, 480ms); - pbf_press_button(context, BUTTON_L, 120ms, 120ms); + pbf_press_button(context, BUTTON_L, 120ms, 480ms); pbf_move_left_joystick(context, 128, 0, 320ms, 480ms); // Move forward to pass table pbf_move_left_joystick(context, 255, 128, 80ms, 480ms); - pbf_press_button(context, BUTTON_L, 120ms, 120ms); - pbf_move_left_joystick(context, 128, 0, 640ms, 320ms); + pbf_press_button(context, BUTTON_L, 120ms, 480ms); + pbf_move_left_joystick(context, 128, 0, 640ms, 480ms); // Move right pbf_move_left_joystick(context, 255, 128, 80ms, 480ms); - pbf_press_button(context, BUTTON_L, 120ms, 120ms); - pbf_move_left_joystick(context, 128, 0, 320ms, 320ms); + pbf_press_button(context, BUTTON_L, 120ms, 480ms); + pbf_move_left_joystick(context, 128, 0, 320ms, 480ms); - // Move back to face basket - pbf_move_left_joystick(context, 255, 128, 80ms, 320ms); - pbf_press_button(context, BUTTON_L, 120ms, 120ms); - pbf_move_left_joystick(context, 128, 0, 160ms, 320ms); + // Turn right to face basket + pbf_move_left_joystick(context, 255, 128, 80ms, 480ms); + pbf_press_button(context, BUTTON_L, 120ms, 480ms); + + // Move closer to the basket, up to the table + pbf_move_left_joystick(context, 128, 0, 800ms, 480ms); + + // back away from the table, then face forwards towards the basket again + pbf_move_left_joystick(context, 128, 255, 200ms, 480ms); + pbf_move_left_joystick(context, 128, 0, 80ms, 480ms); + pbf_press_button(context, BUTTON_L, 120ms, 480ms); #endif #if 0