Selling items in shop processing by bulk

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Is it possible to setup the shop processing so a player can buy more than 1 item at a time? I want to sell "arrows" by increments of 10 for 1 gold.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You want it LISTED on the 'buy' screen as 10 arrows?


You can already buy multiples of items by using the up/down/page up/page down keys. I'm sure you know that already.


Anything else would require a script, and you would have to provide more detail about how to determine which items can be sold in bulk, how many make up one "unit" and the price. Also whether it should affect the selling screen as well.


Actually, I just noticed your thread title talks about SELLING items and your post talks about BUYING them. So if I've used strange wording in relation to buy/sell above, that's what confused me :)
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,042
First Language
French
Primarily Uses
RMMV
I think actually it's possible to make "bulk" buy by simply changing the price buy formulla in the scene_shop and for make different item we can use that

def somethingcase item_idwhen 1, 3,4,5,6,10price_formula /bulk #ectendendand the section who handle buy  formula is here

#-------------------------------------------------------------------------- # * Execute Purchase #-------------------------------------------------------------------------- def do_buy(number) $game_party.lose_gold(number * buying_price) $game_party.gain_item(@item, number) endbut it's can be a little hard to do for my opinion it would not be really pro efficient in your shop :/
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
A bit awkward, but doable using a variable switch.

item in the database simply described as e.g. "A bundle of 10 arrows".

Do whatever an arrow does, but in addition, have it call a common event.

In the common event each use decreases a variable by one.

When it hits zero, it removes a bundle from the inventory and resets the variable to 10 for the next bundle.
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
A bit awkward, but doable using a variable switch.

item in the database simply described as e.g. "A bundle of 10 arrows".

Do whatever an arrow does, but in addition, have it call a common event.

In the common event each use decreases a variable by one.

When it hits zero, it removes a bundle from the inventory and resets the variable to 10 for the next bundle.
I already had done this, but as you pointed out, it was too awkward. @Shaz, The issue with buying in bulk is that the lowest value an item can have in the game (1 gold by default) is just too much in my game for a single arrow, and I was hoping to not have to redo the whole pricing and reward system to account for this.

@Nio, that's interesting, I will look into that!

Can't believe this issue hasn't arisen before!
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
152
First Language
English
All you need is this:

arrows.png

Set it to parallel process in your stores, shouldn't cause any frame rate problems in stores, but add waits as necessary.

You will also likely need a script that raises the item cap (past 99), Hime has one if you don't already: http://himeworks.com/2013/10/item-stack-sizes/

Edit: Or you could do it like this so it doesn't need to process as many times making it (most likely) impossible for the player to see the stacks in their inventory or to have so many they move away from the parallel process(leave the store):Arrow2.png
 
Last edited by a moderator:

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Thanks, I already have a script to set arrows not to count towards inventory. I'll test soon, looks very nice; creative solution!

I won't need a parallel process, right, I can just have it check after the shop processing is over with a loop and conditional branch?
 
Last edited by a moderator:

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
152
First Language
English
Thanks, I already have a script to set arrows not to count towards inventory. I'll test soon, looks very nice; creative solution!

I won't need a parallel process, right, I can just have it check after the shop processing is over with a loop and conditional branch?
Most likely, I didn't test it like that though.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Common events don't run in shop scenes anyway.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top