that code actually has an error at line 1 which makes the game disable it during runtime, so the code doesn't even execute.
I'm trying to make it work, I already have a version which does run the code when you get items but somehow the eval doesn't want to evaluate $gameVariables(blahblah)..
I've been messing with this idea and I can get items limited with a variable, but it limits ALL items to this max value
What's your code? maybe we can implement that idea into the per item basis if I can see it
🙂
here try this code
var oldMaxItems = Game_Party.prototype.maxItems;
Game_Party.prototype.maxItems = function(item) {
var max = oldMaxItems(item)
if (item.note.match(/<(?:MAX ITEM):[ ](\d+)>/i)) {
return eval(RegExp.$1);}
else {
return max;}
};
your notetag should be
<MAX ITEM:$gameVariables.value(x)>
x being the index of the variable you want it to base on
or you can also try this one (try the above one first)
Spoiler
var oldMaxItems = Game_Party.prototype.maxItems;
Game_Party.prototype.maxItems = function(item) {
var max = oldMaxItems(item)
if (item.meta.itemmax) {
return eval(item.meta.itemmax);}
else {
return max;}
};
but your notetag should be
<itemmax:$gameVariables.value(x)>
x being the index of the variable you want it to base on