Geieet

Warper
Member
Joined
Mar 1, 2015
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
I fixed this by having a simple generic recipe for a basic health potion included. Not a glamorous fix but it worked for me, since I needed one anyway.
I'm having an issue where I can't add a recipe to an existing book. I want the player to collect recipes as they go throughout the world and add them to one single crafting book.
Is there any trick to using the CraftingSystem add_recipe 1: i12 plugin command?
I've got it set up so that if the character reads a book it shows some text about the book, like so, and then runs the plugin command, but when calling the CraftingSystem open 0 command it doesn't show the new recipes, only the potion recipe that is pre-defined in to the book.

EDIT: And for some reason if I try and use a book with the category of 0 and add something to it, I get a _recipe_book null error.

View attachment 76860

When you write "CraftingSystem add_recipe x: i3" the "x" should correspond to the number of the book in the item slot. So if your crafting book is int the 15th slot in the items, then you would write "CraftingSystem add_recipe 15: i3"
 

Ryoshu

Veteran
Veteran
Joined
Mar 11, 2013
Messages
134
Reaction score
7
First Language
english
is it possible for you to release a demo of this script. im not too experienced with scripting and im having a hard time understanding how it all works to be completely honest

EDIT: scratch that i figured it out
 
Last edited:

Overkill24

The Endless Void
Member
Joined
Apr 15, 2015
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
Will be using for an "Exercise Project" called GLORY TO THE RED CRAYON. May or may not be put on steam ( will not be selling it though since it is just an exercise project).

P.S. If you know anything about the USMC and their obsession with crayons; you might have a better understanding of this game's theme.
 

Amy_Lizzy

Virtuoso in the Art of Trying
Member
Joined
Mar 24, 2018
Messages
5
Reaction score
2
First Language
French
Primarily Uses
RMMV
Hello!
Thanks for this plugin, it's a very good idea. :D

But I have a little issue. When I'm in the Crafting Window, if I use the the keys to move from a product to another, the game crashes because "Cannot read property 'forEach' of null".

Here are the logs.

2018-11-23.png

Somebody for helping me, please? :o
 

Jop890

Warper
Member
Joined
Feb 10, 2019
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
it's number based 0-10
 

megated123

Warper
Member
Joined
Jun 5, 2016
Messages
3
Reaction score
0
Primarily Uses
Szyu's CraftingSystem
plugin for RPG Maker MV
v1.0​

Introduction
A simple crafting system, to craft items, weapons and armors based on recipes and recipe books.


Download
Link to mediafire



Screenshots

crafting1_zpsqiuumtvz.png



crafting2_zpsh422dpzo.png

How to Use
For detailed explanations on how to use the plugin, check the plugin manager's help button for this script.

Terms of Use
You are free to use this script for commercial and non-commercial projects. However I'd like you to inform me of the projects you are planning to use it in, so I can keep track of where my scripts are used.

Hey i am planning on using this for my game here

https://gamejolt.com/games/HMR/281485
 

Arramon

Villager
Member
Joined
Dec 25, 2017
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Any updates on this crafting system? has anyone been able to add sound FX or animations to the crafting? I was thinking of having the system check (using common event) to see if the newly crafted item is added to the inventory for the first time then show an animation and message, but other than that I'm not sure how to add bells and whistles to this system. I have a blacksmith sitting there hammering, but there's no way to exit the crafting system prior to the item being crafted to show the blacksmith hammering away then the item appear. It just appears in the crafting system with no tada! effects at all.....I want people to be gloriously happy when they craft something =b
The plugin setup where you can edit the text that appears after crafting an item should also allow for a SE to be played. Can someone change the script to include a sound being played? And possibly a yes/no are you sure question prior to the item being crafted.

https://mvplugins.com/plugin/Szyu/Crafting System is the updated script here???? I see a v1.2
 
Last edited by a moderator:

Tactician-Elive

Villager
Member
Joined
Dec 2, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I don't know how quickly you can respond but the plugin won't show the crafting menu no matter how much I try.
here are some images for reference
 

Attachments

  • 2019-12-05.png
    2019-12-05.png
    393.8 KB · Views: 23
  • 2019-12-05 (2).png
    2019-12-05 (2).png
    356.2 KB · Views: 22

Klimber

Villager
Member
Joined
Apr 2, 2020
Messages
16
Reaction score
1
First Language
Ukrainian
Primarily Uses
RMMV
Hello, I’m interested in one thing about your plugin, Szyu. Namely: is it possible to set a restriction on the creation of a certain number of items inside the plugin?
For example: you need the player to be able to create only one oven for the entire game.
Tell me please.
 

bossmanCulley

Warper
Member
Joined
Apr 11, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
I just want to add this for anyone who is frustrated trying to get this to work and failing. I spent over an hour trying to figure out why my recipe book kept showing up blank and im happy to say that I found the answer and I'm sure it's helpful. MAKE SURE the recipe book is not set to consumable! I completely overlooked that. Basically when you open the book you "consume" it which then makes it blank. I'm so glad I figured that out because this plugin is awesome. Thank you Szyu!
 

TheGameAfter

I'm here to help and to learn!
Veteran
Joined
Apr 20, 2019
Messages
137
Reaction score
80
First Language
Hebrew
Primarily Uses
RMMV
Hey game makers,

I just did some research to find a crafting plugin for my project, since Szyu's didn't respond/post here for some time and I see some people have problems with this plugin I wanted to share other 'crafting' system you might miss, hopefully, someone will find it useful :)

you can see the plugins in this post.

TGA
 

rohzek

Warper
Member
Joined
Oct 7, 2017
Messages
3
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hey everyone.

I've made a few changes to this plugin for use on my own project, figured I'd share here if anyone else wanted to play with them. YMMV, this works perfect in my situation but it's not tested in every situation - Example: I'm not even using currency so there's no way you could craft with it.


To add in my changes, just open the script in a text editor (preferably something like Notepad++) control+F the first line of the code and change/replace the function to match what I have.

What I've done is added the ability to set an item not to be removed when crafted with, and the ability to set the number of items outputted with a single craft:

Code:
DataManager.load_ingredientLists = function(){
        var dbs = [$dataItems, $dataWeapons, $dataArmors];
        dbs.forEach(function(db){
            db.filter(function(obj){return obj != null;}).forEach(function(item){
                item._ingredients = null;
                item._craftamount = null;
                
                if (item.note.match(/<recipe>[\s\S]*<\/recipe>/gim)){
                    item._ingredients = [];

                    item.note.match(/([iwa]:\s*\d+,\s*\d+,\s*(true|false)|[co]:\s*\d+)/gim).forEach(function(ing_line){
                        var ing = ing_line.match(/([iwa]):\s*(\d+),\s*(\d+),\s*(true|false)|([co]):\s*(\d+)/i);
                        var ing_db;
                        var needed;
                        var consumed;
                        var output;
                        
                        if (ing[1] != null){
                            switch (ing[1]){
                                case 'w': ing_db = $dataWeapons[parseInt(ing[2])]; break;
                                case 'a': ing_db = $dataArmors[parseInt(ing[2])]; break;
                                case 'i': ing_db = $dataItems[parseInt(ing[2])]; break;
                            }
                        } else {
                            if (ing[5] == 'c'){
                                ing_db = currencyText;
                            }
                            
                            if (ing[5] == 'o'){
                                ing_db = "output";
                            }
                        }
                        
                        consumed = ing[4] === 'true' ? true : false;
                        
                        if (ing_db == currencyText){
                            needed = parseInt(ing[6]);
                        } else if(ing_db === "output") {
                            output = parseInt(ing[6]);
                            
                            if(item._craftamount === null) {
                                item._craftamount = output === null ? 1 : output;
                            }
                        } else {
                            needed = parseInt(ing[3]);
                            item._ingredients.push({'item': ing_db, 'amount':needed, 'consumed': consumed});
                        }
                    },this);
                }
            },this);
        },this);
    }

Code:
Scene_CraftingMenu.prototype.onCraft = function(){
        // Create crafting sound
        var craftingSound = new Object();
        craftingSound.name = craftingSounds[this._category];
        craftingSound.pan = 0; 
        craftingSound.pitch = 100; 
        craftingSound.volume = 90;
        AudioManager.playSe(craftingSound); // play crafting sound

        var numberToCraft = this._indexWindow.item()._craftamount;
        $gameParty.gainItem(this._indexWindow.item(), numberToCraft);
        this.loseIngredients();
        
        // Show gain item Message
        $gameMessage.setBackground(0);
        $gameMessage.setPositionType(1);
        
        var out = numberToCraft > 1 ? " x" + numberToCraft : "";
        var message = itemCraftedText + '\n' + this._indexWindow.item().name + out;
        
        $gameMessage.add(message);
    };

Code:
Scene_CraftingMenu.prototype.loseIngredients = function(){
        var item = this._indexWindow.item();
           var ing;
           var db;
           var needed;
        var consumed;
        
           item._ingredients.forEach(function(ing){
               needed = ing['amount'];
            consumed = ing['consumed'];
               if (ing['item'] == currencyText){
                   $gameParty.loseGold(needed);
               } else {
                if(consumed) {
                    $gameParty.loseItem(ing['item'], needed);
                }
               }
           }, this);
        this._ingredientsWindow.refresh();
    };

With these changes, you can now set up your item's recipe like so:

Code:
<recipe>
   o: 4 # Number of items to be outputted with a single craft
   i: 12, 1, true # Requires 1 of item #12, and this item will be consumed
   i: 71, 1, false # Requires 1 of item# 71, and this item will not be consumed
</recipe>


1.png
2.png
3.png
 

SolidSilver

Villager
Member
Joined
Jun 29, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
I plan on using this for my project "Project Weak and Strong" as well as the possible full game.
 

3Eyedcowboy

Villager
Member
Joined
Jun 28, 2020
Messages
8
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey everyone.

I've made a few changes to this plugin for use on my own project, figured I'd share here if anyone else wanted to play with them. YMMV, this works perfect in my situation but it's not tested in every situation - Example: I'm not even using currency so there's no way you could craft with it.


To add in my changes, just open the script in a text editor (preferably something like Notepad++) control+F the first line of the code and change/replace the function to match what I have.

What I've done is added the ability to set an item not to be removed when crafted with, and the ability to set the number of items outputted with a single craft:



This is exactly what I was hoping would be added, but it doesn't seem to load for me; any attempts to open the crafting fail. Is there any chance you could share the compiled version?
 

3Eyedcowboy

Villager
Member
Joined
Jun 28, 2020
Messages
8
Reaction score
2
First Language
English
Primarily Uses
RMMV
Update: I was able to figure it out (except for the sound effect; don't know enough about java to know where exactly to type it in, but that's not a big deal.)

The neat thing that Rohsek's tweak also allows: you can now pull out the book to check the recipes without allowing people to craft anywhere.

How to:
Create 2 key items: a recipe book and a crafting station.

>Give the PC a recipe book that pulls up up the crafting event (and let them keep it in their inventory). Set the recipe book to accessible from main menu.

>Every recipe includes the ingredient "crafting station" (which is set to false, non-disposable)

>Whenever the PC uses the crafting station event, they gain the key item "crafting station," then take it away when they leave the station.
 

Gabrepasta

Veteran
Veteran
Joined
Dec 1, 2013
Messages
35
Reaction score
0
First Language
German
Primarily Uses
RMMV
I just noticed something that confuses me.
What is "Price" for?
Given how money is in the crafting recipe with 'currency' I do not really understand its purpose
 

Gabrepasta

Veteran
Veteran
Joined
Dec 1, 2013
Messages
35
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hey everyone.

I've made a few changes to this plugin for use on my own project, figured I'd share here if anyone else wanted to play with them. YMMV, this works perfect in my situation but it's not tested in every situation - Example: I'm not even using currency so there's no way you could craft with it.


To add in my changes, just open the script in a text editor (preferably something like Notepad++) control+F the first line of the code and change/replace the function to match what I have.

What I've done is added the ability to set an item not to be removed when crafted with, and the ability to set the number of items outputted with a single craft:

Code:
DataManager.load_ingredientLists = function(){
        var dbs = [$dataItems, $dataWeapons, $dataArmors];
        dbs.forEach(function(db){
            db.filter(function(obj){return obj != null;}).forEach(function(item){
                item._ingredients = null;
                item._craftamount = null;
              
                if (item.note.match(/<recipe>[\s\S]*<\/recipe>/gim)){
                    item._ingredients = [];

                    item.note.match(/([iwa]:\s*\d+,\s*\d+,\s*(true|false)|[co]:\s*\d+)/gim).forEach(function(ing_line){
                        var ing = ing_line.match(/([iwa]):\s*(\d+),\s*(\d+),\s*(true|false)|([co]):\s*(\d+)/i);
                        var ing_db;
                        var needed;
                        var consumed;
                        var output;
                      
                        if (ing[1] != null){
                            switch (ing[1]){
                                case 'w': ing_db = $dataWeapons[parseInt(ing[2])]; break;
                                case 'a': ing_db = $dataArmors[parseInt(ing[2])]; break;
                                case 'i': ing_db = $dataItems[parseInt(ing[2])]; break;
                            }
                        } else {
                            if (ing[5] == 'c'){
                                ing_db = currencyText;
                            }
                          
                            if (ing[5] == 'o'){
                                ing_db = "output";
                            }
                        }
                      
                        consumed = ing[4] === 'true' ? true : false;
                      
                        if (ing_db == currencyText){
                            needed = parseInt(ing[6]);
                        } else if(ing_db === "output") {
                            output = parseInt(ing[6]);
                          
                            if(item._craftamount === null) {
                                item._craftamount = output === null ? 1 : output;
                            }
                        } else {
                            needed = parseInt(ing[3]);
                            item._ingredients.push({'item': ing_db, 'amount':needed, 'consumed': consumed});
                        }
                    },this);
                }
            },this);
        },this);
    }

Code:
Scene_CraftingMenu.prototype.onCraft = function(){
        // Create crafting sound
        var craftingSound = new Object();
        craftingSound.name = craftingSounds[this._category];
        craftingSound.pan = 0;
        craftingSound.pitch = 100;
        craftingSound.volume = 90;
        AudioManager.playSe(craftingSound); // play crafting sound

        var numberToCraft = this._indexWindow.item()._craftamount;
        $gameParty.gainItem(this._indexWindow.item(), numberToCraft);
        this.loseIngredients();
      
        // Show gain item Message
        $gameMessage.setBackground(0);
        $gameMessage.setPositionType(1);
      
        var out = numberToCraft > 1 ? " x" + numberToCraft : "";
        var message = itemCraftedText + '\n' + this._indexWindow.item().name + out;
      
        $gameMessage.add(message);
    };

Code:
Scene_CraftingMenu.prototype.loseIngredients = function(){
        var item = this._indexWindow.item();
           var ing;
           var db;
           var needed;
        var consumed;
      
           item._ingredients.forEach(function(ing){
               needed = ing['amount'];
            consumed = ing['consumed'];
               if (ing['item'] == currencyText){
                   $gameParty.loseGold(needed);
               } else {
                if(consumed) {
                    $gameParty.loseItem(ing['item'], needed);
                }
               }
           }, this);
        this._ingredientsWindow.refresh();
    };

With these changes, you can now set up your item's recipe like so:

Code:
<recipe>
   o: 4 # Number of items to be outputted with a single craft
   i: 12, 1, true # Requires 1 of item #12, and this item will be consumed
   i: 71, 1, false # Requires 1 of item# 71, and this item will not be consumed
</recipe>



I replaced all of the code, but that somehow causes the game to crash with the message "Cannot reach property *forEach' of null"
 
Last edited:

EAP

Villager
Member
Joined
Jan 29, 2019
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMMZ
So random question is there a way to add a level requirement to this or is there one built in that is not spoken of etc?
 

3Eyedcowboy

Villager
Member
Joined
Jun 28, 2020
Messages
8
Reaction score
2
First Language
English
Primarily Uses
RMMV
So random question is there a way to add a level requirement to this or is there one built in that is not spoken of etc?

Not quite.

The plugin TECHNICALLY has options for "adding a recipe to an existing book," which you can trigger at a certain level; But it never seemed to work for me. So I made a worked around: just add an extra item.

Ex. The base book (key item) includes items a-e.
At level 15, they gain a key item "advanced crafting techniques," and that key item lets them access crafting for items F & G.
 

rohzek

Warper
Member
Joined
Oct 7, 2017
Messages
3
Reaction score
1
First Language
English
Primarily Uses
RMMV
Update: I was able to figure it out (except for the sound effect; don't know enough about java to know where exactly to type it in, but that's not a big deal.)

The neat thing that Rohsek's tweak also allows: you can now pull out the book to check the recipes without allowing people to craft anywhere.

How to:
Create 2 key items: a recipe book and a crafting station.

>Give the PC a recipe book that pulls up up the crafting event (and let them keep it in their inventory). Set the recipe book to accessible from main menu.

>Every recipe includes the ingredient "crafting station" (which is set to false, non-disposable)

>Whenever the PC uses the crafting station event, they gain the key item "crafting station," then take it away when they leave the station.

Glad you got it figured out. That's a pretty nice way to handle crafting and recipe tracking, I like that. And with a little more tweaking of the different "crafting station" options, you could have it so you can only smelt ore at a smelter, or process like... pelts at a tannery, etc. That could be in-depth and pretty cool.

As for the sound effects: the way it's currently implemented, it seems there's a single sound effect for the entire category, not per recipe. So you'd set it up in the plugin settings under the 'CraftingSounds' section, I believe.

As a small side note, RPGMV and MZ use JavaScript which is a completely different language than Java, so if you do go to google something for it, note they are different things. JS is used mostly in web development, though technically things like Node and Electron can let you use them for Desktop environments (Discord, built in Electron, is basically a web browser under the hood). Interestingly enough, they both appeared around the same time, though Java came first: Java came out in May of 1995, and JavaScript in December of 1995.

zeUB1LV.png


I just noticed something that confuses me.
What is "Price" for?
Given how money is in the crafting recipe with 'currency' I do not really understand its purpose

Price and currency refer to the same thing in different ways. In the code/recipe it's referred to as currency as in the amount of money required to craft the item (such as a crafting NPC that you pay to craft things with your ingredients) in the raw "ingredients required" sense, but the "Price" text is only for what gets displayed on the crafting GUI under the requirements,
e.g. if you had a recipe that cost money, then in the GUI you'd see:
Code:
Ingredients:
SomeItem                                    x1
OtherItem                                   x2


Price:
Gold                                       x10
Or something like that.

I replaced all of the code, but that somehow causes the game to crash with the message "Cannot reach property *forEach' of null"

Given how JS is, I'd imagine you might have left off a semi-colon or a curly-brace somewhere. If you can show me the output of the Developer Console, I'd be happy to help you track down the problem. I don't feel comfortable handing out my version of the file, however, since that's basically just 'unauthorized' re-distributing of Szyu's work and according to his profile he's logged in as recently as May of 2020, even if he hasn't posted in five years. I don't know if it's really considered "abandoned."
 

Latest Threads

Latest Posts

Latest Profile Posts

I think it's ready - Chapter Selection:
unknown.png
On another more gaming topic, I paid 20 bucks for a visual novel to emotionally destroy me. I may write an entry about that.
1638611395177.png
Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!

Forum statistics

Threads
117,171
Messages
1,105,132
Members
153,267
Latest member
Christopher626
Top