JS Items Max

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
Introduction


Allows you to change the maximum amount of items, armors or weapons


Features


- Set the maximum amount of item/armor/weapon to a static number or a valid JS code


- Allows the setting of individual maximum amount of each item/armor/weapon via notetags


Sample Usage


- Make the maximum amount of item you can carry increase as the game progresses


How-to-Use


-Open the link below


-Copy the contents into notepad etc


-Save it as JSItemMax.js using file type "Any"


-Import into your project


-Check the in-plugin help


-Check/Modify the parameters


-Start notetagging


Download


Get it here on pastebin


For those having some problem setting up, you can check the demo file and get the working JS file in this post:
 
Last edited:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
if i load your script, there wont apear parameters or anything =(
And it dont work, if i change the variable. Mabye a format mistake or something?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
if i load your script, there wont apear parameters or anything =(


I rechecked the uploaded file and it is the same one that I am using right now on my MV test project. It should have 1 parameter.


The only plugin parameter this script has is the general item max.. 

And it dont work, if i change the variable.


By default, the plugin doesn't use any variable. If you want the max items to make use of a variable you need to set it either to the general item max parameter or via the notetags on the items that you want to use the variable as a max.


Can you show me you plugin setup?


Also, if you have Yanfly's core and/or his Item Extension plugins, please make sure this plugin is below Yanfly's scripts. If you put this above Yanfly's it wont work because Yanfly's core overwrites the function that I use.
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
The problem is that there is nothing in the parameter, if i download it :D

Here:
 

Unbenannt.PNG
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
That's weird... It shows fine on my MV project, I also checked the plugins of other people to see if there were differences in the way I wrote the parameters and I didn't notice any differences.. can you show a screenshot of the actual contents of the js file that you have? 
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
Its the normal copy of your link.


If i click on "get" at pastebin
could be the name play a role? If i download it the script calls: jsitemmax.js.js
 

Code:
/*:

 * @plugindesc Allows you to set the max number of each item/armor/weapon using numbers or JS codes. Click help for HowToUse
 * @author Adiktuzmiko

 *@help To use just add this notetag to your items:
 <maxItems:value>
 value being any static number or a valid JS code

 Example:

 <maxItems:5> -> Sets that item to have a maximum amount of 5
 <maxItems:$gameVariables.value(1)> -> Sets the item to have a maximum amount
 equal to whatever the current value of Game Variable 001 is

 Note: It is important that the file name of this plugin is JSItemMax.js

 @param General Item Max
 * @desc The general maximum amount for each item; you can use either a number or a valid JS code here
 * @default 99

*/

var JSItemMax = {};
JSItemMax.params = PluginManager.parameters('JSItemMax');
JSItemMax.generalItemMax = JSItemMax.params["General Item Max"];

Game_Party.prototype.maxItems = function(item) {
  if (item.meta.maxItems) {
    return eval(item.meta.maxItems);
  } else {
      return eval(JSItemMax.generalItemMax);
      }

};
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
A wrong name will only cause problems for the calling of the parameters (probably cause an error in-game), but even if the name is wrong, you should still be able to see the parameters and the help text in the Plugins manager..


Seems like ur not missing anything in the file, so I don't know why the parameters and even the help text doesn't even show in your editor. I even rechecked some other people's plugins for how their description and params lists were setup and it's the same as mine so I really have no idea why your plugin manager isn't showing the texts and parameters that should have been there.


Anyway, I tried a minor change to it, can you retry the new file?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
I tried it in that demo, and it worked for me... I don't know why it's not working on yours...


Here's a screenshot of how it looks on the Demo file you linked:

DEMO.PNG



And here's the demo file with the plugin setup: View attachment DemoJSMAX.zip


The event on the left gives you four choices, 1-4, this corresponds to items 1-4 in the database. In the setup of the demo, Item 1 should never be in your inventory since it uses Game Variables 3 as it's max value which by default is 0. Item 2 should be at maximum of 5 since I set it to 5, items 3-4 should allow you to have 99 of each.


If the demo doesn't work on your computer, then the problem most probably lies with your computer, in which case I don't have any idea how to fix that.


Just a side note: I've tested the plugin in both 1.3.3 and 1.3.4 and it works fine on both from my tests, both using the demo file and a project I have lying in my comp that I use for testings.
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
Sorry for the delay.


Now it works. I copied the plugin and it runs great! Awesome!

Something with the download seems not working... Hmm but now its great :) Thanks
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
Okay... I wonder if anyone also has problems with the download.. I used the copy I had lying in my hard drive for that demo. or maybe it wasn't saved as an actual .js or something? Like maybe it was actually downloaded with seemingly .js extension but actually was saved as .txt (if extensions are disabled the file in the folder will have .js in it's filename, and .js.txt if enabled)


I guess it will be safer for people to just copy paste the raw code, then save it themselves on this case.
 
Last edited by a moderator:

fallenlorelei

Veteran
Veteran
Joined
Jul 8, 2013
Messages
295
Reaction score
336
First Language
English
Primarily Uses
Hi @Engr. Adiktuzmiko , would you know how to make this compatible with Yanfly's Shop Menu Core? I'm loving the variable max items and need it for the game I'm working on, and everything was going very well until I opened up the shop. I can disable Yanfly's Shop Menu Core and it works fine. (I also added the Shop plugin into your demo project, and it crashes the demo). Problem is I need the Shop Core in order for More Currencies to work, and it's difficult having to choose between variable max items, or that, lol! I figured I'd ask if you knew a way to make them compatible before giving up completely.

Thank you!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,670
Reaction score
2,992
First Language
Tagalog
Primarily Uses
Hi @Engr. Adiktuzmiko , would you know how to make this compatible with Yanfly's Shop Menu Core? I'm loving the variable max items and need it for the game I'm working on, and everything was going very well until I opened up the shop. I can disable Yanfly's Shop Menu Core and it works fine. (I also added the Shop plugin into your demo project, and it crashes the demo). Problem is I need the Shop Core in order for More Currencies to work, and it's difficult having to choose between variable max items, or that, lol! I figured I'd ask if you knew a way to make them compatible before giving up completely.

Thank you!

Sorry for the late reply, I'm not able to go here that much right now.. Anyway, seems like Maliki found a working fix for you in the other thread. I Ian't do much compatibility fixes right now too, sorry.

Edit: I've updated the JS file with Maliki79's fix which I believe should be included as it also serves as a safeguard if anyone tries to call the item max function and passes a non item to it.
 
Last edited:

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

Latest Threads

Latest Profile Posts

40 card deck size, the plugin seems more sluggish.
Village theme I composed for a commission!
Stream will be live shortly with some Haunting Ground! Feel free to drop by!
welp, the stock market went down by 7% because of corona today. Time to buy stocks?

Forum statistics

Threads
94,563
Messages
921,921
Members
124,429
Latest member
sheepman
Top