tl;dr:
I need to:
I have already obtained permission from the original script writer to modify their script.
The quest log can be called through $scene = Scene_Quest.new. Below is the necessary code to know how the script handles quitting the quest screen:
class Scene_Quest #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(return_scene = $scene.type) @return_scene = return_scene end## etc screen processing## code at the end: # When cancel if Input.trigger?(Input:: # Play cancel SE $game_system.se_play($data_system.cancel_se) # Return to menu $scene = Scene_Menu.new(3) #returns to the fourth tab on the menu screen. original code for this line was $scene = @return_scene.new end
However, the problem with this is that regardless if the quest log was accessed by menu or by script call, pressing "x" or "esc" (etc) would cause it return to the menu. I want it to return to the map when the screen is called via script call or event. I'm not sure if this is possible, but it does happen with the save screen in that it returns to the map rather than the menu when called by an event (though not by script call).
I need to:
- Store the previous scene
- If the previous scene was not Scene_Map, set return_scene to return to Scene_Menu.new(3)
I have already obtained permission from the original script writer to modify their script.
The quest log can be called through $scene = Scene_Quest.new. Below is the necessary code to know how the script handles quitting the quest screen:
class Scene_Quest #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(return_scene = $scene.type) @return_scene = return_scene end## etc screen processing## code at the end: # When cancel if Input.trigger?(Input:: # Play cancel SE $game_system.se_play($data_system.cancel_se) # Return to menu $scene = Scene_Menu.new(3) #returns to the fourth tab on the menu screen. original code for this line was $scene = @return_scene.new end
However, the problem with this is that regardless if the quest log was accessed by menu or by script call, pressing "x" or "esc" (etc) would cause it return to the menu. I want it to return to the map when the screen is called via script call or event. I'm not sure if this is possible, but it does happen with the save screen in that it returns to the map rather than the menu when called by an event (though not by script call).
Code:
def on_cancel # Play cancel SE $game_system.se_play($data_system.cancel_se) # If called from event if $game_temp.save_calling # Clear save call flag $game_temp.save_calling = false # Switch to map screen $scene = Scene_Map.new return end # Switch to menu screen $scene = Scene_Menu.new(4) end