Event Based Crafting -Multi Items - Can it be done?

Hey lovely beings, I am stuck trying to code my crafting system, as I am not sure how to correctly get MV to calculate item to item ratios to come up with a possible outcome response. What I mean as a direct example of this is say, making matches takes
  • 1 Stick
  • 1 Coal (or Charcoal)
Now, most items are easier to program like rope as another brief example, I have it set to Three (3 ) pieces of string, which was easy to calculate the possible outcomes.

Var 1: ItemCount String : Set to number of string
Var 2: CraftPoss Rope = ItemCountString
Var 2: CraftPoss Rope /3

Now I can use this data to call in text via message or choices:

Choices :001 : Rope \v[2], 002: Matches \v[x], etc.
- and even from there of course add my icons or more/less text etc.

BUT -

I am struggling with exhibit A - which is not such an easy equation. I have tested many ways I could even compromise with it yet, I m unhappy with such compromise compared to such exact data being available like exhibit B.


I have been trying to dabble with MOD , Dividing, and adding, setting. Its all driven me to madness at this point. I want it to also make 3 Matches at once, and still deciding if I will be adding that next to text, or to the variable itself. ex Matches x3 \i[x] \v[x], or else multiply the final variable again by 3.

I hope I am getting this out correctly, I hve been looking everywhere for any insight or clues to a solution, been brainstorming plenty math, experimenting in draft events in a prototype file where i do all my testing, and still have not figured out a way to properly calculate how to set my CraftPoss Match variable to the correct number using item counting.

The result i am looking to get:

Id like it to calculate effectively the ratio of sticks to coal (ill repeat process for charcoal with some variations if I can just get this part fixed lol), and then ensure that for each stick, there is a piece of coal (or charcoal ), and present accurate variables for how many times matches can be crafted based on inventory count. Is this possible, is there way to do this ? I couldnt quite find a plugin I liked so im trying to build my own crafting system from scratch and this detail has me stumped. I would love any help or insight anyone has to offer!

I feel the code is pretty stripped down to as simple as it can be however I am openly willing to work with complex operations that require attention to detail, I am just trying to work out core functions of the game Ive been working on. Thank you so very much! I appreciate you and all your help and advice you have come to openly share, much love!

-Skelle xox
you can do the easy way, advanced way and complex way.

the basic and the easy way is to make a choice or npc to craft
the item for you IF you have the items.

for all 3 purpose, if you want to use a table to place ingredients,
and the amount in order to craft, I would recommend to use
mjshi [ConditionalBranch+] to make the checkings easiers.

also require a common event 1 or 2 to call, and to execute it.
while there are many ways to set up this scene, you can make
a new map for the crafting part, same map for crafting or through
the NPC crafting that ask which items and the amount.

it depends on the amount of ingredient PER recipe, 2, 3 or 4 or more,
and the amount of items that can be crafted.

because switches comes to play for each recipe if you want to
check which recipe is active that you want to craft.

do you want to fail if they place to low items, do the items return or
wasted?

there comes more to it if you want to event the crafting system,
but I have a way in mind for the using pure variables alone.

each recipe ingredient into a variable and when placing it,
you check the variable ID's if they are equal to the items.

if V[1] = 3, if v[5] = 1 and v[6] = 2 (this checks the number in a new
variable, 356 (on the chosen variable), if it is, it is crafted.
but there are different methodes as well, depending how you want to
make it and how to look (pictures, animation of combining etc),
or a gauge (Galv_VariableBar) to load it to see if it succeeded or not.

I have a very basic version on my own, and a bit broken because
of extending it.

it really depends on items, amount of recipes, and and how it looks
when crafting.

for 3-4 recipes its doable, but if you have a huge list, a plugin is better
for it, which can be combined, because there are a few very easy to use
crafting plugins.

Original thread: https://forums.rpgmakerweb.com/threads/event-based-crafting-multi-items-can-it-be-done.142355/