SceneManager.push(Scene_Shop);

Does anyone know a way to modify SceneManager.push(Scene_Shop); so that it calls a shop with the Sell button enabled?


I'm calling a shop with items that have randomized prices pulled from variables.


Current script


var goods = [
[0,18,1,$gameVariables.value(0033)],
[0,19,1,$gameVariables.value(0034)],
[0,20,1,$gameVariables.value(0035)],
[0,21,1,$gameVariables.value(0036)]];
SceneManager.push(Scene_Shop);
SceneManager.prepareNextScene(goods, true);



Edit: Figured it out, it was the default "true" from the tutorial I was following.


Double edit: Now I have the sell window, but the ability to sell items is greyed out?
The boolean value you are passing ('true') is enabling the 'purchase only' option within Scene_Shop. Set that to 'false' and you will be able to sell items, as well.
The boolean value you are passing ('true') is enabling the 'purchase only' option within Scene_Shop. Set that to 'false' and you will be able to sell items, as well.

Sorry, yeah, I got that. If you look at the edit in my post, you'll see I was following a tutorial and on a whim swapped it to False and it worked.


But now the sell screen comes up, and when I click on items, the option to sell them is greyed out and I get a buzzer noise?
Hmm ... not sure about that. When I use the code you supplied above (with the boolean set to false), I can sell items without an issue. Ah, you probably haven't set a price for the items you want to sell. If you don't set a price, then it will be grayed out on the sell page.
Hmm ... not sure about that. When I use the code you supplied above (with the boolean set to false), I can sell items without an issue. Ah, you probably haven't set a price for the items you want to sell. If you don't set a price, then it will be grayed out on the sell page.
Hmm ... not sure about that. When I use the code you supplied above (with the boolean set to false), I can sell items without an issue. Ah, you probably haven't set a price for the items you want to sell. If you don't set a price, then it will be grayed out on the sell page.



Ah okay, I was hoping it would pull the price from the variable as well. Can you think off-hand of a way to do that short of making a plug-in, or point me in the right direction?
The sell price is equal to half the buy price which is listed in the item/armor/weapon entry in the database. Do you not want to set a price there, or ... ?
The sell price is equal to half the buy price which is listed in the item/armor/weapon entry in the database. Do you not want to set a price there, or ... ?



See what I'm trying to do is randomize the prices on those items, but have them sell for those same randomized prices in the same store. I've raised the sell price to 100% of the database entry, but can't find a way to make it 100% of the variables 0033 through 0036. So for example the price on them could be anywhere from 16 to 32, and if it lands on 25, I want the sell price to also be 25, not a static 16 from the Database.
Basically is there any way to pull a sell price from a variable instead of the database?
Random each time you open the shop, or just random per game ... or ... ?
Per game, this is happening in a parallel process at the game initiation.
I created a quickie Shop Extras plugin which will do what you want.


Shop Extras


Just put <seBuyVar:variableId> or <seSellVar:variableId> in the note tag of the item. 'seBuyVar' is for setting the purchase price in a variable, and 'seSellVar' is for setting the sell price in a variable.
I created a quickie Shop Extras plugin which will do what you want.


Shop Extras


Just put <seBuyVar:variableId> or <seSellVar:variableId> in the note tag of the item. 'seBuyVar' is for setting the purchase price in a variable, and 'seSellVar' is for setting the sell price in a variable.



You're a life saver, thanks so much. I'll try and learn as much as I can from the source. 🙂
The plugin is pretty simple and straight forward. Meander through the source as well as the core code and I am sure you can learn a lot about how the shop functions!
The plugin is pretty simple and straight forward. Meander through the source as well as the core code and I am sure you can learn a lot about how the shop functions!



Okay, so I got around to trying out this solution today, but ran into some problems and can't figure out the right script or commands to use from your source, and I can't find the core code anymore because it's not where it was in VX Ace. Maybe it would be easier if I explain what I'm trying to do.


I'm creating a small demo of a text-RPG based around trade and being a merchant ship.


I'm planning 20 resources, for example, Food, Gold, Books, Glass.


5 cities that sell 12 of these resources each for a randomized price, and buy back for the same randomized price.


I'm storing the prices in variables 0001 through 0060 (12 per city, 5 cities).


This system ensures that you can buy, for example, Glass for 24g or sell it for 24g in one city.


But if you go to another city, it's price would be random again between 16 and 32, so maybe it's worth 30g there and you could sell it back at a profit.


The problem I'm running into with your script is that I can only set one price, so it would sell back for 24 in every city regardless of the buying price.


I need to be able to pull a selling price from more than one variable.
Hmm, well, how about this ... I have added another feature to the script which will allow you to set a buy or sell price on-the-fly with plugin commands. So, you can change any price you want in the event just before the shop scene loads up.


Shop Extras 1.1


For instance, if you want to set the buy price of an item with an ID of 3 to variable 7 :


exaSE.adjustBuyPrice item 3 var 7


Or a weapon with the ID of 11 to variable 15 :


exaSE.adjustBuyPrice weapon 11 var 15


Or an armor with the ID of 5 to variable 9 :


exaSE.adjustBuyPrice armor 5 var 9


You can also set a static value :


exaSE.adjustBuyPrice item 1 set 9999


Setting a sell value is just as easy :


exaSE.adjustSellPrice item 3 var 8
Hmm, well, how about this ... I have added another feature to the script which will allow you to set a buy or sell price on-the-fly with plugin commands. So, you can change any price you want in the event just before the shop scene loads up.


Shop Extras 1.1


For instance, if you want to set the buy price of an item with an ID of 3 to variable 7 :


exaSE.adjustBuyPrice item 3 var 7


Or a weapon with the ID of 11 to variable 15 :


exaSE.adjustBuyPrice weapon 11 var 15


Or an armor with the ID of 5 to variable 9 :


exaSE.adjustBuyPrice armor 5 var 9


You can also set a static value :


exaSE.adjustBuyPrice item 1 set 9999


Setting a sell value is just as easy :


exaSE.adjustSellPrice item 3 var 8



Yeah dude, that's exactly what I needed. Thanks so much a second time. haha
Been bug-testing Hydra's plug-in today and he's come up with two or three fixes and improvements, the new download link is here in case anyone is interested: ShopExtras 1.2
Hey the link has expired and I have this exact problem... any ideas?

Original thread: https://forums.rpgmakerweb.com/threads/scenemanager-push-scene_shop.65882/