I'm testing an idea I had for an item storage system. (I know they are a lot of work, I haven't fully committed to this idea yet lol)
So far it's working but I've run into one problem. If the player has 90 cookies and over 100 in storage, how do I withdraw only 9 cookies?
Same in reverse. If I decide the player can only store 999 cookies, how do I deposit cookies and stop at 999? The player loses cookies in the process.
I figure this is maybe script related.
Thanks for reading.
Withdraw:
Set variable A to the number of cookies the player could possibly hold (99).
Subtract from variable A the number of cookies the player is actually holding (90).
Leaves you with 9 - the number of cookies the player can take from storage.
Set variable B to the number of cookies IN storage.
If A is less than B, then the player can take A cookies (9).
If B is less than A, then the player can take B cookies.
Deposit:
Set variable A to the number of cookies that can be stored (999).
Subtract from variable A the number of cookies that are actually in storage.
Set variable B to the number of cookies the player currently has.
If A is less than B, then the player can put A cookies into storage.
If B is less than A, then the player can put B cookies into storage.
In both cases, it's all done with Control Variables and Conditional Branches.
I assumed "cookies" just referred to an item in the game, not the internet-type cookies you get from browsers.
Just to confirm - are you doing this all via eventing, or are you using an item storage plugin? If you're using a plugin, my suggestion will still be close, but you'll need to do something slightly different to get the number currently in storage and the maximum storage capacity.
What is {99max var A}? Did you actually put that into the script box? That is not Javascript syntax so will not work.
You would need to do it via variables as I showed you anyway, because you will have to add a variable number of cookies to the player's inventory, and deduct the same variable number of cookies from storage, so it's going to take 2 commands.
Can you post a screenshot of your event?
I think I understand the concept but I'm having trouble wrapping my brain around how it is actually done.
Also is there an easier way to get screenshots from Rpg Maker MV?
Thank you for taking a look.
Apparently you can select the event commands and right-click, and there is a copy to text option. Then you can just come here and paste.
It's a bit hard to tell what your variables are, and whether you're using the same variable in multiple places. Would you like to zip up your Map###.json file and your System.json file and send them to me? That will let me look at the event and the variables. If you like (and it would be easier for me) you can create a brand new map and just copy this event onto it.
I could try to get a round of this, as number input goes mostly below
the variable MAX in inventory, than check storage.
I wonder why you dont use a plugin (waynee) which has a nice one.
if you have max item to hold = 99, you cannot withdraw more than
that.
if you want pure eventing, how many items do you have to place in
the storage?
I might have something like that, if I can find it still , as I cleaned alot
from desktop, and folders, so I might have it for use, maybe it require
adjustment, depending on the items, unless it's something to place
to trigger something?
limit can be anything, might require some variables, I see if I can find
it if I have it, else I try to replicate a simple setup for you 🙂
if scriptcalls are oke too, it can make things a bit easier too.
(unless someone else created it before me), as I know there are
many methodes to accomplish it.
Edit:
I got a basic bank system left, but lost the storage one.
as those are basicly the same, max items is different.
but it is like shaz said.
I see if I can fiddle something for you.
I make it a bit different, for now, it only store and take out items.
(no limit yet), I will impliment shaz idea inside as well if this works
correctly.
you can take a look at the basic setup if you like, I send later the rest.
this has no scriptcall for simplicity, otherwise, you can store all
items in a variable array.
I just dont know how to max those out yet, as low knowledge of JS.
so it can be better system for x items.
the way I set up, require basic 3 variables, so + 2 for each item,
than duplicate each common event into a choice (cookies, apples, carrots,
milk, eggs etc), so each items use 5 variables (if you can spare them).
I got the basic done, and works, I impliment the max items tomorrow around
for you.
send it here (2 files), map002 and common events which you can place
in a clean project. to check out the event setup.