Need help eventing a potion crafting system

I'm making a game about a wizard's apprentice learning the ins and outs of magic, including potion-making. Sure, there's plenty of crafting systems, but they don't match the vibe I want to go for. Instead of 'oh, I want to make a Potion of Minor Healing so I need a Wheat and a Rat Tail', I want it to be more about experimenting and remembering recipes, a la Elder Scrolls.

My current idea is that there are categories of point values that each potion ingredient can have, each adding points to certain categories while some will also decrease points of another category. When you start making a potion, you have a list of all the potion ingredients you have on you and information on how they affect a potion's points. (Example: Basilisk Spit +5 Caustic, -4 Viscosity; Ogre Blood +3 Viscosity +3 Pungent -7 Clarity). You can keep adding ingredients to adjust these point values as much as you want.

The results of a potionbrewing session is dependent on the point values of the potion once you finalize the potion. For example, a Potion of Minor Healing needs at least 8 Clarity and between 1 to 5 Viscosity, or a Potion of Fire Immunity requires you to make a potion with 10 or more Pungent and an equal amount of Viscosity.

I think this system is pretty solid...I just don't have a clue as to how to implement such an intricate system. If anyone would be willing to take a crack at this, I would be extremely grateful.
Couldn't you just use variables and common events?
Couldn't you just use variables and common events?
Yeah, but I don't know how I'd go about setting up the menu or displaying what ingredients the player has access to
The simplest way is to loop select item and ask "brew?". When you select the item it changes your potion variables and subtracts item. If you select "brew" the loop breaks and you (possibly) gain an item. You can use plugins to filter the shown items to ingredients, show info on select and show total viscosity etc values on screen. Then when you select brew, you have to create a long list of conditionals for your different potions with 'if/and/else if'.

That works, but it won't look pretty, LOL.
If anyone would be willing to take a crack at this, I would be extremely grateful.
I don't think you're going to get very far asking other people to completely write an event for you; especially not one that you admit is complex.

You're much more likely to get useful responses if you try to make the system for your game, then post that event here describing which part you don't know how to do, or what doesn't work correctly.
The simplest way is to loop select item and ask "brew?". When you select the item it changes your potion variables and subtracts item. If you select "brew" the loop breaks and you (possibly) gain an item. You can use plugins to filter the shown items to ingredients, show info on select and show total viscosity etc values on screen. Then when you select brew, you have to create a long list of conditionals for your different potions with 'if/and/else if'.

That works, but it won't look pretty, LOL.
Hey if it works, it works. I'll try to kludge a prototype together for more experienced scripters to critique. What plugins would you recommend for filtering items?
If you google "Caethyril's MZ Plugins", there's a SelectItemFilter plugin.

Eli Help Windows MZ can show help windows for item select (ingredient properties).

The mixture property values can be shown with the "TextPicture" plugin that is inside every project (or with other plugins).
This is one of these "help me make an entire system" questions that would be better broken down step by step. It's probably doable with existing crafting plugins, although you may need to either add components from the engine side or tweak parts of the code in the plugin file.
Update: Haven't started making the part of the script that determines the result of a potion brewing attempt, hence the 'POTION RESULT' placeholder. My scripting is probably sloppy as hell , but it seems to be working.


Code:
◆Text:None, None, Window, Bottom
:    :Attempt to make a potion?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
  ◆Label:StartBrewing
  ◆Plugin Command:Cae_SelectItemFilter, Select Filter
  :              :Values = ["reagent"]
  :              :Action = Set
  ◆Label:PickIngredient
  ◆Select Item:reagentvar, Regular Item
  ◆Loop
    ◆If:reagentvar = 33
      ◆Change Items:Frostfire Orchid - 1
      ◆Control Variables:#0002 caustic += 2
      ◆Control Variables:#0003 viscous -= 1
      ◆Control Variables:#0006 shimmer += 3
      ◆
    :End
    ◆If:reagentvar = 34
      ◆Change Items:Dragonscale Mushroom - 1
      ◆Control Variables:#0005 pungent += 3
      ◆Control Variables:#0007 effervescent -= 2
      ◆Control Variables:#0004 clarity += 1
      ◆
    :End
    ◆If:reagentvar = 35
      ◆Change Items:Starbell Petals - 1
      ◆Control Variables:#0006 shimmer += 2
      ◆Control Variables:#0004 clarity -= 3
      ◆Control Variables:#0003 viscous += 1
      ◆
    :End
    ◆If:reagentvar = 36
      ◆Change Items:Hagvine Sap - 1
      ◆Control Variables:#0002 caustic += 3
      ◆Control Variables:#0003 viscous += 2
      ◆Control Variables:#0006 shimmer -= 2
      ◆
    :End
    ◆If:reagentvar = 37
      ◆Change Items:Lumenroot - 1
      ◆Control Variables:#0005 pungent += 1
      ◆Control Variables:#0007 effervescent += 3
      ◆Control Variables:#0004 clarity -= 1
      ◆
    :End
    ◆If:reagentvar = 38
      ◆Change Items:Moondew - 1
      ◆Control Variables:#0006 shimmer += 3
      ◆Control Variables:#0007 effervescent += 1
      ◆Control Variables:#0003 viscous -= 2
      ◆
    :End
    ◆If:reagentvar = 39
      ◆Change Items:Crushed Beast Claw - 1
      ◆Control Variables:#0002 caustic -= 2
      ◆Control Variables:#0005 pungent += 2
      ◆Control Variables:#0003 viscous += 3
      ◆
    :End
    ◆If:reagentvar = 40
      ◆Change Items:Ghostwillow Bark - 1
      ◆Control Variables:#0004 clarity += 2
      ◆Control Variables:#0006 shimmer -= 1
      ◆Control Variables:#0005 pungent += 3
      ◆
    :End
    ◆If:reagentvar = 41
      ◆Change Items:Aetherial Nectar - 1
      ◆Control Variables:#0007 effervescent += 3
      ◆Control Variables:#0004 clarity -= 2
      ◆Control Variables:#0005 pungent -= 1
      ◆
    :End
    ◆If:reagentvar = 42
      ◆Change Items:Deepdark Fungus - 1
      ◆Control Variables:#0002 caustic -= 3
      ◆Control Variables:#0006 shimmer += 2
      ◆Control Variables:#0003 viscous += 1
      ◆
    :End
    ◆If:reagentvar = 43
      ◆Change Items:Crystal Shards - 1
      ◆Control Variables:#0005 pungent -= 3
      ◆Control Variables:#0002 caustic += 2
      ◆Control Variables:#0003 viscous += 1
      ◆
    :End
    ◆If:reagentvar = 44
      ◆Change Items:Silverfern Stem - 1
      ◆Control Variables:#0004 clarity += 3
      ◆Control Variables:#0006 shimmer += 1
      ◆Control Variables:#0007 effervescent -= 2
      ◆
    :End
    ◆If:caustic < 0
      ◆Control Variables:#0002 caustic = 0
      ◆
    :End
    ◆If:viscous < 0
      ◆Control Variables:#0003 viscous = 0
      ◆
    :End
    ◆If:clarity < 0
      ◆Control Variables:#0004 clarity = 0
      ◆
    :End
    ◆If:pungent < 0
      ◆Control Variables:#0005 pungent = 0
      ◆
    :End
    ◆If:shimmer < 0
      ◆Control Variables:#0006 shimmer = 0
      ◆
    :End
    ◆If:effervescent < 0
      ◆Control Variables:#0007 effervescent = 0
      ◆
    :End
    ◆Text:None, None, Window, Bottom
    :    :-Current Potion Stats-
    :    :Caustic: \v[2], Viscous: \v[3], Clarity: \v[4]
    :    :Pungent: \v[5], Shimmer: \v[6], Effervescent: \v[7]
    ◆Show Choices:Add reagent, Finalize potion (Window, Right, #1, -)
    :When Add reagent
      ◆Jump to Label:PickIngredient
      ◆
    :When Finalize potion
      ◆Break Loop
      ◆
    :End
    ◆
  :Repeat Above
  ◆Text:None, None, Window, Bottom
  :    :POTION RESULT
  ◆Control Variables:#0002 caustic = 0
  ◆Control Variables:#0003 viscous = 0
  ◆Control Variables:#0004 clarity = 0
  ◆Control Variables:#0005 pungent = 0
  ◆Control Variables:#0006 shimmer = 0
  ◆Control Variables:#0007 effervescent = 0
  ◆Text:None, None, Window, Bottom
  :    :Do you want to make another potion?
  ◆Show Choices:Yes, No (Window, Right, #1, #2)
  :When Yes
    ◆Jump to Label:StartBrewing
    ◆
  :When No
    ◆
  :End
  ◆
:When No
  ◆
:End
It'll work but you can probably cut down this script 80 percent using proper Javascript with notetags in the item box and a switch case or similar.
It'll work but you can probably cut down this script 80 percent using proper Javascript with notetags in the item box and a switch case or similar.
Unfortunately, I don't know Javascript.
Cool. The 'loop' command seems unnecessary though, since you're using 'jump to label' when picking more ingredients.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-eventing-a-potion-crafting-system.162925/