Yanfly's YEP_CoreEngine. Display "Current/Max" item in both Shop (Buy/Sell) and Inventory Menus (RMMV)

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
So I'm using a function in YEP_CoreEngine that allows you to limit the amount of specific items that you can carry (<Max Item: x>), and I like this function a lot as it prevents spamming items or hoarding them. The problem is, it does not display the limit of how much of a specific item that you can carry, and I cannot figure out how to reprogram so that is does display it. It'll be bad game design if the player does not know the max amount of a specific item that can be carried and could cause unnecessary frustration when playing my game.

And before anyone asks. Yes, I did look it up and found this thread, I tried the solution shown in it and it did not work (While using the script that specific solution was made for). If it did, I would not be posting this.

Here's how I want it done. Let's say you go to a shop to buy an item, be it a regular item, weapon, armor, etc., and the shop tells you how much of this item you have and how much of this item you can carry up to. For Example, let's say I programmed the limit on my health potions to be so that the player can only have up to 10 health potions at any given moment, so if I go to a shop to and want to buy health potions, I should see something like this.

Health Potion $10 4/10 (Where "4" is the current amount of health potions I have and "10" is the max amount I can carry). Same thing should appear when I sell too so that the player can calculate how much of an item they should keep and how much they should sell.

The same thing would also show up when I go to look at inventory through the menu screen. Like this.

Health Potion 4/10

That is all I want, and I'll be eternally grateful to anyone who can help me with this.

EDIT: Just realized that other thread I posted that had a similar problem was related to something done in VX Ace and not MV, my mistake.
 
Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,430
Reaction score
4,486
First Language
English
Primarily Uses
RMMV

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
@Shaz Excuse me, since you solved a similar problem a while back for a VX Ace user, maybe you help me on this one, please?
 

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV

SirDhyne

Villager
Member
Joined
Jun 21, 2020
Messages
17
Reaction score
0
First Language
English
Primarily Uses
RMMV
Adding my own interest in a solution to this problem, as I am also looking to do something similar in my own game.

For additional detail, you've already got the max items working, correct? As in, you're already at the point where the player cannot get more than 10 items, you're just looking to display this to the player?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,379
Reaction score
1,558
First Language
English
Primarily Uses
RMMV
Do you want to know what to edit into the original plugin to achieve this, or would you prefer a standalone patch plugin that will modify the shop windows?
 

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
Adding my own interest in a solution to this problem, as I am also looking to do something similar in my own game.

For additional detail, you've already got the max items working, correct? As in, you're already at the point where the player cannot get more than 10 items, you're just looking to display this to the player?
Yes, that's correct. I got the max items working, that part is extremely simple. Yanfly's Core_Engine allows you to do that by putting <Max Item: X> in an object's notetag to add a limit to it.

What it doesn't do is display the max amount the player can hold of that item. For example.

Instead of.

Health Potion x4

I want.

Health Potion x4/10.

4 is the current stack, 10 is the max stack.

That thread I linked above was on the same subject but done in VX Ace, I'm looking to do the same thing but in MV.
 
Last edited:

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
Do you want to know what to edit into the original plugin to achieve this, or would you prefer a standalone patch plugin that will modify the shop windows?
Either one would do.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,379
Reaction score
1,558
First Language
English
Primarily Uses
RMMV
Either one would do.
The quickest way to do it:

In YEP_CoreEngine.js, look up Window_ItemList.prototype.drawItemNumber and change the second-last line to

Code:
this.drawText('\u00d7' + numItems + "/" + item.maxItem, x, y, width, 'right');
Then in the default rpg_windows.js, look up Window_ShopStatus.prototype.drawPossession and change the last line to

Code:
this.drawText($gameParty.numItems(this._item) + "/" + this._item.maxItem, x, y, width, 'right');
(note that this assumes you have no other plugins that affect these functions; if you do, you'll have to edit the code in those instead)
 

Sir Anima

Handsome Encyclopedia of Awkwardness
Member
Joined
Mar 28, 2017
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
The quickest way to do it:

In YEP_CoreEngine.js, look up Window_ItemList.prototype.drawItemNumber and change the second-last line to

Code:
this.drawText('\u00d7' + numItems + "/" + item.maxItem, x, y, width, 'right');
Then in the default rpg_windows.js, look up Window_ShopStatus.prototype.drawPossession and change the last line to

Code:
this.drawText($gameParty.numItems(this._item) + "/" + this._item.maxItem, x, y, width, 'right');
(note that this assumes you have no other plugins that affect these functions; if you do, you'll have to edit the code in those instead)
HAHAHA YES!!! Thank you!!! Works like a Charm! You get a free copy of my game (Whenever I'm done with it).
 

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

Latest Threads

Latest Profile Posts

I didn't think I'd spend the evening jamming out to the battle theme of a Hole Punch.
Welcome back to the dark era, where everything is in dark mode!
.
.
.
I'm not complaining! :o
Currently without internet due to storm damage and most of our state is devastated. No idea how long I'll be unable to log onto here, but I'll answer questions as soon as I can.
This is supposed to be pso2 photon blast inspired animation
I'm sure this question's been asked before, but I can't find an answer: is there any way to run the Steam version of RPGMaker *without* being logged into Steam? It's a frustrating extra step sometimes.

Forum statistics

Threads
100,716
Messages
978,719
Members
132,336
Latest member
shorp_
Top