Shipping bin mechanic like Stardew Valley?

Hey all,
I had been making a farming simulator game inspired a lot by the likes of Stardew Valley and Harvest Moon but after considering how so many farming sim games are being pumped out, I wanted to kind of add another spin on it. I know it's been done before, but I want to add restaurant management elements to it. The difference is I don't want the player to have to go in and actually work in the restaurant taking orders, cooking food, etc because I want the player to not feel like they can't go out and explore the other elements of the game like relationship building with villagers, foraging, exploring the mines, etc.

So my idea is for the player to own and manage the restaurant, hire employees, purchase upgrades, discovering new recipes, and be in charge of stocking the ingredients (which is where the player makes money). So the player would be responsible for growing the crops that the restaurant serves, catching fish, and foraging for other ingredients used in the food. The more ingredients the player places in the fridge inside the restaurant, the more money the restaurant has the potential to make that day (the idea being that the restaurant is able to serve more food). Of course, the more restaurant upgrades and recipes the player owns, the more money they will make each day as well.

So my idea is that each of the ingredients the player places in the fridge has a base profit. At the end of each in-game day (my game uses a day cycle), the player will make money based on how many ingredients the player has put in the fridge during the day. I want the calculation on how much gold to give the player to also increase based on how many upgrades and recipes the player has unlocked so like each upgrade would add a different multiplier to the sum of the base cost of all ingredients placed in the fridge. I also want to add a random variable to that calculation (like a luck variable because maybe the restaurant has a bad night so less gold is made that day).

I think I would just need to do is add an "add gold" to the common event that starts the new day, but I'm not quite show how to set up the fridge concept where the player can add ingredients to the fridge and then the game takes what's in there and determines how much gold the player makes when the new day starts. Sort of like a selling items to the shop but the gold isn't added until after the new day common event starts.
basically variables

you reserve one variable for each item the player can give, and count that variable up for every same item given.

then in your dayly event you call another common event that calculates the gains with a lot of control variable commands for multiplying, adding and random effects.
Have an event that acts as the shipping bin with action trigger. Use a storage plugin like Waynee's one. Then write a script that loops through the array or object (whatever the plugin is using to store the storage item data) and adds that item price value to the total, then apply your multipliers to the total.


Thread 'PH - Warehouse/Storage Ported to MZ' https://forums.rpgmakerweb.com/index.php?threads/ph-warehouse-storage-ported-to-mz.149974/
Have an event that acts as the shipping bin with action trigger. Use a storage plugin like Waynee's one. Then write a script that loops through the array or object (whatever the plugin is using to store the storage item data) and adds that item price value to the total, then apply your multipliers to the total.


Thread 'PH - Warehouse/Storage Ported to MZ' https://forums.rpgmakerweb.com/index.php?threads/ph-warehouse-storage-ported-to-mz.149974/

That plugin looks perfect!

I would get stuck on how to run the script that checks how many of each object are in the storage at the end of the game day though because that's my weakest point of knowledge when it comes to using RPG Maker. Is that something that is pretty simple to do or would it require a decent amount of coding knowledge?
That plugin looks perfect!

I would get stuck on how to run the script that checks how many of each object are in the storage at the end of the game day though because that's my weakest point of knowledge when it comes to using RPG Maker. Is that something that is pretty simple to do or would it require a decent amount of coding knowledge?
It would be dependent on which storage plugin you use because it needs to work with the data structure the plugin uses and would require an intermediate level of Javascript knowledge
It would be dependent on which storage plugin you use because it needs to work with the data structure the plugin uses and would require an intermediate level of Javascript knowledge

The PH Warehouse one looks almost perfect for what I want. I think I’m coming to the conclusion that I should really put some effort into learning JavaScript because my ideas are going beyond what RPG Maker can do natively.
The PH Warehouse one looks almost perfect for what I want. I think I’m coming to the conclusion that I should really put some effort into learning JavaScript because my ideas are going beyond what RPG Maker can do natively.
I would ask in that plugin thread how to do it because it should be trivially easy for someone like Arthan
The PH Warehouse plugin gives a script call:

PHPlugins.PHWarehouse.prototype.hasItem("Title of the Warehouse", id); # Verifies if a warehouse has a particular item and returns the quantity of this item inside the warehouse

Everything else you should be able to do with just event commands, I think.
The PH Warehouse plugin gives a script call:

PHPlugins.PHWarehouse.prototype.hasItem("Title of the Warehouse", id); # Verifies if a warehouse has a particular item and returns the quantity of this item inside the warehouse

Everything else you should be able to do with just event commands, I think.

Perfect! Any idea how to store that into a variable? I've tried:

◆Control Variables:#0015 LettuceAmount = PHPlugins.PHWarehouse.prototype.hasItem("Ingredients", 75)

With item ID 75 being the item "Lettuce" and "Ingredients" being the name of my warehouse, but the variable 0015 doesn't change when I check it with Visustella's Debug plugin so I'm definitely doing something wrong.
that should be the correct way, unless there is a typo or a different problem with the event (like not being triggered).
Please give a screenshot of your event to check that

and:
variable 0015
The variable ID is 15, NEVER 0015.
The event command control variable handles the problem for you, but in script code you must never use leading zeroes for numbers, because leading zeros cause the computer to read the number octal instead of decimal (similar to 0x standing for hexadecimal numbers, like 0xFF for 256 decimal)

and 0015 octal is 13 decimal...
Perfect! Any idea how to store that into a variable? I've tried:

◆Control Variables:#0015 LettuceAmount = PHPlugins.PHWarehouse.prototype.hasItem("Ingredients", 75)
That's not correct syntax. That's the function definition in the code, you want to call the hasItem() method of an actual warehouse object in the game.

I haven't ever looked at that plugin, but I can tell you that won't work 😉
Having checked the original script calls list, it looks like you just need to remove "prototype" from the one you're using.
The variable ID is 15, NEVER 0015.
The event command control variable handles the problem for you, but in script code you must never use leading zeroes for numbers, because leading zeros cause the computer to read the number octal instead of decimal (similar to 0x standing for hexadecimal numbers, like 0xFF for 256 decimal)

and 0015 octal is 13 decimal...

I kind of assumed that was the case overall, but I wasn't entirely sure so thanks for clearing that up for me! I remember I tried it with both the leading 0's and without. Now I know I don't even have to bother with the leading 0's!

Having checked the original script calls list, it looks like you just need to remove "prototype" from the one you're using.

THANKS SO MUCH! That was all it was. Any idea why "prototype" was in the original script call? Was that a MV thing that changed in MZ or is it a placeholder for something that is understood to be removed whenever we see it for those that have a better understanding?
I kind of assumed that was the case overall, but I wasn't entirely sure so thanks for clearing that up for me! I remember I tried it with both the leading 0's and without. Now I know I don't even have to bother with the leading 0's!



THANKS SO MUCH! That was all it was. Any idea why "prototype" was in the original script call? Was that a MV thing that changed in MZ or is it a placeholder for something that is understood to be removed whenever we see it for those that have a better understanding?
I think rpgLord just got a little confused.

To put it as simply as I can, "prototype" is a property you can add to on a class that ensures that every instance of that class contains the property or function you're declaring. You don't need to worry about it outside of writing your own plugins, and a script call will (almost) never contain the prototype keyword because that's more part of the blueprint of a thing than it is the thing itself.

Original thread: https://forums.rpgmakerweb.com/threads/shipping-bin-mechanic-like-stardew-valley.162035/