Limit number of purchases at a shop

NorthKozar

Warper
Member
Joined
Jun 10, 2019
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Hello, I've been working on my first game in VX Ace and just slowly keep adding to and messing with stuff. Usually I've been able to find my answers by searching through the tons of information of dissecting scripts/old forum posts, but I feel a bit stumped on this one.

I want to have a shop where the player is limited in the number of purchases they can make at the shop.

So, I'm not worried about shop stock on individual items, but just the amount of times the player buys something. The idea behind this is that as the player unlocks more items at the shop, they can go back and stock up on special 1-use items, but can only bring 3 of them with them at a time (of any of the items sold from the shop). This limit would be stored in a variable that would reflect how many open slots the player has for these items. Such as, player has 2 items left and can buy just 1 more this trip, but maybe the next time they have 0 items and can make 3 purchases -- that would just all be in variables and conditional checks, but I don't know how to influence that in the shop processing.

Maybe I'm thinking about this the wrong way... But the best way I could think of was to find some way to limit the player's number of purchases based on a variable. However, searching around I wasn't able to find anyone trying to replicate this specifically. I thought of using a shop stock script, however the player may have a list of 10 items to choose from, so even if they all only have 1 stock, I'd need a way to close shop processing or trigger some event when they've hit their purchase limit.

Is this something feasible with eventing that I'm overlooking? Maybe there's a better way to approach this than I have thought of? Or maybe I'll have to try and dig into some scripting? Any thoughts, tips, opinions would be greatly appreciated. (or if more clarification is needed).
Thank you!
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,461
Reaction score
10,864
First Language
English
Primarily Uses
RMVXA
I doubt if this can be done without a script, but I shall leave this here in case it can be.

If the advice you receive makes it clear that you do need a script, please Report your post and ask for it to be moved to RGSS3 Script Requests.
 

QueenTeaYT

Veteran
Veteran
Joined
Nov 8, 2019
Messages
45
Reaction score
11
First Language
English
Primarily Uses
RMVXA
Hello, I've been working on my first game in VX Ace and just slowly keep adding to and messing with stuff. Usually I've been able to find my answers by searching through the tons of information of dissecting scripts/old forum posts, but I feel a bit stumped on this one.

I want to have a shop where the player is limited in the number of purchases they can make at the shop.

So, I'm not worried about shop stock on individual items, but just the amount of times the player buys something. The idea behind this is that as the player unlocks more items at the shop, they can go back and stock up on special 1-use items, but can only bring 3 of them with them at a time (of any of the items sold from the shop). This limit would be stored in a variable that would reflect how many open slots the player has for these items. Such as, player has 2 items left and can buy just 1 more this trip, but maybe the next time they have 0 items and can make 3 purchases -- that would just all be in variables and conditional checks, but I don't know how to influence that in the shop processing.

Maybe I'm thinking about this the wrong way... But the best way I could think of was to find some way to limit the player's number of purchases based on a variable. However, searching around I wasn't able to find anyone trying to replicate this specifically. I thought of using a shop stock script, however the player may have a list of 10 items to choose from, so even if they all only have 1 stock, I'd need a way to close shop processing or trigger some event when they've hit their purchase limit.

Is this something feasible with eventing that I'm overlooking? Maybe there's a better way to approach this than I have thought of? Or maybe I'll have to try and dig into some scripting? Any thoughts, tips, opinions would be greatly appreciated. (or if more clarification is needed).
Thank you!
i see you never really got an answer here, and im by no means an expert at VXA, so sorry you had to receive my advice out of everyone's!

i know little to nothing about this program but here's my idea (which can totally be flawed): it's really extra but you could make separate pages in your event for every item you want to be limited and edit the shop processing to match it. using a common event you could detect the number of said item the player owns and if they have the max limit then when they talk to the event it will provide the dialogue page for that limit. since i assume you will have many items in your shop, you will probably need a separate page for each combination of max items. for actual in-shop buying, since you want to limit the purchases (this is where im unsure), perhaps using the same common event (or a similar one) to detect the item in the player's inventory can force a dialogue option from the shop owner like "im all out for now, come back later" and will force the event to "end." then, when you talk to the event again, it will bring you to max limit page i mentioned earlier.

again, i know all of that is really extra but from my noob vision, that's all i know how to help
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,461
Reaction score
10,864
First Language
English
Primarily Uses
RMVXA
Unless you specifically want to try and do this by eventing (if it can be done that way) this would be much easier with a script.

If you want a script please Report this post and ask for it to be moved to RGSS3 Script Requests.
 

NorthKozar

Warper
Member
Joined
Jun 10, 2019
Messages
2
Reaction score
1
First Language
English
Primarily Uses
RMVXA
Thank you for the ideas, and while it could potentially work in some way using multiple pages, it would likely get very jumbled and confusing. Likely it seems this will need to have some sort of script to work, especially as I've messed around with it some more.

I'm thinking now about how I could use a variable to track the times a player buys an item from the store, and closing the shop when that limit is met. Then, when talking to the shop, checking that variable to see if it's at the threshold or not with a conditional branch to see if they even get to access the shop. With my limited scripting knowledge, I'm not entirely sure how I would insert like a "$game_variables[x] += 1" to happen on a purchase from the shop. It seems like I'd need to build a shop scene for it, unless I wanted to change how all shops worked.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,344
Reaction score
11,939
First Language
English
Primarily Uses
RMMV
You would need a script to do that. You COULD check how much gold the player has before the shop processing and how much after, but that will not tell you if the player only bought something, or only sold something, or did a combination of buying and selling, and it won't tell you ANYTHING if the player did a combination of buying and selling and ended up with the same amount of gold at the end.

If it's just one particular shop, and specific items, you could count how many of those in inventory before/after the shop window.
 

Wavelength

Pre-Merge Boot
Global Mod
Joined
Jul 22, 2014
Messages
4,608
Reaction score
3,856
First Language
English
Primarily Uses
RMVXA

I've moved this thread to Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

(at request of OP)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I bought a 2 week emergency food supply. And people are already making fun of me :( I'll be fed for a bit while they go hungry when food supplies get cut(for whatever reason).
Start of semester today. This is going to be a long one.
Can't wait for the next Sonichu
Birdhouses are usually made of wood. Birds typically live in trees. Trees are wood. Birdhouses are made of birdhouses.
He just discovered cellphones...

(I don't know why am I drawing so much these days...)

Forum statistics

Threads
93,674
Messages
914,480
Members
123,264
Latest member
DoritoDiet
Top