(VXA) Adding a new shop option?

Hello! I'm new here and I am not 100% sure this is where I can get help with scripting.

So I want to make a new steal mechanic in the shop menu. The problem is that I don't know how to add the new option in Scene_Shop. Does anyone know how to add another shop menu option?
For a bit more context, all the scripting I have really done so far is a rough script to fix two characters.

I've moved this thread to Script Support. Thank you.

Window_ShopCommand:
upload_2019-1-13_10-41-31.png

Code:
  def make_command_list
    add_command(Vocab::ShopBuy,    :buy)
    add_command(Vocab::ShopSell,   :sell,   !@purchase_only)
    add_command(Vocab::ShopSteal,  :steal)
    add_command(Vocab::ShopCancel, :cancel)
  end

Scene_Shop:
upload_2019-1-13_10-42-7.png

Code:
  def create_command_window
    @command_window = Window_ShopCommand.new(@gold_window.x, @purchase_only)
    @command_window.viewport = @viewport
    @command_window.y = @help_window.height
    @command_window.set_handler(:buy,    method(:command_buy))
    @command_window.set_handler(:sell,   method(:command_sell))
    @command_window.set_handler(:steal, method(:command_steal))
    @command_window.set_handler(:cancel, method(:return_scene))
  end
upload_2019-1-13_10-42-36.png

Code:
  def command_buy
    @dummy_window.hide
    activate_buy_window
  end
  #-------------------------------------------------------------------------- 
  def command_steal
    #### stuff goes here
  end
You'll also need to make: def on_steal_ok, def activate_steal_window, and def on_steal_cancel.
Window_ShopCommand:
View attachment 107046
Code:
  def make_command_list
    add_command(Vocab::ShopBuy,    :buy)
    add_command(Vocab::ShopSell,   :sell,   !@purchase_only)
    add_command(Vocab::ShopSteal,  :steal)
    add_command(Vocab::ShopCancel, :cancel)
  end

Scene_Shop:
View attachment 107047
Code:
  def create_command_window
    @command_window = Window_ShopCommand.new(@gold_window.x, @purchase_only)
    @command_window.viewport = @viewport
    @command_window.y = @help_window.height
    @command_window.set_handler(:buy,    method(:command_buy))
    @command_window.set_handler(:sell,   method(:command_sell))
    @command_window.set_handler(:steal, method(:command_steal))
    @command_window.set_handler(:cancel, method(:return_scene))
  end
View attachment 107048
Code:
  def command_buy
    @dummy_window.hide
    activate_buy_window
  end
  #--------------------------------------------------------------------------
  def command_steal
    #### stuff goes here
  end
You'll also need to make: def on_steal_ok, def activate_steal_window, and def on_steal_cancel.
Ok. I have done all this, but for some reason, .show.activate is not recognized for the steal activate.
Code:
  def command_steal
    @dummy_window.hide
    activate_steal_window
  end
 
  def on_steal_cancel
    @command_window.activate
    @dummy_window.show
    @steal_window.hide
    @status_window.hide
    @status_window.item = nil
    @help_window.clear
  end
 
  def on_steal_ok
    @item = @steal_window.item
    @steal_window.hide
    @number_window.set(@item, max_buy, buying_price, currency_unit)
    @number_window.show.activate
  end
 
  def create_steal_window
    wy = @dummy_window.y
    wh = @dummy_window.height
    @steal_window = Window_ShopSteal.new(0, wy, wh, @goods)
    @steal_window.viewport = @viewport
    @steal_window.help_window = @help_window
    @steal_window.status_window = @status_window
    @steal_window.hide
    @steal_window.set_handler(:ok,     method(:on_steal_ok))
    @steal_window.set_handler(:cancel, method(:on_steal_cancel))
  end
 
  def activate_steal_window
    @steal_window.show.activate
    @status_window.show
  end
Window_ShopSteal is just Window_ShopBuy but renamed.
That just needs to be two commands.
@steal_window.show
@steal_window.activate
That just needs to be two commands.
@steal_window.show
@steal_window.activate
Still nothing, it says that both are undefined.
because your calling the activate before you create the window
def command_steal
@dummy_window.hide
create_steal_window
activate_steal_window
end
@Roninator2
That would create a memory leak because the steal window would be re-made without disposing the old one every time the player selects the steal command.

Just make that window upon starting the scene, either in the start method directly or in another, already existing window making method.
@Sixth @Roninator2
Thanks a lot guys!
That worked great, even finished the chance randomizer and what happens on a successful steal.
All I need to do now is somehow make the shop window close as the consequence.

Original thread: https://forums.rpgmakerweb.com/threads/vxa-adding-a-new-shop-option.104400/