Changing selling price

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,902
Reaction score
802
First Language
French
I'd like it to be divided by 3 instead of 2.

I'm using Yanfly ShopMenuCore but all I've seen there is a <Sell Price: x> specific to each item, not a formula for all of them at the same time. Maybe I'm not looking at the right place?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,221
Reaction score
13,752
First Language
English
Primarily Uses
RMVXA
I am not 100% sure where it is in MV, but in ACE I found a command called selling_price in the code, and the entire code for that command is:

@item.price / 2

I imagine it will be in a similar spot in MV. Check to see if you have a Scene_shop code or something similar.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,902
Reaction score
802
First Language
French
In which *.js I would find it, any idea?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,221
Reaction score
13,752
First Language
English
Primarily Uses
RMVXA
I found it in rpg_scenes.js. I had to then use notepads search function and it came up with this command near the very end of the code on that .js file:

Scene_Shop.prototype.sellingPrice = function() {
return Math.floor(this._item.price / 2);
};

A switch of 2 to 3 should work. Though I'd recommend making it a small plug-in instead, sadly what I know about doing that is nil for MV. Maybe one of our coders can show how to do it as a small plug-in if desired?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
214
Reaction score
163
First Language
French
Primarily Uses
RMMV
Hello! The function @bgillisp found is the right one!
Just copy-paste it in scene_shop section of YEP_ShopMenuCore and change the function as you like.
 

jkweath

Goes Fast
Veteran
Joined
Sep 21, 2016
Messages
314
Reaction score
495
First Language
English
Primarily Uses
RMMV
I actually made this exact change to Roguelite 2 and can confirm that what @bgillisp suggests works. Like he said, though, put it in a different plugin in case you ever end up updating your base JS files.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
853
Reaction score
361
First Language
Javascript
Primarily Uses
RMMV
I'd like it to be divided by 3 instead of 2.
Maybe one of our coders can show how to do it as a small plug-in if desired?
Yep Yep sure sure no prob. Done and done ;)
1590420885200.png
Use that plugin to set a variable that will control the amount of division. ;)

1590419599666.png

1590420003649.png
Place the plugin at below Yanfly's and any other shop plugins :)

Edit v0.20:
Added a new parameter for "Custom Code" which overwrites the function if custom code is used.
1590420631135.png
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't mind me, just installing a fog machine. :LZSwink:


I can't stop looping this BGM while at work since I began to play PSO2. It just too good for mood booster.
How to post a picture there in the status feed?
So I was at the grocery store trying to reach for some small garbage bags on the top shelf way in the back. Instead of going all the way downstairs to find someone to help me I grabbed a broom and pulled it down. Putting the broom back I said, "Thank you for your service".
S.O.S.--10:16pm......two toddlers still awake....send help...

Forum statistics

Threads
100,423
Messages
975,701
Members
132,080
Latest member
Garycomehome
Top