Casper Gaming Developer Corner
Casper Gaming Developer Corner

Documentation

Back to Plugin


Quick InfoVersion: 1.11.1
Made for RPG Maker MZ 1.9.0

The BasicsRecipes have 4 categories of items associated with them: "Products", "Fail Products", "Tools", and "Ingredients".
- Products are items that are received by the player directly into the inventory on a successful craft.
- Fail Products are items that are received by the player directly into the inventory on a failed craft. This is an optional parameter.
- Tools are items that are required to craft the recipe, but which are NOT consumed on craft.
- Ingredients are items that are required to craft the recipe, and are consumed on craft.

Generic Item TypesRecipes can use "generic item types" for their ingredients or tools. What this means is that if you need a "skillet" tool to craft an "omelet", you could designate your "iron skillet" and "steel skillet" as a "skillet" type item, and then either could be used to craft the "omelet".

See note tag section for setting an item's type.

Caution: Care should be taken if an item belongs to multiple generic categories and the recipe uses multiple generic categories, as the item could be double counted when calculating the amount of items the player has.

Unique ProductsUnique products are products which can only be crafted up until the player has the Product Unique Amount of that item in their inventory. For example, you could make the Ultimate Sword which has a Product Unique Amount of 1, which would mean players can only craft 1 of these swords (at least, until the first sword is no longer in their party's inventory).

Unique products only support item/weapon/armors. You cannot use unique products to restrict currency or generic item products. Unique Products are only for products, not fail products.

NotetagsYou can make items that, when used, will cause a recipe to be learned. To do so, put the following tag in its notebox:
<cgmzrecipe:RecipeName>
And replace RecipeName with the name of the recipe.

You can make weapons or armors that, when equipped, will add to a recipe success chance. To do so, put the following note tags in the equip notebox:
<cgmzrecipetype:ProfessionName>
<cgmzrecipebonus:BonusAmount>

You can make "generic" types of items/weapons/armors to be used as either ingredients or tools. To do so, enter the following note tag into any item/armor/weapon notebox:
<cgmzcraftinggeneric:GenericType,GenericType2,etc>
Caution: Please be aware that generics can ONLY be used for ingredients or tools!

Note: When typing a note tag, it is CASE SENSITIVE which means that "Cooking" is not the same as "cOOking"

Integrations[CGMZ] Menu Command Window
You can use CGMZ Menu Command Window to easily add the crafting scene to the main menu. To do so, use the following JavaScript:

SceneManager.push(CGMZ_Scene_Crafting);

You can also prepare the crafting scene to show only certain recipes with:

SceneManager.prepareNextScene(["Type", "Type2"]);



Scene KeyThe plugin command that includes scene keys help differentiate crafting scenes. By default, once something is crafting, it cannot have another craft of the same item start. However, if the scene key is different between the two scenes, it will be recognized as a different item and you can craft multiple of the same craft at once.

Scene keys can also come in handy when checking if a specific crafting station is currently crafting something. Note that it is important your scene key is something unique, and should not be "crafting" or match a recipe's name.

Plugin CommandsThis plugin supports the following plugin commands:
Discover - Discovers (or undiscovers) the given recipe by name

Call Scene - Calls the crafting scene. Specify a profession type (case sensitive) to only include certain recipes in the scene.

Is Scene Crafting - Check if the scene with the provided scene key is currently crafting a recipe. Sets a game switch to TRUE/FALSE based on result of the check, for use in eventing.

Set Description - Changes the given recipe's description

Reinitialize - Reinitializes crafting data as if you had started a new game

Saved GamesThis plugin is partially compatible with saved games. This means you can:

✓ Add this plugin to a saved game and it will work as expected.
✘ Modifying plugin parameters is not fully supported. The following will not work correctly in previously saved games: Modifying or deleting existing recipes will not work in saved games. The saved game will act as if the recipe has not been modified or deleted.
✓ Remove the plugin with no issue to save data.

Filename

The filename for this plugin MUST remain CGMZ_Crafting.js. This is what it comes as when downloaded. The filename is used to load parameters and execute plugin commands. If you change it, things will begin behaving incorrectly and your game will probably crash. Please do not rename the js file.


Known Issues

This plugin currently has no known issues that need to be fixed. If you believe you have encountered a bug, please report it to Casper Gaming.


Compatibility

This plugin currently has no known compatibility issues with other RMMZ plugins. If you believe you have encountered a conflict, please report it to Casper Gaming.


Version HistoryVersion 1.0.1
  • Made it easier to select items/armors/weapons for crafting recipes
  • Fixed crash if recipe had no toast SE but Toast Manager was imported
Version 1.0.2
  • Added option to hide the percentage text on the progress window
  • Made the recipe list refresh after every craft
Version 1.0.3
  • Added option to show the current supply of ingredients in craft window
Version 1.0.4
  • Rearranged the recipe parameter to show the name first
Version 1.1.0
  • Added ability to use gold as ingredient, tool, fail product, or product
  • Added ability to increase success change by equipment
  • Added ability to increase success chance by profession level
  • Added option to close crafting scene on profession level up
  • Added option to use your own background image for the scene
  • Added option to make the windows transparent
Version 1.2.0
  • Descriptions and item names now compatible with text codes such as \c[x]
  • Added ability to use custom icon image in place of big icon in display window
  • Added option to show a confirmation window before crafting
  • Added option to change label text color
  • Added plugin command to set a recipe's description
  • The display window now shows the current profession level
  • Changed the Call Scene plugin command. You can now input multiple professions to include more than 1 type in the scene
  • New recipes should be automatically recognized on saved game load
  • Compatibility with CGMZ Profession profession level buffs
Version 1.2.1
  • Fixed bug with click to craft for windows that don't scroll
Version 1.2.2
  • Fixed bug when using cgmz professions but a recipe doesn't have a profession
  • Fixed bug with back button on non-scrolling display window
Version 1.3.0
  • Added ability to change what info is displayed in display window
  • Added ability to change the order of information in display window
  • Added ability to show fail products in display window
  • You can now set recipe(s) to be learned when crafting another recipe
  • More documentation added
  • Documentation no longer horizontally scrolls
Version 1.4.0
  • Added ability to increase a variable after a successful craft
  • Added generic items, you can now designate multiple item/wep/armor as a "type" and crafting ingredient/tools will count any items of that type
Version 1.4.1
  • Fixed crash if using CGMZ Professions and recipe profession did not exist
Version 1.4.2
  • Update color parameter to use RMMZ 1.6.0 new color picker UI
Version 1.5.0
  • Added options to display tool, product, and fail product amounts
  • Added ability to assign a quality to each recipe
  • Added ability to assign a subcategory to each recipe
  • Added option to fill space where touch UI buttons would be
  • Added option to show the list window on right side of screen
  • Added option to change windowskin of each window
  • Added Spanish language support
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 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 1.7.1
  • This plugin no longer crashes if you have a category window but no categories
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
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
Version 1.8.1
  • Added option to disable autodiscovery per recipe
  • Added option to change the width of the multicraft window
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
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 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
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 1.10.1
  • Fix bug with instant crafting stopping working until scene re-enter
Version 1.10.2
  • Fix bug with crafting sound effect not playing
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 1.11.1
  • [CGMZ] Toast Manager integration now uses toast preset id

Back to Plugin