Jump to content
Seiryuki

Sell-Only Shop (ported from VX)

Recommended Posts

~ 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

2eff7d5dcc89f6e2da2462d899420b243be00c74810041c336340e30eca9c2726g.jpg

5955569ec4945def3c1fea62209018b7514286704c1f187b2c97613b0fa68f7a6g.jpg

 

 

script

MediaFire Link, or

#=============================================================================#
#= 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

;)

Edited by Seiryuki

Share this post


Link to post
Share on other sites

Great, I've always had pawnshops instead of being able to sell stuff directly. I was hoping this option would have returned at ACE but no such luck. Thankfully, we have scripters like you who bring back old elements from the previous era of makers.

 

 

Thank you kindly for making this script. :)

Share this post


Link to post
Share on other sites

Firstly, I'm no scripter....but thanks for the compliment. :D

And I might be heading in that direction.

 

Anyways, I'm working on porting Mithran's Limit Shop script, which is the main reason I had requested the Sell-Only Shop Script for VX. LimitShop script restricts a shop in such a way that the player can only sell items that the shop sells. When used with the Sell-OnlyShop script you can force the creation of specific shops like a "Loot Shop" where you setup the shop to only have loot items for sale and make it a sell-only shop so that it really doesn't sell loot to the player, but only allows the player to sell loot to it!

 

That's the main reason for this sell-only shop script, but I'm glad if you come up with other uses.

 

Wish me luck in porting Mithran's Limit Shop. It's just about 20 lines of code and I'm having a hard time :wacko: .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×