Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
Intro:


This plugin handles managing shops in the game giving you more shop features.


Version: 1.00


Features:

  • Randomized Shops
  • Adjusting Shop sell prices
  • Shops with item stock
  • restocking item shops
  • Adjusting randomized item prices

Instructions:

  1. Install the script with the same name: EISShopSystem.js
  2. Add the buttons via script call either through common event or by an event on the map.
  3. Have fun!



/* Helpers
* Manager Helpers
* KR.ShopManager.createSellShop()
* -Creates a shop you can only sell items to.
*
* KR.ShopManager.adjustSellPrice(sellPoint);
* - This adjusts the sellprice for the shop by a percentage amount.
* Example: KR.ShopManager.adjustSellPrice(2.0)
* The above doubles the amount items sell for in game based off their original buy price.
* Note: setting it to 0.0 will default to the game's original setting of half the buy price.
*
* KR.ShopManager.createRandomizedPriceShop(buyMin, buyMax, sellMin, sellMax)
* -This shop sets a shop with randomized item prices. Everytime you enter the shop
* the price changes for both buy and sell based on the above parameters.
* Example: KR.ShopManager.createRandomizedPriceShop(0, 999, 200, 300);
*
* KR.ShopManager.customizeItemBuyPrice(itemInformation)
* -This changes the item buy price based on it's position in the list. This also overrides
* the regular shops buying prices for that item.
* Example: KR.ShopManager.customizeItemBuyPrice([2,'random', 50, 100],[1, 'random', 35, 75]);
*
* KR.ShopManager.createStockableShop(shopId, itemInformation,);
* This creates a shop with stock for a specific item with that id.
* Example: KR.ShopManager.createStockableShop(1, ['item', 1, 3])
* This would set the stock for an 'item' type item with the id 1 to 3.
* Note: You can have items with no stock alongside items with stock.
*
* KR.ShopManager.restockShop(shopId, itemInformation)
* This restocks an item at the shop with that specified ID.
* Example: KR.ShopManager.restockShop(1, ['item',1, 20], ['item', 6, 20]);
* The above would add 20 to the current stock of shop 1 with the item id of 1.
* Note: Items sold to a stock shop, update the shops current stock for that item
* if it is in the buy window.
*
* Extra Notes: You can combine some of these directives together when creating your shop.
*/


Setup Example Windows:

Screenshot_2.png


Screenshot_1.png





In-game Examples:


Screenshot_3.png
 


Please download the attached file to use the plugin.


View attachment EISShopSystem.js


Updated 6/17/2016



Credits:


Free for both commercial and non-commercial use.Credit with the name Kino or EIS.


Thanks:Thank you to anyone who decides to use this script; I appreciate it!


If there are any bugs/issue, please contact me via message on the forums. I want to try and make the script as extensible/flexible as possible, so if you have an ideas also


please message me.


Enjoy ~
 
Last edited by a moderator:

Soulnet

Veteran
Veteran
Joined
Mar 10, 2014
Messages
198
Reaction score
98
First Language
English
Primarily Uses
I can use this section very well as it suits me nicely.


* KR.ShopManager.customizeItemBuyPrice(itemInformation)
* -This changes the item buy price based on it's position in the list. This also overrides
* the regular shops buying prices for that item.
* Example: KR.ShopManager.customizeItemBuyPrice([2,'random', 50, 100],[1, 'random', 35, 75]);



However i'd love to do the same thing when selling an item and have that type of control.


Would it be to difficult to add?


Also within the shop as well, I don't want the prices to reset everything time the shop event is triggered. It'd like to use another trigger before the prices change (say time of day, or lock for 10 minutes with a timer), so you can still repeatedly use the shop but the prices change when other conditions are met. Is this possible with your script or is it an event i'd need to setup? Without it you could spam the shop until you get the price you wanted!
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
Right now there's no way to control that eternally in the system; there are a few people who can offer time based events  though I think.


That way you can have more control of when the shop is open; I will see what I  can do though for randomizing sell prices.


@Soulnet


There have been updates. I added clamping for buying items with stock.
You can also control item selling prices with the random tag using, similar to the above.


Looks like this: 

Code:
/*
* KR.ShopManager.customizeItemSellPrice(['item',1,'random', 333, 444]);
* item refers to the type.
* 1 refers to the ID in the database.
* random is the tag, to do min max randomization of price.
/

Code:
/*
* KR.ShopManager.customizeItemSellPrice(['item',1,'random', 333, 444]);
* item refers to the type.
* 1 refers to the ID in the database.
* random is the tag, to do min max randomization of price.
/
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
Glad this plugin was helpful to you!
 

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
867
Reaction score
399
First Language
English
Primarily Uses
RMMZ
Do you think you could do a patch for Yanfly's Shop Menu plugin?


If so I could definitely use this plugin in my game! :3
 

jackassets

Veteran
Veteran
Joined
Oct 31, 2015
Messages
223
Reaction score
43
First Language
Portugues
There is a conflict with ShopMenuCore yanfly.
 

markp80nj

Veteran
Veteran
Joined
Jan 22, 2016
Messages
78
Reaction score
28
First Language
English
Primarily Uses
Hey!


Thanks for this script!


I'm getting an error though, could you tell me what I'm doing wrong, please?


TIA

error.png

f8console.png

plugin.png
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
Remove the ) after the first bracketed item. [item, 7,3] instead of [item, 7, 3]).
 

markp80nj

Veteran
Veteran
Joined
Jan 22, 2016
Messages
78
Reaction score
28
First Language
English
Primarily Uses
Remove the ) after the first bracketed item. [item, 7,3] instead of [item, 7, 3]).

Thanks!


I figured it would be stupidly simple, but I was turning plugins off and on like there was no tomorrow, lol.


Great script, it's just what I needed!
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
Glad I could help!  I'll be working on an updated version  soon. 
 

OverLordFan

Villager
Member
Joined
May 28, 2016
Messages
6
Reaction score
0
First Language
Chinese
Primarily Uses
N/A
KR.ShopManager.customizeItemSellPrice(['item',1,'random', 333, 444]);


Nothing worked


The selling price is not a random set of values, but the buying price

123.png
 
Last edited by a moderator:

markp80nj

Veteran
Veteran
Joined
Jan 22, 2016
Messages
78
Reaction score
28
First Language
English
Primarily Uses
Hey, I just noticed that creating a  stockable shop it won't matter if I have money or not, I will be able to buy the items anyway.


In my case I had one roasted duck(100G) and three fried rice(10G).


I only had 27G, but I paid for the roasted duck and was able to buy it, it just took the 27G from me.


Then without any G left, I was still able to buy the 3 fried rice.


So I created a new project, created a stockable shop with 3 potions (50G) and one magic water(100G).


Gave the hero 25G and playtested.


Same result, with only 25G I was able to buy 250G worth of stuff.
 
Joined
Feb 18, 2015
Messages
628
Reaction score
349
First Language
English
Primarily Uses
RMMV
Hey, I'm trying to use this plugin, but it seems to not quite be working anymore.
I've set up shops to have limited stock of items, but when I go to the shop the player can still buy 99x the item.
No error logs, since it's not throwing any errors. It just seems to be ignoring the script call entirely. I even tried turning off Yanfly's Shop plugin, in case there was an incompatibility - no luck, still happened.
 
Joined
Dec 2, 2019
Messages
2
Reaction score
2
First Language
Indonesia
Primarily Uses
RMMV
Intro:


This plugin handles managing shops in the game giving you more shop features.


Version: 1.00


Features:

  • Randomized Shops

  • Adjusting Shop sell prices

  • Shops with item stock

  • restocking item shops

  • Adjusting randomized item prices

Instructions:

  1. Install the script with the same name: EISShopSystem.js

  2. Add the buttons via script call either through common event or by an event on the map.

  3. Have fun!



/* Helpers
* Manager Helpers
* KR.ShopManager.createSellShop()
* -Creates a shop you can only sell items to.
*
* KR.ShopManager.adjustSellPrice(sellPoint);
* - This adjusts the sellprice for the shop by a percentage amount.
* Example: KR.ShopManager.adjustSellPrice(2.0)
* The above doubles the amount items sell for in game based off their original buy price.
* Note: setting it to 0.0 will default to the game's original setting of half the buy price.
*
* KR.ShopManager.createRandomizedPriceShop(buyMin, buyMax, sellMin, sellMax)
* -This shop sets a shop with randomized item prices. Everytime you enter the shop
* the price changes for both buy and sell based on the above parameters.
* Example: KR.ShopManager.createRandomizedPriceShop(0, 999, 200, 300);
*
* KR.ShopManager.customizeItemBuyPrice(itemInformation)
* -This changes the item buy price based on it's position in the list. This also overrides
* the regular shops buying prices for that item.
* Example: KR.ShopManager.customizeItemBuyPrice([2,'random', 50, 100],[1, 'random', 35, 75]);
*
* KR.ShopManager.createStockableShop(shopId, itemInformation,);
* This creates a shop with stock for a specific item with that id.
* Example: KR.ShopManager.createStockableShop(1, ['item', 1, 3])
* This would set the stock for an 'item' type item with the id 1 to 3.
* Note: You can have items with no stock alongside items with stock.
*
* KR.ShopManager.restockShop(shopId, itemInformation)
* This restocks an item at the shop with that specified ID.
* Example: KR.ShopManager.restockShop(1, ['item',1, 20], ['item', 6, 20]);
* The above would add 20 to the current stock of shop 1 with the item id of 1.
* Note: Items sold to a stock shop, update the shops current stock for that item
* if it is in the buy window.
*
* Extra Notes: You can combine some of these directives together when creating your shop.
*/


Setup Example Windows:






In-game Examples:




Please download the attached file to use the plugin.


View attachment 40521


Updated 6/17/2016



Credits:



Free for both commercial and non-commercial use.Credit with the name Kino or EIS.


Thanks:Thank you to anyone who decides to use this script; I appreciate it!


If there are any bugs/issue, please contact me via message on the forums. I want to try and make the script as extensible/flexible as possible, so if you have an ideas also


please message me.


Enjoy ~
How to make Stock for Key Item like recipe book?
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
814
First Language
English
Primarily Uses
RMMV
I'll be reworking this system under a new name for MV/MZ so stay tuned.
 

yoluko

Veteran
Veteran
Joined
Mar 9, 2020
Messages
46
Reaction score
9
First Language
English
Primarily Uses
RMMV
I can't get the customize price commands for buy or sell to work. Not sure what the item information is, and the examples given are inconsistent with each other. Still, copied the examples (with my own information) and nothing is working.
Here is the code I'm using:


KR.ShopManager.customizeItemBuyPrice([16,'random', 190, 300],[17, 'random', 25, 75],[18, 'random', 40, 150])

Also, why on earth is this causing my game to open a developer tools chrome extension whenever I start a new game? See image for what I mean.

1.png
 

id0

Veteran
Veteran
Joined
May 28, 2013
Messages
31
Reaction score
8
First Language
Russian
Primarily Uses
N/A
Hey, I just noticed that creating a stockable shop it won't matter if I have money or not, I will be able to buy the items anyway.
SOLUTION:

Find this string in script:

Scene_Shop.prototype.doBuy = function(number)etc...

Add this before it:
switch (this._commandWindow.currentSymbol()){ case 'buy': if($gameParty.gold() > (this._numberWindow.number() * this.buyingPrice())){ SoundManager.playShop(); this.doBuy(this._numberWindow.number()); } else{ SoundManager.playBuzzer(); } break; case 'sell': SoundManager.playShop(); this.doSell(this._numberWindow.number()); break; } this.endNumberInput(); this._goldWindow.refresh(); this._statusWindow.refresh(); };

Not testing mutch but it works. Hope it help someone.
 

Latest Threads

Latest Posts

Latest Profile Posts

Shoot.gif
Because The Fury from Metal Gear Solid 3 is one of my favorite bosses of all time, I felt the need to make a somewhat similar boss for my own game. taking cues from both the Fury and another awesome astronaut boss, Captain Vladimir from No More Heroes 2.
RE4make almost had me with their demo until I got to the dog stuck in a bear trap and realized that he was dead and could no longer be saved. Just not the kind of reimagining I'm interested in.
Here's some dudes that I'm drawing for Jimmy's Quest!
autredo.png
Autism Acceptance Month 2023!


Did this randomly in my free time, I guess today is a good day to show it.

Forum statistics

Threads
130,026
Messages
1,207,121
Members
171,290
Latest member
gypsycat
Top