Script for storage problem
RPG Maker MV Supportthose are 2 json files of data (commonEvents and Map002),
place them in a clean project. so you can see how the basic setup works.
so dont worry to much on max items.
you should however do the following:
create item 5 (I called it carrots) with the icon of the carrots. (text based on it).
create 4 variables:
variable 21 - Carrots (holding) (the one you have in inventory)
variable 22 - Carrots (store) (the amount stored in the chest for placing and taking out)
variable 23- carrots (action) (for the number input)
variable 24 - carrots MAX (amount to store or carry)
I use those numbers as 1-20 has different variables for my other testing purposes.
I have a backup common event,so I can compleet the other storage event.
I probably need to add another variable and/or use scriptcall to avoid nesting.
as this basicly checks the amount you have (max variable), and how much you
can add still/or draw (probably variable minimum) which can only draw up to 99
so storing and taking are both 2 digits if you want 99 to hold, but store up to 999.
which require another variable.
the base setup (instead of item -> to gold is a banking system, but when I know
more about reading arrays correctly, I might upgrade it with scriptcalls, as I think
advance JS knowledge can do it faster and cleaner as well =)
I dont know if you have this setup already or close.
will notify you once it's finished.
EDIT:
@Sakurra
I added another variable and some small changes.
if you downloaded the data.zip and a new project, download the common events
and replace it in the new project.
a new variable 24 = carrots MAX which I used for storing process and
for taking out process.
I got the comment there.
feel free to change to store (999) and take out (99) if you want that max
to hold.
it should do what you want (this is 1 item only), so duplicate the common event,
change the item to something else and max to store.
if you got any troubles later on, give me a sign and I see what I can do for you.
place them in a clean project. so you can see how the basic setup works.
you should however do the following:
create item 5 (I called it carrots) with the icon of the carrots. (text based on it).
create 4 variables:
variable 21 - Carrots (holding) (the one you have in inventory)
variable 22 - Carrots (store) (the amount stored in the chest for placing and taking out)
variable 23- carrots (action) (for the number input)
variable 24 - carrots MAX (amount to store or carry)
I use those numbers as 1-20 has different variables for my other testing purposes.
I have a backup common event,
I probably need to add another variable and/or use scriptcall to avoid nesting.
as this basicly checks the amount you have (max variable), and how much you
can add still/or draw (probably variable minimum) which can only draw up to 99
so storing and taking are both 2 digits if you want 99 to hold, but store up to 999.
which require another variable.
the base setup (instead of item -> to gold is a banking system, but when I know
more about reading arrays correctly, I might upgrade it with scriptcalls, as I think
advance JS knowledge can do it faster and cleaner as well =)
I dont know if you have this setup already or close.
will notify you once it's finished.
EDIT:
@Sakurra
I added another variable and some small changes.
if you downloaded the data.zip and a new project, download the common events
and replace it in the new project.
a new variable 24 = carrots MAX which I used for storing process and
for taking out process.
I got the comment there.
feel free to change to store (999) and take out (99) if you want that max
to hold.
it should do what you want (this is 1 item only), so duplicate the common event,
change the item to something else and max to store.
if you got any troubles later on, give me a sign and I see what I can do for you.
Original thread: https://forums.rpgmakerweb.com/threads/script-for-storage-problem.136223/