Yanfly Item Core - Obtain Remaining Space

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
This is the script I'm referring to:


yanfly.moe/2015/10/16/yep-11-item-core/

I simply would like to know if there is a script call to obtain the amount of remaining space for the item inventory.


Example:


I set the item limit to 5. I have a Potion, Feather and Rock. The remaining space should be 2.
I want a script call that can evaluate that value to be 2.

I am aware I can total my inventory space and deduct from the limit myself:


  ◆Control Variables:#0029 Inventory Count = var totalInven = 0; for (i=1; i<135;i++) {totalInven += $gameParty.numItems($dataItems);}



But my items actually stack (or are obtained in stacks). So the above example can be: a Potion (x5), a Feather (x3) and a Rock (x10) [All independent items].
I think the loop counting method I have above would count that up to 18 total items (instead of 3) ~ whereas Yanfly's counts it up as a total of 3. So I am hoping there may be a way to deduct that 3 from the limit of 5 and get 2 (under Yanfly's coding).
 
Last edited by a moderator:

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Well I have the start to a work around without involving Yanfly's script...
 


◆Script:var count = 0;
: :
: :for (i=1; i<135;i++) {
: :if ($gameParty.hasItem($dataItems)) {
: :count+=1;
: :}
: :}
: :
: :$gameVariables.setValue(50, count);


This way it ignores the stacked extras. I just have to figure out a way to visually show the limit and/or remaining space in the item menu.
Still open to script calls for yanfly's script though! 
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top