I have made a script for my Monster Hunter RPG.
I thought I would share it in case someone wanted it or wanted to review/give feed back to me.
So this Plugin allows you to set the maximum number of a certain item you can have in your inventory.
The note tags for each item are: <maxAmount:5>
Where the number is the maximum amount you can have in your inventory.
The plugin command is : ChangeMaxItemAmount 1 5
No commas just spaces between the numbers, first number is the item number, second number is the new maximum you can have.
I have no clue if this script has been made or is included in someone elses this was mainly a learn script so I can figure out note tags and plugin commands.
Credit: Snow
I thought I would share it in case someone wanted it or wanted to review/give feed back to me.
So this Plugin allows you to set the maximum number of a certain item you can have in your inventory.
The note tags for each item are: <maxAmount:5>
Where the number is the maximum amount you can have in your inventory.
The plugin command is : ChangeMaxItemAmount 1 5
No commas just spaces between the numbers, first number is the item number, second number is the new maximum you can have.
/*: * @plugindesc Sets the maximum amout per item you can have. * @author Jeremy Cannady * * @param defaultMax * @desc Default max item amount. * @default 99 * * @help In the notes section please put <maxAmount:5> if you dont want the item to have the default value * In the plugin commands please put : ChangeMaxItemAmount 1 5 , first number is item number, second is new max **/var parameters = PluginManager.parameters('MaxItemInInventory');var defaultMax = Number(parameters['defaultMax']);var copyOfInitialize = Game_Party.prototype.initialize;Game_Party.prototype.initialize = function() { copyOfInitialize.call(this); this.populateItemArray();};Game_Party.prototype.populateItemArray = function() { var lengthOfItemList = $dataItems.length; this._maxItemArray=[null]; for(var i = 1; i < lengthOfItemList; i++){ if(typeof $dataItems.meta.maxAmount !== "undefined"){ this._maxItemArray.push(parseInt($dataItems.meta.maxAmount)) } else{ this._maxItemArray.push(defaultMax); }; };};Game_Party.prototype.changeItemMax = function(itemNumber, newMax) { this._maxItemArray[itemNumber] = newMax;};var copyOfGainItem = Game_Party.prototype.gainItem;Game_Party.prototype.gainItem = function(item, amount, includeEquip) { var lastNumber = this.numItems(item); var newNumber = lastNumber + amount; var maxNumber = $gameParty._maxItemArray[item.id] if(newNumber > maxNumber){ amount = 0; }; copyOfGainItem.call(this,item, amount, includeEquip)};var maxItemInInventory_pluginCommand = Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand = function(command, args) { maxItemInInventory_pluginCommand.call(this, command, args); if (command === "ChangeMaxItemAmount") { $gameParty.changeItemMax(JSON.parse(args[0]), JSON.parse(args[1])); };};//Credit: Snow
I have no clue if this script has been made or is included in someone elses this was mainly a learn script so I can figure out note tags and plugin commands.
Credit: Snow