MZ [CGMZ] Crafting

Just want to say that the double confirm thing is confusing. When using mouse, I tend to craft the same thin twice because when I click on other thing from menu it confirms again and crafts the previously selected thing again. I used the demo from your website to test it.
@Nerine Hi, I am not quite sure I follow, are you talking about how when you select an item in the list window, it activates the display window and you need to click again to craft?

The main reason it works this way is that keyboard/gamepad users need a way to scroll the window that displays the crafting information, and selecting the item via the list window then using arrow keys/gamepad up/down is the intended way they are meant to scroll the display window.

There is a "confirm" window option you could try to maybe alleviate some of the double crafting, since it will prompt the user if they are sure they want to craft with a new window before the craft occurs, by default (and in the demo) this window is set to off.

I can look to add a way to skip selecting the display window and just craft via the list window, which would help for games that don't expect the display window to need to scroll or for most players to play using mouse/touchscreen.
@Nerine Hi, I am not quite sure I follow, are you talking about how when you select an item in the list window, it activates the display window and you need to click again to craft?

The main reason it works this way is that keyboard/gamepad users need a way to scroll the window that displays the crafting information, and selecting the item via the list window then using arrow keys/gamepad up/down is the intended way they are meant to scroll the display window.

There is a "confirm" window option you could try to maybe alleviate some of the double crafting, since it will prompt the user if they are sure they want to craft with a new window before the craft occurs, by default (and in the demo) this window is set to off.

I can look to add a way to skip selecting the display window and just craft via the list window, which would help for games that don't expect the display window to need to scroll or for most players to play using mouse/touchscreen.
Well I meant, I have to double confirm every crafting option. First select the option, then confirm crafting again. When you use mouse it gets confusing at the beginning since you choose option then try to click on the next option, but it crafts an item instead.
By the way what is subcategory and quality used for?
@Nerine For now they are just used to give additional information to the players, they don't affect anything about how the recipe functions. In the future I am planning on including them in the call scene option to better filter recipes.
@Nerine For now they are just used to give additional information to the players, they don't affect anything about how the recipe functions. In the future I am planning on including them in the call scene option to better filter recipes.
I see. Oh and one more thing to the confusion I mentioned earlier. I think it'd work better if you had a specific craft and return button.
Anyways, are you planning on separating crafting screens by profession, so if you have crafting in ui. one profession recipes would not mix up with other profession recipes?
@Nerine Yes it is on my to-do list to allow for a separate "category" window when the scene is called with multiple different professions listed based on the recipes included. Thank you for the suggestion.
version-160.png

Hi all, this plugin has been updated to version 1.6.0 today! 👋

This update adds better control over how your player crafts. One way this was improved is the added option for instant crafting, which will hide the progress window and cause recipes to craft instantly. Another way this was improved was to allow the player to craft directly from the list window, instead of needing to select the recipe from the list window and then hit the OK button again on the display window. Keep in mind that when craft from list window is enabled, keyboard players will not be able to use the keyboard to manually scroll the display window.

This update also added unique products. Now you can have recipes that create products which are unique up to a certain amount. You can use this to make it so the player can only craft 5 of a specific item, or only 1 of a specific item. For example, you may only want them to craft 1 Ultimate Sword. As part of this, text letting the player know of the unique property was added as well. See below for how it looks:
crafting-160-update.png

There were also some quality of life and other miscellaneous features added. The plugin will now bring up an icon selector for icon parameters. You can now easily change the header line gradient colors. Sound Effect parameters now have volume, pitch, and pan properties. As a side effect of this, you will need to set up your sound effect parameters again. There is also an Unlearn On Craft mechanic added, which is the same as the existing Learn On Craft except for forgetting recipes instead of learning them.

Finally, this plugin will now warn in the dev tools console instead of crashing when invalid JSON is detected in a parameter. These errors are still important for you to fix as the crafting mechanic associated with them will not work properly until they are fixed. The code was also refactored to remove a lot of unnecessary recipe data from being saved, so your save file sizes should be slightly smaller now and you can now modify things such as recipe ingredients and have your changes show up in saved games.

Version 1.6.0
  • Added option for instant crafting
  • Added unique products
  • Added option to craft from the list window
  • Added unlearn on craft parameters, to forget recipes after crafting
  • Added more control over sound effect parameters
  • Added option to change the header line gradient colors
  • Icon parameters now use icon selector in plugin manager
  • This plugin now warns in the console when invalid JSON is detected
  • Reduced unnecessary recipe save data, slight code optimizations
version-170.png

Hi all, today [CGMZ] Crafting has been updated to version 1.7.0! 👋

This update adds categories to your crafting scene! This is a new window above the existing crafting windows which allows the player to see crafting recipes by their type (profession). Previously, recipes of various types used to be listed in the list window with no way to sort them by different type of recipe. Now, you can show a category window and sort recipes that way. Categories were coded as an option, so you can still use the old way of displaying recipes if you like. This is how the scene could look with categories enabled:
crafting-170-update.png

This update also added a few quality of life features. There is now a view only parameter on scene calls, which will allow your player to see the recipes they know in the crafting scene but not craft them. This update also adds an option to hide recipes if the player cannot currently craft them, for example if they do not have the items to craft them. This update also added text to display when there are no recipes to select in the crafting scene.

Recipes also had a parameter added to them to determine on a per-recipe basis if the Learn toast should display when that recipe is learned. This was requested because some games use one-off recipes, for example to build a bridge. Overall the desire was to show toasts when a recipe was learned, except for these one-off recipes. Now you can do that!

Version 1.7.0
  • Added categories to crafting and various options for categories
  • Added a view only option when calling the crafting scene
  • Added a parameter to hide learn toasts for specific recipes
  • Added an option to hide recipes if they cannot be crafted
  • Added text to show when the player has no recipes in the scene
version-171.png

Hi all, this plugin has received a minor update today. 👋

In the previous update categories were added, and it seems to be a common problem that people were trying to show the category window without setting up any categories in the plugin parameters, or had missed setting up a category that was referenced elsewhere in the plugin. This used to crash the game, since the plugin would look for the category to show in the category window and not be able to find it as it was not set up. Now, instead of crashing, the category window will make an educated guess for what you might want to display there in the case that any categories are missing.

Please note that it is still recommended to set up the categories parameter if you are intending to use categories. This update is mostly just to make the initial setup process more forgiving.

Version 1.7.1
  • This plugin no longer crashes if you have a category window but no categories
version-172.png

Hi all, today this plugin was updated to version 1.7.2! 👋

This update adds a text parameter to change the "x" text after the amount required. Previously this was hard coded into the plugin. Now you can change it or set it to blank to have no extra text appear in this spot. This update also fixes a bug where the amount required would not display for generic items, only the amount in possession by the player.

Version 1.7.2
  • Added option to change the x text after an amount required
  • Fixed a bug with generic item requirements not showing amount needed
View attachment 294199
Hi all, today this plugin was updated to version 1.7.2! 👋

This update adds a text parameter to change the "x" text after the amount required. Previously this was hard coded into the plugin. Now you can change it or set it to blank to have no extra text appear in this spot. This update also fixes a bug where the amount required would not display for generic items, only the amount in possession by the player.

Version 1.7.2
  • Added option to change the x text after an amount required
  • Fixed a bug with generic item requirements not showing amount needed

There seems to be a bug (present in this version, as well as in previous versions) where closing the crafting menu close to when an item is finishing crafting and immediately opening the pause menu (ie. spamming the "Cancel/menu" key quickly right as the crafting process ends) causes the game to crash with this error:
crash.JPG


It might sound niche, but quickly closing the crafting window when you're done happens pretty frequently, and since it is the same key as the menu key by default, it happens often. This has crashed several of my "normal" play sessions so far.

An easy fix would be to add some kind of delay of say 10 frames or so after the crafting scene ends before the menu scene can be called.



*Edit: Removed the 2nd part of my question here, I had just missed the setting to get categories to display!
@chris-cote Hi, thanks for the bug report, but I am having a little trouble getting this crash to occur in my test project. It does sound a little bit timing dependent, so maybe I am not being precise enough but after about 10 minutes of trying I have not gotten the crash to happen.

To reproduce, you start a craft and wait until it is nearly finished and then exit the crafting scene? Could you show the full error trace from the dev tools console? You can open the dev tools console by pressing F8 and then switching to the console tab at the top of the window that pops up.
Is there a way to hide the recipes if the user does not have the needed ingredients or some other way to have lots of recipes without the player needing to comb thru a massive list to find the right one.
@SwopeDog Hi, you can turn the parameter "Always Show Recipes" to false, and then turn the parameter "Hide Uncraftable Recipes" to true and you should no longer see recipes the player does not have ingredients for in the list.
version-180.png

Hi all, this plugin was updated to version 1.8.0 today! 👋

This update adds the option to allow multicrafting. Multicrafting is a way players can choose how many to make before crafting begins, and the plugin will automatically craft that many items without the player needing to provide additional inputs. This will come in handy if the player wants to craft a lot of simple things without needing to continually select to craft over and over again. Here is a gif of how it looks:
rwQBOIg.gif

This update also adds high quality craft outcomes. This is a possible outcome similar to products and fail products, where the player has a chance to instead perform a high quality craft and receive different items.

This update added some quality of life features and common features other [CGMZ] plugins have as well. You can now optionally automatically discover recipes when the player gets the ingredients required for them. Window padding, opacity, and tint options were added for each window. The Scene Background image parameter now supports images from any folder.

This update also causes the crafting window to wait for crafting to finish before allowing the player to navigate away. This seemed to have been a possible source of crashing if the player left the crafting scene at the exact moment a craft finished. This should no longer be possible, even though the crash was not reproducible for me.

Update Notes: When updating, please be aware that you will need [CGMZ] Core version 1.15.0 or higher for this version of Crafting to work. You will also need to reset your Scene Background parameter, if you had a background image set. You will also need to load each recipe subparameter and allow the new defaults to load for things like high quality products and other new parameters.

Version 1.8.0
  • Added options to craft more than one item at a time
  • Added option to automatically discover recipes with proper items
  • Added new High Quality Product and various options for high quality crafts
  • Added options for window padding, opacity, tone for all windows
  • Crafting now waits for craft to finish before giving back player control
  • Scene Background Image now supports being from any folder
View attachment 303593
Hi all, this plugin was updated to version 1.8.0 today! 👋

This update adds the option to allow multicrafting. Multicrafting is a way players can choose how many to make before crafting begins, and the plugin will automatically craft that many items without the player needing to provide additional inputs. This will come in handy if the player wants to craft a lot of simple things without needing to continually select to craft over and over again. Here is a gif of how it looks:
rwQBOIg.gif

This update also adds high quality craft outcomes. This is a possible outcome similar to products and fail products, where the player has a chance to instead perform a high quality craft and receive different items.

This update added some quality of life features and common features other [CGMZ] plugins have as well. You can now optionally automatically discover recipes when the player gets the ingredients required for them. Window padding, opacity, and tint options were added for each window. The Scene Background image parameter now supports images from any folder.

This update also causes the crafting window to wait for crafting to finish before allowing the player to navigate away. This seemed to have been a possible source of crashing if the player left the crafting scene at the exact moment a craft finished. This should no longer be possible, even though the crash was not reproducible for me.

Update Notes: When updating, please be aware that you will need [CGMZ] Core version 1.15.0 or higher for this version of Crafting to work. You will also need to reset your Scene Background parameter, if you had a background image set. You will also need to load each recipe subparameter and allow the new defaults to load for things like high quality products and other new parameters.

Version 1.8.0
  • Added options to craft more than one item at a time
  • Added option to automatically discover recipes with proper items
  • Added new High Quality Product and various options for high quality crafts
  • Added options for window padding, opacity, tone for all windows
  • Crafting now waits for craft to finish before giving back player control
  • Scene Background Image now supports being from any folder


This is an awesome feature!

Is there any way to change the width/height of the multi-crafting UI (even if just a line in the plugin code I can tweak)?

With a wider screen resolution it looks a bit too wide, and I'd love to be able to shrink the width so that it is just as wide as the buttons, and add a tiny bit more height.

(My view):
craft.JPG
@chris-cote Hi, yes if you want to change the width you can look for the function
Code:
CGMZ_Scene_Crafting.prototype.multicraftWindowRect
and change the line that says
Code:
const width = Graphics.boxWidth / 2;

I can add this to a future update too, thanks for the suggestion.
@chris-cote Hi, yes if you want to change the width you can look for the function
Code:
CGMZ_Scene_Crafting.prototype.multicraftWindowRect
and change the line that says
Code:
const width = Graphics.boxWidth / 2;

I can add this to a future update too, thanks for the suggestion.

Worked perfectly, thanks!
version-181.png

Hi all, this plugin was updated today to version 1.8.1! 👋

This update is a small one that adds some quality of life for features added in 1.8.0. You can now set the multicraft window width via the plugin parameters. You can also now disable autodiscovery on a per-recipe basis, which might be useful in the case that you want most recipes to autodiscover except for a few important ones.

Version 1.8.1
  • Added option to disable autodiscovery per recipe
  • Added option to change the width of the multicraft window

Original thread: https://forums.rpgmakerweb.com/threads/cgmz-crafting.128024/