Return or Create New Window Without Repetition

Again, I have yet to make another thread for this problem I am having.

To sum it up, I am making a simple "Cut Tree" command via script. What I did was:

class Cut< Window_Command def initialize super(0, 0) end def make_command_list make_cut_command end def window_width return 140 end def window_height return 140 end def make_cut_command add_command("Cut Tree", :cut_command) add_command("Cancel", :cancel) end def cut_command #stuff here SceneManager.goto(Scene_Map) end def cancel SceneManager.goto(Scene_Map) endendall is working fine, needless to say this is a part of the whole script, however this is where my problem seems to be starting or rather, what my script needs.

When ever I finish doing the stuff on cut_command, I have to go to Scene Map, because if I don't, it seems that my game freezes after that.

Is there a way on how to implement a return scene? Like say for example after cutting and the execution happens, returns the window to the command list. If I press X on the other hand, should go directly to cancel. It won't, sadly. Because I need to go to cancel command before it stops.

Third problem is that, how can I make another command, that does not need me to repeat making another window command? Like for example:

Choices:

Cut Trees

Cancel

When I chose Cut Trees:

Cut Trees > Execute Command > "Do you want to cut more trees?"

 if yes > Return to the Command

 if no > Go to Scene Map
You have to reactivate the command menu after you select the cut command, or else it won't receive input.

I also recommend you make your scene check for Input.trigger?🙂B ). It'll check for the escape button being pressed. This is usually used to close a scene.
what command should I reactivate?

I tried

returnbut it seems not to be working. I also tried returning initialize or the window itself but it gives me an error.
Use 'activate' on the window.
on window command itself?
Where do you create this window? Scene_Map? Scene_Menu?
Its on a new class from Scene_MenuBase
Basically just like what Zalerinian said, play around with .active .select .unselect

You could do the following:

add_command("yes", return_command)add_command("no", go_to_Scene_Map)and on return command:

def return_command self.unselect previous_window.activeendLook into Scene_Item
Wow that's another new thing I learned. Thanks!

Now its time to grab some red bull and rock scripting for the rest of my time 😀

Original thread: https://forums.rpgmakerweb.com/threads/return-or-create-new-window-without-repetition.23228/