Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: jcsnider on September 06, 2008, 03:57:19 pm

Title: Should be EXTREAMLY EASY
Post by: jcsnider on September 06, 2008, 03:57:19 pm
Could someone make a small script to put above the main so that it gets rid of the Buy option in the shop when you call shop from an event or whatever.
Title: Re: Should be EXTREAMLY EASY
Post by: Ryex on September 07, 2008, 05:30:21 pm
so do you still want the sell option to have to be selected?
Title: Re: Should be EXTREAMLY EASY
Post by: jcsnider on September 07, 2008, 08:23:19 pm
yea that is basically what I want if it was a normal project then I think I would be bale to do it easyily but wiht all my other scripts like netplay.... there are several different scripts that interfere with the shop.
Title: Re: Should be EXTREAMLY EASY
Post by: Ryex on September 07, 2008, 10:16:38 pm
you right EXTREMELY easy

got the the  "Window ShopCommand" script in the default scripts
find this method


  def initialize
    super(0, 64, 480, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 3
    @column_max = 3
    @commands = ["Buy", "Sell", "Exit"]
    refresh
    self.index = 0
  end


look at this line

@commands = ["Buy", "Sell", "Exit"]


change to this

@commands = ["Sell", "Exit"]



easy as that.

remember to add [RESOLVED] to the topic title
Title: Re: Should be EXTREAMLY EASY
Post by: Blizzard on September 08, 2008, 09:00:14 am
You haven't tested it since you haven't noticed that this isn't all. There's something in Scene_Shop what you need to edit as well.
Title: Re: Should be EXTREAMLY EASY
Post by: Starrodkirby86 on September 08, 2008, 06:31:45 pm
SRK, the scripting nooblet, has saved the day!!

Sir Ryexander, what you forgot is the s = 0, 1, and 2. When you removed the first choice, you actually changed Sell to Buy and Exit to Sell, so the hero can't exit the shop. D: Why? Because you did not configure the s = .

Here's the correct add-on.

Find these lines.


      when 0  # buy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 2  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end


You see here, with this unedited, and what Ryex had the choice beforehand, Sell will become s = 0 and Exit will become s = 1. To that piece of code, that means Sell = Buy and Exit = Sell. That's crazy land, I tell you. So replace that line of code with this:

      #when 0  # buy
        # Play decision SE
        #$game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        #@command_window.active = false
        #@dummy_window.visible = false
        #@buy_window.active = true
        #@buy_window.visible = true
        #@buy_window.refresh
        #@status_window.visible = true
      when 0  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 1  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end

I commented out the Buy code, but you can actually remove it. It's all cool. :P
Title: Re: Should be EXTREAMLY EASY
Post by: Ryex on September 08, 2008, 11:29:37 pm
Duh *Slaps face* thanks for correcting me Star If he had reported the bug I would of seen it but probably not till then
so to rephrase what Star said

in addition to my first post
find these lines in scene shop

      when 0  # buy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 2  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end


and replace with

      when 0  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 1  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end


got that? any problem feel free to ask!