Remove the "Sell" option from the shop menu completely?

Status
Not open for further replies.

MechScapeZH

Veteran
Veteran
Joined
Mar 23, 2019
Messages
485
Reaction score
578
First Language
English
Primarily Uses
RMMV
Hi everyone,

I've been working on making a shop menu (with mjshi's NPC Dialogue Shop enabled, if it matters- I don't believe it does since it just changes the layout, not the functionality, although I could definitely be wrong), and I noticed there is an option to make a "Purchase Only" shop- but all this does is grey out the Sell button, not remove it entirely.

Is there a way to accomplish this?

Thanks in advance for your help. :)
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
669
First Language
Portuguese - Br
Primarily Uses
RMMV
I don't know about the "mjshi's NPC Dialogue Shop", but according to the default mv code, you can try to add this plugin below all the shop plugins and see if works.
If not, put a link of this plugin from mjshi that you are using.
 

Attachments

MechScapeZH

Veteran
Veteran
Joined
Mar 23, 2019
Messages
485
Reaction score
578
First Language
English
Primarily Uses
RMMV
I don't know about the "mjshi's NPC Dialogue Shop", but according to the default mv code, you can try to add this plugin below all the shop plugins and see if works.
If not, put a link of this plugin from mjshi that you are using.
Thank you! I tried your plugin, and it worked fine without the plugin I'm using- unfortunately adding the plugin caused an error. According to the plugin's thread, it's just aesthetics being changed, but an error has occurred nonetheless- very odd.

Here's the error I received: 1583875563494.png
And the plugin's thread: https://forums.rpgmakerweb.com/index.php?threads/npc-dialogue-shop.101108/
But so you don't have to download that, here's the lines in question: 1583875639406.png
(the error points to #352.)

Thank you so much for your help!
 

Attachments

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
669
First Language
Portuguese - Br
Primarily Uses
RMMV
Ok!
If you want to it work like this, all the games, then you can use this.
It's not removed, I only change the selectable items enabled in the shop menu.

But if you want sometimes the sell works and sometimes not, then I have to dig the code a little bit, because I never mess with the shop code before ^^''

[EDIT] My bad, you have to change the code directly for it to work...
I will see if I can find a decent solution instead of a poor snippet...
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,915
Reaction score
1,300
First Language
English
Primarily Uses
RMMV
Try giving this plugin a try:
 

MechScapeZH

Veteran
Veteran
Joined
Mar 23, 2019
Messages
485
Reaction score
578
First Language
English
Primarily Uses
RMMV
Ok!
If you want to it work like this, all the games, then you can use this.
It's not removed, I only change the selectable items enabled in the shop menu.

But if you want sometimes the sell works and sometimes not, then I have to dig the code a little bit, because I never mess with the shop code before ^^''

[EDIT] My bad, you have to change the code directly for it to work...
I will see if I can find a decent solution instead of a poor snippet...
Ah, I see. Yes, I want to remove the Sell option completely- I never need to use it, so changing the code directly would work perfectly for me.

Thanks for your help!

Try giving this plugin a try:
Unfortunately, the plugin I'm using has a "Talk to shopkeeper" option, so skipping directly to the Buy menu isn't exactly what I'm looking for.

Thanks for your help anyway!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
669
First Language
Portuguese - Br
Primarily Uses
RMMV
Here!
Change the code directly:


JavaScript:
Window_ShopCommand.prototype.numVisibleRows = function() {
    return 1;
};

Window_ShopCommand.prototype.maxItems = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return 4;
    }
};

Window_ShopCommand.prototype.windowWidth = function() {
    return commandPos.width;
};

Window_ShopCommand.prototype.maxCols = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return this.maxItems();
    }
};

Window_ShopCommand.prototype.makeCommandList = function() {
    if(this._purchaseOnly){
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
    } else {
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
    }
};
Copy and paste this(overwrite) the code inside the plugin of Mjshi.
It is in the last lines.

These will remove the sell option when you mark "purchase only" when you open the shop.
 

MechScapeZH

Veteran
Veteran
Joined
Mar 23, 2019
Messages
485
Reaction score
578
First Language
English
Primarily Uses
RMMV
Here!
Change the code directly:


JavaScript:
Window_ShopCommand.prototype.numVisibleRows = function() {
    return 1;
};

Window_ShopCommand.prototype.maxItems = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return 4;
    }
};

Window_ShopCommand.prototype.windowWidth = function() {
    return commandPos.width;
};

Window_ShopCommand.prototype.maxCols = function() {
    if(this._purchaseOnly){
        return 3;
    }else{
        return this.maxItems();
    }
};

Window_ShopCommand.prototype.makeCommandList = function() {
    if(this._purchaseOnly){
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
    } else {
        this.addCommand(TextManager.buy,    'buy');
        this.addCommand(TextManager.sell,   'sell',   !this._purchaseOnly);
        this.addCommand(commonEventName,   'event');
        this.addCommand(TextManager.cancel, 'cancel');
    }
};
Copy and paste this(overwrite) the code inside the plugin of Mjshi.
It is in the last lines.

These will remove the sell option when you mark "purchase only" when you open the shop.
Perfect!!! That worked swimmingly! Thank you so, so much @Eliaquim - your name has been added to the credits of my game for your help!

Thanks again!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,633
Reaction score
13,223
First Language
English
Primarily Uses
RMMV
I would copy those functions into a plugin and modify those. Otherwise if there's an MV update and you update your project, you will lose any changes you made to the default scripts, and have to redo them - which requires remembering what those changes were, and searching for this thread again that shows you how to do them.

<edit - nvm - I thought that was a change to the default script, not to the plugin. You'll just have to remember to reapply them if you ever get a new version of the plugin>
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
669
First Language
Portuguese - Br
Primarily Uses
RMMV
@Shaz
That change was made in the Mjshi's plugin, not in the Core files of mv ^^
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,402
Reaction score
4,792
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Small rant: While using SRD Hud maker for a battle hud, I typed in the wrong script call and got an error, but then forgot to delete the piece that caused the error before closed the Hud maker and hit F5 to restart the game. Now everytime I engage in a battle my game crashes...
:kaolivid:
Would Jump into Javascript be best off continuing to break down the MV core files, or would people prefer a quick detour to cover everything that's changed in the core from MV to MZ?
Not going to lie... PIXI Particles make fantastic graphics... But predicting the hitbox of something with a "fixed size" but whose graphics can stick out past that, is quite challenging. :kaoswt:
Would you like a glass of spiders?

Forum statistics

Threads
100,530
Messages
976,896
Members
132,081
Latest member
Kaezyelnatz
Top