SceneManager.push(Scene_Shop);

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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?
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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.
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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.
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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 ... ?
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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.
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
Basically is there any way to pull a sell price from a variable instead of the database?
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Random each time you open the shop, or just random per game ... or ... ?
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
Per game, this is happening in a parallel process at the game initiation.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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.
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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. :)
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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!
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
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
 
Last edited by a moderator:

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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
 

Sketchward

Veteran
Veteran
Joined
Jul 26, 2016
Messages
111
Reaction score
8
First Language
English
Primarily Uses
RMMV
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
 

dwiseman57

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
40
Reaction score
1
First Language
English
Primarily Uses
N/A
Hey the link has expired and I have this exact problem... any ideas?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top