RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Sell-Only Shop

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 72
RMRK Junior
~ Sell-Only Shop Script v1.0 ~
a very simple script that allows the creation
of a shop where the player can only
sell items

ported from vx
by: Seiryuki
date: 2011-Dec-29
latest version: 1.0
modifications: you no longer need to manually deactivate the sell-only shop in the shop event as it is done automatically by the script when the player exits the shop. also, instead of disabling the "buy" command, it is removed.
additions: ability to change shop command texts for "sell" and "cancel"

original script information
author: Enelvon
date: 2011-Apr-30

original script sites
http://www.rpgmakervx.net/index.php?showtopic=45007
http://rmrk.net/index.php/topic,42482.msg485531.html



instructions
------------------------------------------------------------------------------
Place this script above Main, below Materials and above any other scripts that modify the command window of Scene_Shop.
Rather than using a switch, this uses a script command in an event.

To make your shops sell-only, call this script before shop processing:
By default, a shop is not sell-only (shop_sell_only = false)
This script-call must be done for every shop that you want to be sell-only.

$game_temp.shop_sell_only = true

Optional: Change text of SELL command (do before shop processing).
Only works for a sell-only shop.
By default, it is "Sell"

$game_temp.es_sell_text = "Selling"

Optional: Change text of CANCEL command (do before shop processing).
Only works for a sell-only shop.
By default, it is "Cancel"

$game_temp.es_cancel_text = "Goodbye"

NOTE: When exiting the shop, the script calls above automatically
revert to their defaults i.e. shop_sell_only=false, etc.
------------------------------------------------------------------------------
EXAMPLE OF A SELL-ONLY SHOP EVENT:

@> Script: $game_temp.shop_sell_only = true
@> Script: $game_temp.es_cancel_text = "Bye!"
@> Shop Processing: [Potion]
: : [Hi-Potion]

------------------------------------------------------------------------------


screenshots




script
MediaFire Link or,
Code: [Select]
#=============================================================================#
#= Ported to RPG Maker VX Ace
#= by: Seiryuki
#= on: 2011.12.29
#= VXA version: 1.0
#= additions: shop command text can be changed
#=============================================================================#

###############################################################################
# ~~~~~~~~~~~~~~~~~~~~~~SELL-ONLY SHOP SCRIPT v1.0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~by Enelvon~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~concept, assistance by Seiryuki~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~Last Update: 2011.04.30~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# site: rpgmakervx.net~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# post: http://www.rpgmakervx.net/index.php?showtopic=45007~~~~~~~~~~~~~~~~~~~~
###############################################################################
# This script allows you to have a shop that you can only sell to by removing
# the "Buy" option. Remember, you must enter at least one item to create the
# shop.
###############################################################################
#------------------------------------------------------------------------------
# COMPATIBILITY:
# Unknown: Haven't been tested with other RMVXAce shop scripts.
#------------------------------------------------------------------------------
# INSTRUCTIONS:
# Place this script above Main, below materials and above any other scripts
# that modify the command window of Scene_Shop.
# Rather than using a switch, this uses a script command in an event.
#
#   To make your shops sell-only, call this script before shop processing:
#   By default, a shop is not sell-only (shop_sell_only = false)
#   This script-call must be done for every shop that you want to be sell-only.
#     $game_temp.shop_sell_only = true
#
#   Optional: Change text of SELL command (do before shop processing).
#   Only works for a sell-only shop.
#   By default, it is "Sell"
#     $game_temp.es_sell_text = "Give"
#
#   Optional: Change text of CANCEL command (do before shop processing).
#   Only works for a sell-only shop.
#   By default, it is "Cancel"
#     $game_temp.es_cancel_text = "Bye!"
#
#   NOTE: When exiting the shop, the script calls above automatically
#         revert to their defaults i.e. shop_sell_only=false, etc.
#------------------------------------------------------------------------------
# EXAMPLE OF A SELL-ONLY SHOP EVENT:
#
# @> Script: $game_temp.shop_sell_only = true
# @> Script: $game_temp.es_cancel_text = "Bye!"
# @> Shop Processing: [Potion]
# :                 : [Hi-Potion]
#
###############################################################################
###############################################################################

class Game_Temp
  attr_accessor :shop_sell_only
  attr_accessor :es_sell_text
  attr_accessor :es_cancel_text
  alias enelvon_seiryuki_temp_init initialize
  def initialize
    enelvon_seiryuki_temp_init
    # Initialise the variables.
    @shop_sell_only = false
    @es_sell_text = Vocab::ShopSell
    @es_cancel_text = Vocab::ShopCancel
  end
end


class Window_ShopCommand < Window_HorzCommand
  alias es_make_command_list make_command_list
  def make_command_list
    # Make the shop a sell-only shop.
    if $game_temp.shop_sell_only == true
      add_command($game_temp.es_sell_text,   :sell,   !@purchase_only)
      add_command($game_temp.es_cancel_text, :cancel)
    elsif $game_temp.shop_sell_only == false
      $game_temp.es_sell_text = Vocab::ShopSell
      $game_temp.es_cancel_text = Vocab::ShopCancel
      es_make_command_list
    end
  end
end

class Scene_Shop < Scene_MenuBase
  alias es_terminate terminate
  def terminate
    es_terminate
    # Revert to defaults.
    $game_temp.shop_sell_only = false
    $game_temp.es_sell_text = Vocab::ShopSell
    $game_temp.es_cancel_text = Vocab::ShopCancel
  end
end
#END OF SCRIPT
;)
« Last Edit: December 31, 2011, 12:12:54 AM by Seiryuki »

**
Rep: +0/-0Level 69
RMRK Junior
Nice script, works for my game.

*
Rep: +0/-0Level 76
RMRK Junior
Erm hi, It's been a while since anyone has looked at this, I hope Its okay to post a question here, but..

In the example there is Potion and de-petrify in the call shop event, which I assumed meant the shop keeper would only buy Potions and de-petrify from you, but when I call my shop, its a Sell EVERYTHING-only shop :P

He'll buy anything worth anything which is not what I wanted... anyone see a way of just having the shopkeeper buy from you, the things in the call shop list???

**
Rep:
Level 72
RMRK Junior
In the example there is Potion and de-petrify in the call shop event, which I assumed meant the shop keeper would only buy Potions and de-petrify from you, but when I call my shop, its a Sell EVERYTHING-only shop :P

He'll buy anything worth anything which is not what I wanted... anyone see a way of just having the shopkeeper buy from you, the things in the call shop list???
Hi, sorry for being so late to post. Your question is an excellent one - it is the reason I wanted a Sell Only Shop script.
Get the Limit Shop Buy script from here:
http://www.rpgmakervxace.net/topic/603-limit-sell-items-to-buy-item-selections/?hl=%2Blimit+%2Bshop
It is a script that only allows the shopkeeper to only buy the items (from you) that he sells! It is a script done by Mithran for RMVX that was ported to VXAce by Mr. Bubble.

I have done a small script to Hide Shop Item Categories, if you need further restrictions/customisation.

Hope that helps.

*
Rep: +0/-0Level 37
Utter noob
I apologise for this thread necro, but I figured it was better to use this as my question is relevant, rather than start a new one.

So, to my simple question. I got this script working perfectly and was very simple to implement, so I thank you for that, however, I was wondering how I would go about adapting it to only show a 'sell only' option when the player chooses 'sell' from a list of options.

You see, in my game, I want the player to choose from a list of buy/sell/exit BEFORE opening the shop processing. I can get it 'buy only' for buying easy enough, but not selling.

Any advice would be much appreciated. Thanks.
Currently working on a fan game (yes, I know) to give me some direction as I learn to use the software.

Currently need help to find or learn to write my own script to randomize troop types and numbers in events.

*
Rep: +0/-0Level 37
Utter noob
It's ok, I got this working fine now.
Currently working on a fan game (yes, I know) to give me some direction as I learn to use the software.

Currently need help to find or learn to write my own script to randomize troop types and numbers in events.