Hi everyone !
Would it be possible to create a pluggin to limit the number of item a shop could sell ? Would it be hard to do ? Maybe with pluggin command to Refresh shops (meaning refill all the item).
I don't How it would work. Do we palce a limite on the item notepad or something.
That could be nice for example to put some reasonable price for common item but avoiding him to buy X99 potions.
Thanks a lot and enjoy making !
Greg
Shop Item Stocks
● ARCHIVED · READ-ONLY
-
-
It shouldn't be that hard to do. You just have to change the way shops work to have both a list of items and how much of the item they have.
There are several ways you could handle configuration depending on how you want it to work.
The simplest but least flexible is to configure the stock via note-tags but this would mean every shop has the same amount of stock for that particular item. The hard but flexible way is requiring plugin commands or script commands to set up the shop stock before opening it.
In addition to that, you want to persist the shop's current stock somehow although Tsukihime already has a plugin for that.
I don't currently have access to RPG Maker, but I could see if I can hack something together later. -
It shouldn't be that hard to do. You just have to change the way shops work to have both a list of items and how much of the item they have.
There are several ways you could handle configuration depending on how you want it to work.
The simplest but least flexible is to configure the stock via note-tags but this would mean every shop has the same amount of stock for that particular item. The hard but flexible way is requiring plugin commands or script commands to set up the shop stock before opening it.
In addition to that, you want to persist the shop's current stock somehow although Tsukihime already has a plugin for that.
I don't currently have access to RPG Maker, but I could see if I can hack something together later.
Hum, actually, the least flexible way seems to be fine for a project like mine cause objects are sell once in a shop. What kind of Note-tags are you talking about ? Must I create some or do you think existing pluggin are already available ?
I will take a look on the Tsukihime pluggin.
Thank you very much. -
Well, there doesn't exist a plugin for shop stock yet that I know of. I was just theorising about how it could be made.
-
Here's an option:
https://forums.rpgmakerweb.com/index.php?threads/eis-shop-system.63514/ -
Here's an option:
https://forums.rpgmakerweb.com/index.php?threads/eis-shop-system.63514/
Hey, I tried it but it kind of buggy and doesn't work... -
I've been able to hack something together. It's pretty basic and it depends on Hime's Shop Manager plugin (which I linked in my first reply) but it should hopefully do what you need.
Spoiler
My code is public domain, so enjoy! -
I've been able to hack something together. It's pretty basic and it depends on Hime's Shop Manager plugin (which I linked in my first reply) but it should hopefully do what you need.
Spoiler
My code is public domain, so enjoy!
Hey, thank you for this pluggin.
It doesn't worok on my project but it's maybe because oI don't know how to use Hime pluggin.
I have the 2 pluggins (Hime first yours next), I add the Notetag <stock: 5> for Potion and Super potion in my data base.
Then I created this Event on the map:
Script: Shop.open("testShop")
And then i use the RMMV shop with 2 objects tp buy : Potion and Super potion.
But I can manage to buy 30 of theim without any limitation...
I guess i'm doing something wrong there...
Edit : I also have this code in the F8 Developper tool :
Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode -
Which version of RPG Maker are you using?
-
I'm using the 1.5.2 as the 1.6.1 is to buggy for me...
-
Alright, I'll see if I can make it compatible with older versions later.
-
Oh that's the reason !
I would uopdated it to 1.6.1 if the battle test was working. instead of starting a test it starts the game... very annoying... -
This means that you didn't update your project, many people had this same "issue". When you update the engine, you also have to update your project based on the instructions here.I would uopdated it to 1.6.1 if the battle test was working. instead of starting a test it starts the game... very annoying...
@armornick You might be interested in the tutorial I posted in my signature. It teaches how to automatically make 'new' Javascript compatible with 'old' versions of MV. Ignore me if you already know how to do it. -
I think I made it work. I wasn't able to test it since I only have access to version 1.6.1 but it should work on any version now.
Spoiler
@Aloe Guvner
Thanks for the tutorial. I already mostly knew what was going on, but I didn't know earlier versions didn't have ANY ES6 features. I guess I'll have to write ES5 in the future. -
@Aloe Guvner : Thank you for your message, I have followed the instruction and it's work correctly ! Thanks a lot !
@armornick : Thank you too.
So there is something new but it still doesn't work how I had imagine it :D (with the two versions you post I had the same problem)
There is a number next to the item in the shop (let's say 5 cause i use your note pad <stock: 5>). But I can buy as much potion than i want, but only 5 times.
So let's say I bought 10 potions, the number change to 4. If I come back to the shop a second time and buy 40 potions for exemple, well the number go to 3. The number of Super potion stay at 5 everytime cause I didn't bought any. It's seems that the pluggin doesn't limit the number of item you can buy, but the number of time you can purchase a sort of item. I don't know if I'm clear enought...
It could be an interesting mechanic for a gameplay :p
-
Oops, I missed a few bugs because I always bought one item at a time.
It should be fixed now. (Same link as my posts above.)
I hope it works now, but tell me if there's anything else. -
@armornick : That's perfect ! Thank you so much for your time (and your knowledge). I really believe it's a very useful pluggin for any game and should be share !
Thank you for the both of you for your help ! -
@armornick : I know it's been a while but i discovered a new bug on your great pluggin !
Here is the situation :
First time in the shop, everything work correctly, I can buy the amount of item I put in stock.
Second time in the shop, same, everything work correctly.
But I soon as I save/load a game:
The stock system work BUT everything I buy doesnt appear in my inventory. Like there were 3 potions in the shop available but when I buy them (and that douche take my money :LZSsad:) The 3 potions don't appear in my inventory...
I can't tell you where does it come from. Does anyone has the same problem ?
Best regards ! -
Can you retry with the latest version of my script? This sounds like a bug I fixed recently.
-
@armornick
Hey,
I just retry with the lastest version of you script and I still have the same problem....