MZ [CGMZ] Crafting

@casper667

There is a bug with the multicrafting which allows you to select a decimal number.

For example, if there is an item that requires 5 of something to make, and you keep clicking to increase the quantity to craft while you have 6+ of the required item, it will allow you to select "1.2x" to craft, and it will craft 2 of the item even though you don't have enough materials to make 2.

This means that if a player just takes out, say, 6 of the material item at a time when they craft, they can keep crafting "1.2x" and get a free crafted item each time for only one extra material instead of 5.

It seems there just needs to be a "math.floor" somewhere when selecting a quantity to craft when the player has enough materials to craft at least one of something, as this should be rounding down to whole numbers.
version-182.png

Hi all, this plugin received a minor update today to version 1.8.2. 👋

This update fixes a pretty significant bug with the recently added multi-crafting where it could attempt to craft fractions of an item, allowing players to craft more items than they should have been able to craft. This update also fixes a bug with the multi-craft window to cause it to no longer make room for the missing Touch UI icons when Touch UI is disabled.

Version 1.8.2
  • Fixed bug where multicraft could attempt to craft fractions of an item
  • Fixed bug with multicraft window making space for touch UI when disabled
View attachment 309028
Hi all, this plugin received a minor update today to version 1.8.2. 👋

This update fixes a pretty significant bug with the recently added multi-crafting where it could attempt to craft fractions of an item, allowing players to craft more items than they should have been able to craft. This update also fixes a bug with the multi-craft window to cause it to no longer make room for the missing Touch UI icons when Touch UI is disabled.

Version 1.8.2
  • Fixed bug where multicraft could attempt to craft fractions of an item
  • Fixed bug with multicraft window making space for touch UI when disabled

Awesome, thanks for the quick fix!
version-190.png

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

This update's major feature is the option to filter your recipe lists! You can now allow your player to filter by category (if not already using the category window), subcategory, and quality. Previously, subcategory and quality parameters on recipes were for flavor only, but now you can filter by them. Filters can exist only for specific categories, in case you want different subcategories to show for filtering Cooking than the subcategories that show as filters when filtering Blacksmithing. Due to the size of the feature, there were quite a few new parameters added to support everything about filtering and make it very customizable. Below is a gif of how it can look:
9LIfs3g.gif

This update also added an integration with [CGMZ] Rumble. You can now rumble the player's controller when a craft succeeds or fails, with different rumble strengths for each. In addition to hearing a breaking sound effect when a craft fails, now the rumble of the controller can immerse them even more.

A lot of smaller quality of life updates are included with this update. You can now have a separate Display Name for your recipe, which means you can have recipes that appear to have the same name as each other in case you want multiple ways of crafting something. Previously, the name recipe was used as sort of an id and had to be unique. You can now display the time remaining on the craft progress bar instead of the craft percent completion. For the craft percent completion, text parameters were added to make it more customizable including the amount of decimals shown and the % text after the number shown.

Version 1.9.0
  • Added filters, you can now filter the recipe list by quality/subcategory
  • Added rumble integration, you can now rumble gamepad on craft success/fail
  • Added Display Name parameter for recipes
  • Added option to display time remaining on progress bar
  • Added option to change decimals shown on progress bar percentage
  • Added text param for percent text after progress percentage
  • Added text params for filter options
version-191.png

Hi all, today this plugin received a minor update to version 1.9.1! 👋

This update removed the Always Show Recipes parameter. Initially, this parameter was added as an ease of use feature to always show recipes in the list even if other more advanced options would cause them to not display. However, as more options have been added which dictate the recipes that show in the list, this parameter started to cause more confusion than it solved as it caused the plugin to ignore all of these other settings.

This parameter has been replaced with a new parameter for hiding recipes if the player does not have an adequate profession level to craft the recipe, which was the only remaining way a recipe could be filtered from the list without an option to change that behavior. Hopefully, the new user experience should be much easier to get the plugin set up.

This update also fixes a crash when opening the crafting scene with touch ui disabled.

Version 1.9.1
  • Added option to hide recipes if level requirement not met
  • Removed option to always show recipes
  • Fixed crash when touch UI disabled
Hello, I'm encountering a bug, yet I don't recall having changed anything.

TypeError: Cannot read property 'tools' of undefined
at CGMZ_Recipe.hasItemsNeeded (CGMZ_Crafting.js:4466)
at CGMZ_Recipe.canCraft (CGMZ_Crafting.js:4445)
at CGMZ_Window_RecipeList.drawItem (CGMZ_Crafting.js:5954)
at CGMZ_Window_RecipeList.Window_Selectable.drawAllItems (rmmz_windows.js:1361)
at CGMZ_Window_RecipeList.Window_Selectable.paint (rmmz_windows.js:1412)
at CGMZ_Window_RecipeList.Window_Selectable.refresh (rmmz_windows.js:1405)
at CGMZ_Window_RecipeList.refresh (CGMZ_Crafting.js:5895)
at CGMZ_Window_RecipeList.initialize (CGMZ_Crafting.js:5818)
at new CGMZ_Window_RecipeList (CGMZ_Crafting.js:5804)
at CGMZ_Scene_Crafting.createListWindow (CGMZ_Crafting.js:5156)
Edit: I tested again and this time, I can open the crafting menu without any issues. Very strange. Thanks anyway, I still prefer to report the error just to understand where it might come from.
@-XVI- Hi, this is not a bug, this error can occur when you save a game, change a recipe's name / id, and then load the saved game. This is expected since the saved recipe will no longer be able to find the recipe's parameter information such as tool requirements as it has to use the name / id to look up the recipe's parameters.
@-XVI- Hi, this is not a bug, this error can occur when you save a game, change a recipe's name / id, and then load the saved game. This is expected since the saved recipe will no longer be able to find the recipe's parameter information such as tool requirements as it has to use the name / id to look up the recipe's parameters.
Okay, I understand better now, I had overlooked that hypothesis. So, thank you once again.
version-1100.png

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

This version makes it so you no longer need to wait for a craft to finish before trying to craft other recipes or even exiting the scene. You can also set up scene keys to allow the player to start the same recipe crafting at different crafting stations. A new plugin command was added to check if a certain crafting station is currently crafting a recipe, allowing you to event a graphic change for when the station is crafting. See below gif for how this can look:
k9NyMJ0.gif

A toast option for when crafting is complete was also added.

Some bugs were also fixed. The display window scroll should now be accurate when using custom padding. The list window no longer overflows if your recipe name is long.

Some quality of life changes were made. The Craft From List parameter has been made default as the display window now can always be scrolled. The display window also now recognizes font size changes when drawing text for vertical space.

Some new integrations were added. Your recipes can now use [CGMZ] Currency System custom currencies. Your crafting scene can now have a [CGMZ] Scene Backgrounds background, including a scrolling background or weather. This can be set on a per-scene basis, if you want a different background for a cooking scene vs a blacksmithing scene.

This plugin also now works better with [CGMZ] Toast Manager so the order of the two plugins is no longer important.

Important: This update changed the parameter types of sound effect, toast manager, and rumble parameters. You will need to set these parameters up again after updating. New users are not affected, only those updating from a previous version.

Version 1.10.0

  • Added option to craft different things at the same time
  • Added plugin command to check if a crafting station is currently crafting
  • Added toast window option for craft complete
  • Added [CGMZ] Currency System integration
  • Added [CGMZ] Scene Backgrounds integration
  • Bug fix for display window scroll being slightly off with custom padding
  • Bug fix for list window overflowing for long recipe names
  • Removed Craft From List parameter as it is now default
  • Display Window now recognizes font size changes
  • Sound Effect and Toast parameters changed
  • [CGMZ] Toast Manager order no longer important
  • [CGMZ] Rumble integration parameters changed
version-1101.png

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

This version is a bug fix for instant crafting, which could stop working until the crafting scene is re-entered in some cases. Before, instant crafting always used the same crafting flow with just a 1 frame craft time. However, now it has been converted to a true instant craft. No matter how many crafts (if multicraft enabled) you select, the craft will always be completed instantly without even a 1 frame wait. It still calculates success and high quality per-craft if multicraft is enabled, but the sound and rumble will be the failure sound if any craft fails.

Version 1.10.1
  • Fix bug with instant crafting stopping working until scene re-enter
version-1102.png

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

This version is a bug fix for the crafting sound effect not playing. It still will not play during instant craft, as it will be replaced by the success or fail sound effects instantly.

Version 1.10.2
  • Fix bug with crafting sound effect not playing
version-1110.png

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

This version changes some parameters around to be easier to use or to remove some limitations. This does mean you will need to re-set the changed parameters up again.

The first parameters to change are Learn On Craft and Unlearn On Craft. Previously, these were split into two, one array for the recipe name and one array for the chance to learn/unlearn the corresponding recipe name from the first array. This was just a bit confusing, so the parameter has been converted into a single list of objects where you can set both the recipe name and the chance it is learned or unlearned in one place.

The second parameter to change is the description parameter, which was previously a json note but has been converted into a multiline string. This reduces parsing requirements and lowers chance for user error.

The third parameter to change is the recipe Picture parameter. It now supports images in any folder instead of forcing the pictures folder.

Unfortunately, if you are updating to this version from an older version you will need to set up the following parameters again: Learn On Craft, Unlearn On Craft, Description (including Change Description plugin commands), and Picture.

This update also added two new integrations with other [CGMZ] plugins. The first is with [CGMZ] Window Settings which is how you can customize any window's tone, style, windowskin, etc. The second is [CGMZ] Window Backgrounds which allows you to change the windowskin background into an image including a scrolling parallax animated image.

A bug was fixed with auto-learn not working for recipes with gold as an ingredient.

Version 1.11.0
  • Recipe picture now supports all image folders
  • Recipe description changed to multiline string type
  • Learn On Craft parameter converted to struct type
  • Unlearn On Craft parameter converted to struct type
  • Added [CGMZ] Window Settings integration
  • Added [CGMZ] Window Backgrounds integration
  • Fix bug with auto learn not learning recipes in some cases
version-1111.png

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

This version version improves the [CGMZ] Toast Manager integration since it now uses toast presets which are re-usable by a toast id, and all you need to enter here is the id with all the other options coming from the toast manager. You can use the string %name to show the recipe name in your toast presets.

Version 1.11.1
  • [CGMZ] Toast Manager integration now uses toast preset id
version-1120.png

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

This version adds the option to make it so the player must return to the crafting station to collect items they started crafting at that station. If they have the crafting station open at the time the craft finishes, the items will still be directly deposited into their inventory. This only affects the case where the player started a craft, then exited the crafting scene, and then the craft finished while the scene was not open. Each crafting station has its own item storage, so if the player starts crafts at multiple different stations, each station will allow them to collect only what they crafted at that station. See below gif for how it can look:
cgmz-crafting-1120.gif

You can now set success rates to be negative and require the player boost their success rate to craft an item. Note that the success rate will still be shown as between 0 and 100. This is because the plugin displays a calculated success rate, not the base success rate, and negative numbers will be reported as 0 after calculation occurs.

Two new plugin commands were added: Discover Batch and Is Recipe Discovered. Discover Batch allows you to discover or undiscover multiple recipes in one plugin command, saving time if you have a lot to discover. Is Recipe Discovered will check if a recipe is discovered and store the result in a game switch, so you can event things if the player has or has not found a recipe yet.

Version 1.12.0
  • Added option to return to crafting station to collect items
  • Add Discover Batch plugin command
  • Add Is Recipe Discovered plugin command
  • Success Rate can now be negative
version-1121.png

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

This version fixes a small bug that could get a player stuck in the craft scene if the plugin is set to wait for crafting to finish and your recipe auto-discovers a new recipe above it in the list window.

Version 1.12.1
  • Fix bug with getting stuck when wait for craft finish enabled

Hello! I'm getting this error message and I'm not sure why :0

SceneManager.CGMZ_isCurrentScene is not a function

Hello! I'm getting this error message and I'm not sure why :0

SceneManager.CGMZ_isCurrentScene is not a function

Hi, most likely you need to update [CGMZ] Core, it should be version 1.37.0
Oh thank you!
I updated the plugin and now I'm getting this on launch, Its late over here so I'm heading to sleep for now but thank you so much for the help!
TypeError
$cgmzTemp.getImageData is not a function
Hi, most likely you need to update [CGMZ] Core, it should be version 1.37.0
I updated the plugin and now I'm getting this on launch, Its late over here so I'm heading to sleep for now but thank you so much for the help!
TypeError
$cgmzTemp.getImageData is not a function
Hi, most likely it is another out of date plugin causing this, you can open dev tools and post the full error trace and I can tell you which one it is, or you can turn on Check For Updates in [CGMZ] Core and the dev tools console will tell you which plugins of mine are out of date with a link to download the update. When updating, you may need to configure new parameters that were added throughout the updates.

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