RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
A "Sell only" shop.
I am trying to build a recycling unit that pays the player back in credits (money basically) and i would like to use the shop facility, however it appears that i am not allowed to create a shop without having at least one item for sale, is there a workaround to this?

If all fail i could always make it so that the recycling unit also let you buy some mildly useful scraps i suppose.
< >
Showing 1-6 of 6 comments
Hajami Nov 18, 2014 @ 12:38pm 
What are you planing?
Kyrah Abattoir Nov 18, 2014 @ 4:24pm 
Basically i would like to have vending machines that will sell products for credits but do not buy anything (this option already exist in the game)

And on the othyer side i need to make a recycling machine that will buy (and give you credits) the scraps that you collected, but will not sell anything. So the only way to get credits is to give a visit to the recycler to try to turn your junk items into credits.
Kio Kurashi Nov 18, 2014 @ 5:01pm 
Script: http://forums.rpgmakerweb.com/index.php?/topic/9636-sell-only-shop/


Also you can have events setup using conditional branches, Choice options, and the Change Items command.
something like having a list of choices for the different possible items then have a Conditional that will check to see if those said-name items exist in the inventory. if yes bring up an input number command that will check a variable(set with the amount of the item) to insure that they don't go over the max then add the appropiate amount of credits and remove those items.

It's basicly how the shop function works.
Marquise* Nov 18, 2014 @ 11:30pm 
That is a practical topic. I mean we have a bit of the same in our modern times in supermarkets.
Kyrah Abattoir Nov 19, 2014 @ 8:09am 
So here is a solution that i have designed for the problem. I wrote a script which override the default shop's initialisation:

Basically before calling a shop that should only allow you to sell items, you have to set a switch to "on" (in my example, $game_switches[1] aka the first switch)

The shop as soon as it opens will reset the switch back to OFF so all you really need is to set the switch to ON just before calling the shop that is "sell only".
This script also change the "Sell" button to "Recycle" but you can remove this part if you aren't interested, and instead of graying out the "Buy/Sell" button that is not available, it simply removes it.

#SCRIPT BEGIN HERE
#--------------------------------------------------------------------------
#->Allow to deny access to the buy/sell button (remove)
#->Rename "sell" to recycle.
#
#Do not forget to update the switch number!
#--------------------------------------------------------------------------

class Window_ShopCommand < Window_HorzCommand
#Init
def initialize(window_width, purchase_only)
@window_width = window_width
@purchase_only = purchase_only

@sell_only = $game_switches[1]
#Once initialized we reset the switch for convenience.
$game_switches[1] = false

super(0, 0)
end
#Options creation
def make_command_list
if(!@sell_only)
add_command(Vocab::ShopBuy, :buy)
end
if(!@purchase_only)
add_command(Vocab::ShopSell, :sell)
end
add_command(Vocab::ShopCancel, :cancel)
end
end

module Vocab
ShopSell = "Recycle"
end
#--------------------------
#SCRIPT END HERE
Last edited by Kyrah Abattoir; Nov 19, 2014 @ 8:14am
Hajami Nov 19, 2014 @ 8:43am 
Ah that s what you want. Thanks for sharing the Solution with the Community.
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Nov 18, 2014 @ 12:06pm
Posts: 6